@veewo/gitnexus 1.5.5 → 1.5.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/benchmark/analyze-runner.d.ts +0 -2
  2. package/dist/benchmark/analyze-runner.js +0 -6
  3. package/dist/benchmark/analyze-runner.test.js +1 -10
  4. package/dist/benchmark/runner.d.ts +0 -2
  5. package/dist/benchmark/runner.js +0 -2
  6. package/dist/benchmark/u2-e2e/neonspark-full-e2e.js +0 -11
  7. package/dist/benchmark/u2-performance-sampler.js +3 -16
  8. package/dist/cli/analyze-options.d.ts +19 -6
  9. package/dist/cli/analyze-options.js +76 -71
  10. package/dist/cli/analyze-options.test.js +78 -73
  11. package/dist/cli/analyze.d.ts +2 -4
  12. package/dist/cli/analyze.js +13 -25
  13. package/dist/cli/analyze.test.js +9 -15
  14. package/dist/cli/benchmark-agent-context.d.ts +0 -2
  15. package/dist/cli/benchmark-agent-context.js +0 -2
  16. package/dist/cli/benchmark-agent-safe-query-context.d.ts +0 -2
  17. package/dist/cli/benchmark-agent-safe-query-context.js +0 -2
  18. package/dist/cli/benchmark-unity.d.ts +0 -2
  19. package/dist/cli/benchmark-unity.js +0 -2
  20. package/dist/cli/clean.d.ts +2 -3
  21. package/dist/cli/clean.js +4 -25
  22. package/dist/cli/index.js +1 -10
  23. package/dist/core/ingestion/pipeline.js +1 -1
  24. package/dist/storage/repo-manager.d.ts +1 -0
  25. package/package.json +2 -2
  26. package/skills/gitnexus-cli.md +62 -38
  27. package/vendor/node_modules/node-addon-api/node_addon_api.Makefile +6 -0
  28. package/vendor/node_modules/node-addon-api/node_addon_api.target.mk +122 -0
  29. package/vendor/node_modules/node-addon-api/node_addon_api_except.target.mk +126 -0
  30. package/vendor/node_modules/node-addon-api/node_addon_api_except_all.target.mk +122 -0
  31. package/vendor/node_modules/node-addon-api/node_addon_api_maybe.target.mk +122 -0
  32. package/vendor/tree-sitter-dart/build/Release/.deps/node_modules/node-addon-api/node_addon_api_except.stamp.d +1 -0
  33. package/vendor/tree-sitter-dart/build/node_modules/node-addon-api/node_addon_api_except.stamp +0 -0
  34. package/vendor/tree-sitter-proto/build/Release/.deps/node_modules/node-addon-api/node_addon_api_except.stamp.d +1 -0
  35. package/vendor/tree-sitter-proto/build/node_modules/node-addon-api/node_addon_api_except.stamp +0 -0
  36. package/dist/cli/scope-manifest-config.d.ts +0 -9
  37. package/dist/cli/scope-manifest-config.js +0 -37
  38. package/dist/cli/sync-manifest.d.ts +0 -27
  39. package/dist/cli/sync-manifest.js +0 -200
  40. package/dist/cli/sync-manifest.test.d.ts +0 -1
  41. package/dist/cli/sync-manifest.test.js +0 -88
@@ -0,0 +1,126 @@
1
+ # This file is generated by gyp; do not edit.
2
+
3
+ TOOLSET := target
4
+ TARGET := node_addon_api_except
5
+ DEFS_Debug := \
6
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_except' \
7
+ '-DUSING_UV_SHARED=1' \
8
+ '-DUSING_V8_SHARED=1' \
9
+ '-DV8_DEPRECATION_WARNINGS=1' \
10
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
11
+ '-D_FILE_OFFSET_BITS=64' \
12
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
13
+ '-D_LARGEFILE_SOURCE' \
14
+ '-DOPENSSL_NO_PINSHARED' \
15
+ '-DOPENSSL_THREADS' \
16
+ '-DDEBUG' \
17
+ '-D_DEBUG'
18
+
19
+ # Flags passed to all source files.
20
+ CFLAGS_Debug := \
21
+ -O0 \
22
+ -gdwarf-2 \
23
+ -fno-strict-aliasing \
24
+ -mmacosx-version-min=13.5 \
25
+ -arch \
26
+ arm64 \
27
+ -Wall \
28
+ -Wendif-labels \
29
+ -W \
30
+ -Wno-unused-parameter
31
+
32
+ # Flags passed to only C files.
33
+ CFLAGS_C_Debug :=
34
+
35
+ # Flags passed to only C++ files.
36
+ CFLAGS_CC_Debug := \
37
+ -std=gnu++20 \
38
+ -stdlib=libc++ \
39
+ -fno-rtti \
40
+ -fno-exceptions
41
+
42
+ # Flags passed to only ObjC files.
43
+ CFLAGS_OBJC_Debug :=
44
+
45
+ # Flags passed to only ObjC++ files.
46
+ CFLAGS_OBJCC_Debug :=
47
+
48
+ INCS_Debug := \
49
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
50
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
51
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
52
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
53
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
54
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
55
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
56
+
57
+ DEFS_Release := \
58
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_except' \
59
+ '-DUSING_UV_SHARED=1' \
60
+ '-DUSING_V8_SHARED=1' \
61
+ '-DV8_DEPRECATION_WARNINGS=1' \
62
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
63
+ '-D_FILE_OFFSET_BITS=64' \
64
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
65
+ '-D_LARGEFILE_SOURCE' \
66
+ '-DOPENSSL_NO_PINSHARED' \
67
+ '-DOPENSSL_THREADS'
68
+
69
+ # Flags passed to all source files.
70
+ CFLAGS_Release := \
71
+ -O3 \
72
+ -gdwarf-2 \
73
+ -fno-strict-aliasing \
74
+ -mmacosx-version-min=13.5 \
75
+ -arch \
76
+ arm64 \
77
+ -Wall \
78
+ -Wendif-labels \
79
+ -W \
80
+ -Wno-unused-parameter
81
+
82
+ # Flags passed to only C files.
83
+ CFLAGS_C_Release :=
84
+
85
+ # Flags passed to only C++ files.
86
+ CFLAGS_CC_Release := \
87
+ -std=gnu++20 \
88
+ -stdlib=libc++ \
89
+ -fno-rtti \
90
+ -fno-exceptions
91
+
92
+ # Flags passed to only ObjC files.
93
+ CFLAGS_OBJC_Release :=
94
+
95
+ # Flags passed to only ObjC++ files.
96
+ CFLAGS_OBJCC_Release :=
97
+
98
+ INCS_Release := \
99
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
100
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
101
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
102
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
103
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
104
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
105
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
106
+
107
+ OBJS :=
108
+
109
+ # Add to the list of files we specially track dependencies for.
110
+ all_deps += $(OBJS)
111
+
112
+
113
+ ### Rules for final target.
114
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_except.stamp: TOOLSET := $(TOOLSET)
115
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_except.stamp: FORCE_DO_CMD
116
+ $(call do_cmd,touch)
117
+
118
+ all_deps += $(obj).target/../../node_modules/node-addon-api/node_addon_api_except.stamp
119
+ # Add target alias
120
+ .PHONY: node_addon_api_except
121
+ node_addon_api_except: $(obj).target/../../node_modules/node-addon-api/node_addon_api_except.stamp
122
+
123
+ # Add target alias to "all" target.
124
+ .PHONY: all
125
+ all: node_addon_api_except
126
+
@@ -0,0 +1,122 @@
1
+ # This file is generated by gyp; do not edit.
2
+
3
+ TOOLSET := target
4
+ TARGET := node_addon_api_except_all
5
+ DEFS_Debug := \
6
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_except_all' \
7
+ '-DUSING_UV_SHARED=1' \
8
+ '-DUSING_V8_SHARED=1' \
9
+ '-DV8_DEPRECATION_WARNINGS=1' \
10
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
11
+ '-D_FILE_OFFSET_BITS=64' \
12
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
13
+ '-D_LARGEFILE_SOURCE' \
14
+ '-DOPENSSL_NO_PINSHARED' \
15
+ '-DOPENSSL_THREADS' \
16
+ '-DDEBUG' \
17
+ '-D_DEBUG'
18
+
19
+ # Flags passed to all source files.
20
+ CFLAGS_Debug := \
21
+ -O0 \
22
+ -gdwarf-2 \
23
+ -fno-strict-aliasing \
24
+ -mmacosx-version-min=13.5 \
25
+ -arch \
26
+ arm64 \
27
+ -Wall \
28
+ -Wendif-labels \
29
+ -W \
30
+ -Wno-unused-parameter
31
+
32
+ # Flags passed to only C files.
33
+ CFLAGS_C_Debug :=
34
+
35
+ # Flags passed to only C++ files.
36
+ CFLAGS_CC_Debug := \
37
+ -std=gnu++20 \
38
+ -stdlib=libc++ \
39
+ -fno-rtti \
40
+ -fno-exceptions
41
+
42
+ # Flags passed to only ObjC files.
43
+ CFLAGS_OBJC_Debug :=
44
+
45
+ # Flags passed to only ObjC++ files.
46
+ CFLAGS_OBJCC_Debug :=
47
+
48
+ INCS_Debug := \
49
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
50
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
51
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
52
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
53
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
54
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
55
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
56
+
57
+ DEFS_Release := \
58
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_except_all' \
59
+ '-DUSING_UV_SHARED=1' \
60
+ '-DUSING_V8_SHARED=1' \
61
+ '-DV8_DEPRECATION_WARNINGS=1' \
62
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
63
+ '-D_FILE_OFFSET_BITS=64' \
64
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
65
+ '-D_LARGEFILE_SOURCE' \
66
+ '-DOPENSSL_NO_PINSHARED' \
67
+ '-DOPENSSL_THREADS'
68
+
69
+ # Flags passed to all source files.
70
+ CFLAGS_Release := \
71
+ -O3 \
72
+ -gdwarf-2 \
73
+ -fno-strict-aliasing \
74
+ -mmacosx-version-min=13.5 \
75
+ -arch \
76
+ arm64 \
77
+ -Wall \
78
+ -Wendif-labels \
79
+ -W \
80
+ -Wno-unused-parameter
81
+
82
+ # Flags passed to only C files.
83
+ CFLAGS_C_Release :=
84
+
85
+ # Flags passed to only C++ files.
86
+ CFLAGS_CC_Release := \
87
+ -std=gnu++20 \
88
+ -stdlib=libc++ \
89
+ -fno-rtti \
90
+ -fno-exceptions
91
+
92
+ # Flags passed to only ObjC files.
93
+ CFLAGS_OBJC_Release :=
94
+
95
+ # Flags passed to only ObjC++ files.
96
+ CFLAGS_OBJCC_Release :=
97
+
98
+ INCS_Release := \
99
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
100
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
101
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
102
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
103
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
104
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
105
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
106
+
107
+ OBJS :=
108
+
109
+ # Add to the list of files we specially track dependencies for.
110
+ all_deps += $(OBJS)
111
+
112
+
113
+ ### Rules for final target.
114
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_except_all.stamp: TOOLSET := $(TOOLSET)
115
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_except_all.stamp: FORCE_DO_CMD
116
+ $(call do_cmd,touch)
117
+
118
+ all_deps += $(obj).target/../../node_modules/node-addon-api/node_addon_api_except_all.stamp
119
+ # Add target alias
120
+ .PHONY: node_addon_api_except_all
121
+ node_addon_api_except_all: $(obj).target/../../node_modules/node-addon-api/node_addon_api_except_all.stamp
122
+
@@ -0,0 +1,122 @@
1
+ # This file is generated by gyp; do not edit.
2
+
3
+ TOOLSET := target
4
+ TARGET := node_addon_api_maybe
5
+ DEFS_Debug := \
6
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_maybe' \
7
+ '-DUSING_UV_SHARED=1' \
8
+ '-DUSING_V8_SHARED=1' \
9
+ '-DV8_DEPRECATION_WARNINGS=1' \
10
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
11
+ '-D_FILE_OFFSET_BITS=64' \
12
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
13
+ '-D_LARGEFILE_SOURCE' \
14
+ '-DOPENSSL_NO_PINSHARED' \
15
+ '-DOPENSSL_THREADS' \
16
+ '-DDEBUG' \
17
+ '-D_DEBUG'
18
+
19
+ # Flags passed to all source files.
20
+ CFLAGS_Debug := \
21
+ -O0 \
22
+ -gdwarf-2 \
23
+ -fno-strict-aliasing \
24
+ -mmacosx-version-min=13.5 \
25
+ -arch \
26
+ arm64 \
27
+ -Wall \
28
+ -Wendif-labels \
29
+ -W \
30
+ -Wno-unused-parameter
31
+
32
+ # Flags passed to only C files.
33
+ CFLAGS_C_Debug :=
34
+
35
+ # Flags passed to only C++ files.
36
+ CFLAGS_CC_Debug := \
37
+ -std=gnu++20 \
38
+ -stdlib=libc++ \
39
+ -fno-rtti \
40
+ -fno-exceptions
41
+
42
+ # Flags passed to only ObjC files.
43
+ CFLAGS_OBJC_Debug :=
44
+
45
+ # Flags passed to only ObjC++ files.
46
+ CFLAGS_OBJCC_Debug :=
47
+
48
+ INCS_Debug := \
49
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
50
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
51
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
52
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
53
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
54
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
55
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
56
+
57
+ DEFS_Release := \
58
+ '-DNODE_GYP_MODULE_NAME=node_addon_api_maybe' \
59
+ '-DUSING_UV_SHARED=1' \
60
+ '-DUSING_V8_SHARED=1' \
61
+ '-DV8_DEPRECATION_WARNINGS=1' \
62
+ '-D_GLIBCXX_USE_CXX11_ABI=1' \
63
+ '-D_FILE_OFFSET_BITS=64' \
64
+ '-D_DARWIN_USE_64_BIT_INODE=1' \
65
+ '-D_LARGEFILE_SOURCE' \
66
+ '-DOPENSSL_NO_PINSHARED' \
67
+ '-DOPENSSL_THREADS'
68
+
69
+ # Flags passed to all source files.
70
+ CFLAGS_Release := \
71
+ -O3 \
72
+ -gdwarf-2 \
73
+ -fno-strict-aliasing \
74
+ -mmacosx-version-min=13.5 \
75
+ -arch \
76
+ arm64 \
77
+ -Wall \
78
+ -Wendif-labels \
79
+ -W \
80
+ -Wno-unused-parameter
81
+
82
+ # Flags passed to only C files.
83
+ CFLAGS_C_Release :=
84
+
85
+ # Flags passed to only C++ files.
86
+ CFLAGS_CC_Release := \
87
+ -std=gnu++20 \
88
+ -stdlib=libc++ \
89
+ -fno-rtti \
90
+ -fno-exceptions
91
+
92
+ # Flags passed to only ObjC files.
93
+ CFLAGS_OBJC_Release :=
94
+
95
+ # Flags passed to only ObjC++ files.
96
+ CFLAGS_OBJCC_Release :=
97
+
98
+ INCS_Release := \
99
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/include/node \
100
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/src \
101
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/config \
102
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/openssl/openssl/include \
103
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/uv/include \
104
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/zlib \
105
+ -I/Users/nantasmac/Library/Caches/node-gyp/24.15.0/deps/v8/include
106
+
107
+ OBJS :=
108
+
109
+ # Add to the list of files we specially track dependencies for.
110
+ all_deps += $(OBJS)
111
+
112
+
113
+ ### Rules for final target.
114
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_maybe.stamp: TOOLSET := $(TOOLSET)
115
+ $(obj).target/../../node_modules/node-addon-api/node_addon_api_maybe.stamp: FORCE_DO_CMD
116
+ $(call do_cmd,touch)
117
+
118
+ all_deps += $(obj).target/../../node_modules/node-addon-api/node_addon_api_maybe.stamp
119
+ # Add target alias
120
+ .PHONY: node_addon_api_maybe
121
+ node_addon_api_maybe: $(obj).target/../../node_modules/node-addon-api/node_addon_api_maybe.stamp
122
+
@@ -0,0 +1 @@
1
+ cmd_Release/obj.target/../../node_modules/node-addon-api/node_addon_api_except.stamp := touch Release/obj.target/../../node_modules/node-addon-api/node_addon_api_except.stamp
@@ -0,0 +1 @@
1
+ cmd_Release/obj.target/../../node_modules/node-addon-api/node_addon_api_except.stamp := touch Release/obj.target/../../node_modules/node-addon-api/node_addon_api_except.stamp
@@ -1,9 +0,0 @@
1
- export interface ScopeManifestConfig {
2
- scopeRules: string[];
3
- directives: {
4
- extensions?: string;
5
- repoAlias?: string;
6
- embeddings?: string;
7
- };
8
- }
9
- export declare function parseScopeManifestConfig(raw: string): ScopeManifestConfig;
@@ -1,37 +0,0 @@
1
- import { normalizeScopeRules, normalizeScopedPath } from '../core/ingestion/scope-filter.js';
2
- const SUPPORTED_DIRECTIVES = new Set(['extensions', 'repoalias', 'embeddings']);
3
- export function parseScopeManifestConfig(raw) {
4
- const scopeRules = [];
5
- const directives = {};
6
- const lines = raw.split(/\r?\n/);
7
- for (const [index, line] of lines.entries()) {
8
- const trimmed = line.trim();
9
- if (!trimmed || trimmed.startsWith('#'))
10
- continue;
11
- if (trimmed.startsWith('@')) {
12
- const separatorIndex = trimmed.indexOf('=');
13
- if (separatorIndex <= 1) {
14
- throw new Error(`Invalid manifest directive at line ${index + 1}: ${trimmed}`);
15
- }
16
- const key = trimmed.slice(1, separatorIndex).trim().toLowerCase();
17
- const value = trimmed.slice(separatorIndex + 1).trim();
18
- if (!SUPPORTED_DIRECTIVES.has(key)) {
19
- throw new Error(`Unknown manifest directive: @${key}`);
20
- }
21
- if (key === 'extensions')
22
- directives.extensions = value;
23
- else if (key === 'repoalias')
24
- directives.repoAlias = value;
25
- else if (key === 'embeddings')
26
- directives.embeddings = value;
27
- continue;
28
- }
29
- const normalized = normalizeScopedPath(trimmed);
30
- if (normalized)
31
- scopeRules.push(normalized);
32
- }
33
- return {
34
- scopeRules: normalizeScopeRules(scopeRules),
35
- directives,
36
- };
37
- }
@@ -1,27 +0,0 @@
1
- export interface SyncManifestScopeOptions {
2
- scopeManifest?: string;
3
- scopePrefix?: string[] | string;
4
- }
5
- export type SyncManifestPolicy = 'ask' | 'update' | 'keep' | 'error';
6
- export interface SyncManifestDiffEntry {
7
- directive: 'extensions' | 'repoAlias' | 'embeddings';
8
- manifestValue?: string;
9
- cliValue: string;
10
- }
11
- export interface EnforceSyncManifestConsistencyInput {
12
- manifestPath?: string;
13
- extensions?: string;
14
- repoAlias?: string;
15
- embeddings?: boolean;
16
- policy?: SyncManifestPolicy;
17
- stdinIsTTY?: boolean;
18
- prompt?: (message: string) => Promise<'update' | 'keep'>;
19
- }
20
- export interface EnforceSyncManifestConsistencyResult {
21
- decision: 'none' | 'update' | 'keep';
22
- diff: SyncManifestDiffEntry[];
23
- }
24
- export declare function resolveDefaultSyncManifestPath(repoPath: string): string;
25
- export declare function shouldAutoUseSyncManifest(options?: SyncManifestScopeOptions): boolean;
26
- export declare function resolveScopeManifestForAnalyze(repoPath: string, options?: SyncManifestScopeOptions, pathExists?: (candidatePath: string) => Promise<boolean>): Promise<string | undefined>;
27
- export declare function enforceSyncManifestConsistency(input: EnforceSyncManifestConsistencyInput): Promise<EnforceSyncManifestConsistencyResult>;
@@ -1,200 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import readline from 'node:readline/promises';
4
- import { stdin as input, stdout as output } from 'node:process';
5
- import { parseScopeManifestConfig } from './scope-manifest-config.js';
6
- import { normalizeRepoAlias, parseExtensionList } from './analyze-options.js';
7
- export function resolveDefaultSyncManifestPath(repoPath) {
8
- return path.join(repoPath, '.gitnexus', 'sync-manifest.txt');
9
- }
10
- export function shouldAutoUseSyncManifest(options) {
11
- if (options?.scopeManifest)
12
- return false;
13
- return parseScopePrefixCount(options?.scopePrefix) === 0;
14
- }
15
- export async function resolveScopeManifestForAnalyze(repoPath, options, pathExists = fileExists) {
16
- if (options?.scopeManifest) {
17
- return options.scopeManifest;
18
- }
19
- if (!shouldAutoUseSyncManifest(options)) {
20
- return undefined;
21
- }
22
- const defaultManifestPath = resolveDefaultSyncManifestPath(repoPath);
23
- if (await pathExists(defaultManifestPath)) {
24
- return defaultManifestPath;
25
- }
26
- return undefined;
27
- }
28
- export async function enforceSyncManifestConsistency(input) {
29
- if (!input.manifestPath) {
30
- return { decision: 'none', diff: [] };
31
- }
32
- ensureConcreteManifestPath(input.manifestPath);
33
- const raw = await fs.readFile(input.manifestPath, 'utf-8');
34
- const parsed = parseScopeManifestConfig(raw);
35
- const normalizedDirectives = normalizeManifestDirectives(parsed.directives);
36
- const diff = computeDiff(normalizedDirectives, input);
37
- const policy = normalizePolicy(input.policy);
38
- if (diff.length === 0) {
39
- if (policy === 'update') {
40
- throw new Error('Sync manifest rewrite requires non-empty diff entries.');
41
- }
42
- return { decision: 'none', diff };
43
- }
44
- const decision = await resolveDecision(policy, input.manifestPath, diff, input.stdinIsTTY, input.prompt);
45
- if (decision === 'update') {
46
- const nextDirectives = mergeDirectivesForUpdate(normalizedDirectives, input);
47
- const rewritten = renderSyncManifest(parsed.scopeRules, nextDirectives);
48
- await fs.writeFile(input.manifestPath, rewritten, 'utf-8');
49
- }
50
- return {
51
- decision,
52
- diff,
53
- };
54
- }
55
- function parseScopePrefixCount(scopePrefix) {
56
- if (Array.isArray(scopePrefix))
57
- return scopePrefix.length;
58
- if (typeof scopePrefix === 'string')
59
- return scopePrefix.trim() ? 1 : 0;
60
- return 0;
61
- }
62
- async function fileExists(candidatePath) {
63
- try {
64
- await fs.stat(candidatePath);
65
- return true;
66
- }
67
- catch {
68
- return false;
69
- }
70
- }
71
- function normalizePolicy(raw) {
72
- if (!raw)
73
- return 'ask';
74
- if (raw === 'ask' || raw === 'update' || raw === 'keep' || raw === 'error')
75
- return raw;
76
- throw new Error(`Invalid --sync-manifest-policy value: ${raw}. Use ask|update|keep|error.`);
77
- }
78
- function normalizeManifestDirectives(directives) {
79
- return {
80
- extensions: normalizeExtensions(directives.extensions),
81
- repoAlias: normalizeAlias(directives.repoAlias),
82
- embeddings: normalizeEmbeddings(directives.embeddings),
83
- };
84
- }
85
- function computeDiff(manifest, input) {
86
- const diff = [];
87
- if (input.extensions !== undefined) {
88
- const cliValue = normalizeExtensions(input.extensions);
89
- if (cliValue !== manifest.extensions) {
90
- diff.push({ directive: 'extensions', manifestValue: manifest.extensions, cliValue: cliValue || '' });
91
- }
92
- }
93
- if (input.repoAlias !== undefined) {
94
- const cliValue = normalizeAlias(input.repoAlias);
95
- if (cliValue !== manifest.repoAlias) {
96
- diff.push({ directive: 'repoAlias', manifestValue: manifest.repoAlias, cliValue: cliValue || '' });
97
- }
98
- }
99
- if (input.embeddings !== undefined) {
100
- const cliValue = input.embeddings ? 'true' : 'false';
101
- if (cliValue !== manifest.embeddings) {
102
- diff.push({ directive: 'embeddings', manifestValue: manifest.embeddings, cliValue });
103
- }
104
- }
105
- return diff;
106
- }
107
- async function resolveDecision(policy, manifestPath, diff, stdinIsTTY, prompt) {
108
- if (policy === 'update' || policy === 'keep')
109
- return policy;
110
- if (policy === 'error') {
111
- throw new Error(`${formatMismatchHeader(manifestPath)}\n${formatDiff(diff)}`);
112
- }
113
- if (stdinIsTTY === undefined) {
114
- throw new Error('TTY prompt branch requires concrete stdin.isTTY evidence.');
115
- }
116
- const interactive = stdinIsTTY;
117
- if (!interactive) {
118
- throw new Error(`${formatMismatchHeader(manifestPath)}\n${formatDiff(diff)}\n` +
119
- 'Non-interactive mode requires --sync-manifest-policy ask|update|keep|error.');
120
- }
121
- const promptFn = prompt || defaultPrompt;
122
- return promptFn([
123
- formatMismatchHeader(manifestPath),
124
- formatDiff(diff),
125
- 'Choose: update (rewrite sync-manifest) or keep (continue without rewrite).',
126
- ].join('\n'));
127
- }
128
- function mergeDirectivesForUpdate(manifest, input) {
129
- const merged = { ...manifest };
130
- if (input.extensions !== undefined) {
131
- merged.extensions = normalizeExtensions(input.extensions);
132
- }
133
- if (input.repoAlias !== undefined) {
134
- merged.repoAlias = normalizeAlias(input.repoAlias);
135
- }
136
- if (input.embeddings !== undefined) {
137
- merged.embeddings = input.embeddings ? 'true' : 'false';
138
- }
139
- return merged;
140
- }
141
- function renderSyncManifest(scopeRules, directives) {
142
- const lines = [...scopeRules];
143
- if (directives.extensions)
144
- lines.push(`@extensions=${directives.extensions}`);
145
- if (directives.repoAlias)
146
- lines.push(`@repoAlias=${directives.repoAlias}`);
147
- if (directives.embeddings)
148
- lines.push(`@embeddings=${directives.embeddings}`);
149
- return `${lines.join('\n')}\n`;
150
- }
151
- function normalizeExtensions(raw) {
152
- if (raw === undefined)
153
- return undefined;
154
- const parsed = parseExtensionList(raw);
155
- return parsed.length > 0 ? parsed.join(',') : undefined;
156
- }
157
- function normalizeAlias(raw) {
158
- if (raw === undefined)
159
- return undefined;
160
- return normalizeRepoAlias(raw);
161
- }
162
- function normalizeEmbeddings(raw) {
163
- if (raw === undefined)
164
- return undefined;
165
- const normalized = raw.trim().toLowerCase();
166
- if (normalized === 'true')
167
- return 'true';
168
- if (normalized === 'false')
169
- return 'false';
170
- throw new Error(`Invalid @embeddings directive value: ${raw}. Expected true or false.`);
171
- }
172
- function formatMismatchHeader(manifestPath) {
173
- return `Explicit analyze options differ from sync manifest directives: ${manifestPath}`;
174
- }
175
- function formatDiff(diff) {
176
- return diff
177
- .map((entry) => `- @${entry.directive}: ${entry.manifestValue ?? '<unset>'} -> ${entry.cliValue}`)
178
- .join('\n');
179
- }
180
- async function defaultPrompt(message) {
181
- const rl = readline.createInterface({ input, output });
182
- try {
183
- const answer = await rl.question(`${message}\nUpdate sync-manifest now? [y/N] `);
184
- return /^y(es)?$/i.test(answer.trim()) ? 'update' : 'keep';
185
- }
186
- finally {
187
- rl.close();
188
- }
189
- }
190
- function ensureConcreteManifestPath(manifestPath) {
191
- const normalized = manifestPath.trim();
192
- if (!normalized) {
193
- throw new Error('Invalid placeholder manifest path: empty value.');
194
- }
195
- if (/placeholder/i.test(normalized) ||
196
- /<\s*path\s*>/i.test(normalized) ||
197
- /todo/i.test(normalized)) {
198
- throw new Error(`Invalid placeholder manifest path: ${manifestPath}`);
199
- }
200
- }
@@ -1 +0,0 @@
1
- export {};