ultracode 5.4.0 → 5.6.0

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 (151) hide show
  1. package/dist/chunks/analysis-tool-handlers-GH5FDEWW.js +817 -0
  2. package/dist/chunks/analysis-tool-handlers-IXP4MWZX.js +817 -0
  3. package/dist/chunks/analysis-tool-handlers-LC2BTQYK.js +13 -0
  4. package/dist/chunks/analysis-tool-handlers-QYFKQPFL.js +817 -0
  5. package/dist/chunks/autodoc-tool-handlers-2HF6ERYN.js +1112 -0
  6. package/dist/chunks/autodoc-tool-handlers-4OGQJ7C3.js +1112 -0
  7. package/dist/chunks/autodoc-tool-handlers-N736CB56.js +138 -0
  8. package/dist/chunks/autodoc-tool-handlers-NQYBY6U4.js +1112 -0
  9. package/dist/chunks/branch-tool-handlers-KW3H4FJK.js +276 -0
  10. package/dist/chunks/branch-tool-handlers-QOUDZKJ2.js +276 -0
  11. package/dist/chunks/branch-tool-handlers-RB2U36KI.js +2 -0
  12. package/dist/chunks/branch-tool-handlers-ZHJM6PDK.js +276 -0
  13. package/dist/chunks/chunk-2Z6OQPYC.js +656 -0
  14. package/dist/chunks/chunk-3MQ7LRPN.js +322 -0
  15. package/dist/chunks/chunk-4W6QYGXZ.js +10 -0
  16. package/dist/chunks/chunk-533NFGUG.js +1 -0
  17. package/dist/chunks/chunk-5NUPOPWM.js +1 -0
  18. package/dist/chunks/chunk-AK4HIPA2.js +322 -0
  19. package/dist/chunks/chunk-B3H5NS3I.js +656 -0
  20. package/dist/chunks/chunk-DPTZHDST.js +4 -0
  21. package/dist/chunks/chunk-E5HQWLU5.js +322 -0
  22. package/dist/chunks/chunk-EOH25B5P.js +572 -0
  23. package/dist/chunks/chunk-ESV6F6E3.js +3179 -0
  24. package/dist/chunks/chunk-FPELPFER.js +924 -0
  25. package/dist/chunks/chunk-G6J42I55.js +161 -0
  26. package/dist/chunks/chunk-GCQE7ZYW.js +1 -0
  27. package/dist/chunks/chunk-GTIF6MOX.js +1 -0
  28. package/dist/chunks/chunk-I6STSSAK.js +2 -0
  29. package/dist/chunks/chunk-J2WBGTK2.js +4697 -0
  30. package/dist/chunks/chunk-KAYOX5EB.js +4697 -0
  31. package/dist/chunks/chunk-KPMTACOT.js +656 -0
  32. package/dist/chunks/chunk-L376GZ44.js +3179 -0
  33. package/dist/chunks/chunk-LCTOTHDA.js +15 -0
  34. package/dist/chunks/chunk-LEDJ7GVQ.js +316 -0
  35. package/dist/chunks/chunk-LH4OUKNZ.js +277 -0
  36. package/dist/chunks/chunk-O6IE2MEZ.js +161 -0
  37. package/dist/chunks/chunk-OEXPCY3F.js +316 -0
  38. package/dist/chunks/chunk-OMXOLFDN.js +924 -0
  39. package/dist/chunks/chunk-PLPBXWOU.js +3179 -0
  40. package/dist/chunks/chunk-PWLE5DN2.js +572 -0
  41. package/dist/chunks/chunk-PY43JPWL.js +447 -0
  42. package/dist/chunks/chunk-Q3B4EB7A.js +15 -0
  43. package/dist/chunks/chunk-Q5LPVLXA.js +337 -0
  44. package/dist/chunks/chunk-QIRZHZK2.js +5 -0
  45. package/dist/chunks/chunk-ROQ27LSL.js +924 -0
  46. package/dist/chunks/chunk-S5Q7BD6J.js +572 -0
  47. package/dist/chunks/chunk-SAMX3HJQ.js +337 -0
  48. package/dist/chunks/chunk-SV3WKUNV.js +1 -0
  49. package/dist/chunks/chunk-TCHCDCDO.js +167 -0
  50. package/dist/chunks/chunk-TR3HS7U6.js +316 -0
  51. package/dist/chunks/chunk-TUWE6FCW.js +167 -0
  52. package/dist/chunks/chunk-TVOTA7EE.js +277 -0
  53. package/dist/chunks/chunk-VS44D772.js +337 -0
  54. package/dist/chunks/chunk-WIE3G5ES.js +167 -0
  55. package/dist/chunks/chunk-XG3ACLWR.js +5 -0
  56. package/dist/chunks/chunk-XJ2Z5QQO.js +1 -0
  57. package/dist/chunks/chunk-XK2NY7RB.js +277 -0
  58. package/dist/chunks/chunk-Y4F7NZFZ.js +4700 -0
  59. package/dist/chunks/chunk-YS75L3ZS.js +161 -0
  60. package/dist/chunks/chunk-ZVG5HHI3.js +15 -0
  61. package/dist/chunks/dev-agent-DDDIVWOF.js +1 -0
  62. package/dist/chunks/dev-agent-E2VCFKXN.js +1624 -0
  63. package/dist/chunks/dev-agent-KJNSU5KQ.js +1624 -0
  64. package/dist/chunks/dev-agent-NDERYIPV.js +1624 -0
  65. package/dist/chunks/faiss-provider-7R4BQDIV.js +12 -0
  66. package/dist/chunks/faiss-provider-7ZFRSDN5.js +12 -0
  67. package/dist/chunks/faiss-provider-SXB7FTLB.js +1 -0
  68. package/dist/chunks/faiss-provider-TKLBEUSH.js +12 -0
  69. package/dist/chunks/file-tool-handlers-5DODQXGF.js +1027 -0
  70. package/dist/chunks/file-tool-handlers-KGHLE4KR.js +1027 -0
  71. package/dist/chunks/file-tool-handlers-KTOQ4NFS.js +12 -0
  72. package/dist/chunks/file-tool-handlers-V4SFUDQB.js +1027 -0
  73. package/dist/chunks/graph-metrics-tool-handlers-3AV4X4ZY.js +65 -0
  74. package/dist/chunks/graph-metrics-tool-handlers-3VMDQHJ6.js +65 -0
  75. package/dist/chunks/graph-metrics-tool-handlers-BZ6E6YHF.js +1 -0
  76. package/dist/chunks/graph-metrics-tool-handlers-IYBGSXL7.js +65 -0
  77. package/dist/chunks/graph-storage-factory-2CQ2RPDV.js +13 -0
  78. package/dist/chunks/graph-storage-factory-C5SMMYL6.js +13 -0
  79. package/dist/chunks/graph-storage-factory-EEO2V3GJ.js +1 -0
  80. package/dist/chunks/graph-storage-factory-WBCTXP34.js +13 -0
  81. package/dist/chunks/history-tool-handlers-AS7OQFZI.js +1 -0
  82. package/dist/chunks/history-tool-handlers-FSNJYXV2.js +208 -0
  83. package/dist/chunks/history-tool-handlers-JZAH4EIQ.js +208 -0
  84. package/dist/chunks/history-tool-handlers-KCSCXZ7T.js +208 -0
  85. package/dist/chunks/incremental-updater-A2EL4QXU.js +14 -0
  86. package/dist/chunks/incremental-updater-EQIKBVY2.js +14 -0
  87. package/dist/chunks/incremental-updater-JFGRPH3B.js +14 -0
  88. package/dist/chunks/incremental-updater-S5BAAGHP.js +1 -0
  89. package/dist/chunks/indexer-agent-ASKY7JPG.js +1 -0
  90. package/dist/chunks/indexer-agent-NKAOF323.js +21 -0
  91. package/dist/chunks/indexer-agent-PJN5IOKQ.js +21 -0
  92. package/dist/chunks/indexer-agent-WRJFWKZX.js +21 -0
  93. package/dist/chunks/indexing-pipeline-D4P2O72Z.js +249 -0
  94. package/dist/chunks/indexing-pipeline-L7C543N4.js +1 -0
  95. package/dist/chunks/indexing-pipeline-NHPRN3AB.js +249 -0
  96. package/dist/chunks/indexing-pipeline-ZAXCZU22.js +249 -0
  97. package/dist/chunks/layered-faiss-provider-62CNW54X.js +1 -0
  98. package/dist/chunks/layered-faiss-provider-O7L77GFX.js +12 -0
  99. package/dist/chunks/layered-faiss-provider-RVHLHLPK.js +12 -0
  100. package/dist/chunks/layered-faiss-provider-YT7EDIJI.js +12 -0
  101. package/dist/chunks/merge-agent-3RF7VFF5.js +2481 -0
  102. package/dist/chunks/merge-agent-JCKTCBCE.js +2481 -0
  103. package/dist/chunks/merge-agent-VCL7OXPN.js +2481 -0
  104. package/dist/chunks/merge-agent-ZGK24WVF.js +11 -0
  105. package/dist/chunks/merge-tool-handlers-GV2LOIKU.js +277 -0
  106. package/dist/chunks/merge-tool-handlers-TYDWU5X2.js +277 -0
  107. package/dist/chunks/merge-tool-handlers-U7X2ZO2M.js +1 -0
  108. package/dist/chunks/merge-tool-handlers-YH62ZLPJ.js +277 -0
  109. package/dist/chunks/pattern-tool-handlers-76NF5JDS.js +13 -0
  110. package/dist/chunks/pattern-tool-handlers-IJAGEIVD.js +1549 -0
  111. package/dist/chunks/pattern-tool-handlers-VA5WYA62.js +1549 -0
  112. package/dist/chunks/pattern-tool-handlers-WQ6UBMJS.js +1549 -0
  113. package/dist/chunks/query-agent-36ADGCFZ.js +1 -0
  114. package/dist/chunks/query-agent-H22CR5N5.js +191 -0
  115. package/dist/chunks/query-agent-K2UGZS4M.js +191 -0
  116. package/dist/chunks/query-agent-YJCEHOXD.js +191 -0
  117. package/dist/chunks/semantic-agent-AC7CBEDE.js +6381 -0
  118. package/dist/chunks/semantic-agent-HK5X6CKU.js +6381 -0
  119. package/dist/chunks/semantic-agent-KONIKEGW.js +6381 -0
  120. package/dist/chunks/semantic-agent-LH6IZ2L7.js +137 -0
  121. package/dist/chunks/semantic-tool-handlers-5LMSH2U7.js +3 -0
  122. package/dist/chunks/semantic-tool-handlers-735UMO7Y.js +817 -0
  123. package/dist/chunks/semantic-tool-handlers-BNUYPP7X.js +817 -0
  124. package/dist/chunks/semantic-tool-handlers-MYZPEUD2.js +817 -0
  125. package/dist/chunks/snapshot-tool-handlers-6SIHZT2F.js +201 -0
  126. package/dist/chunks/snapshot-tool-handlers-DS4P3KOT.js +201 -0
  127. package/dist/chunks/snapshot-tool-handlers-JYHRFPC7.js +201 -0
  128. package/dist/chunks/snapshot-tool-handlers-YEHMAT3L.js +1 -0
  129. package/dist/chunks/storage-paths-A3C7WHHG.js +8 -0
  130. package/dist/chunks/storage-paths-HDYH7WPM.js +1 -0
  131. package/dist/chunks/storage-paths-IMFRHBWF.js +8 -0
  132. package/dist/chunks/storage-paths-P3PUSMUD.js +8 -0
  133. package/dist/chunks/taint-tool-handlers-CWESOOMQ.js +68 -0
  134. package/dist/chunks/taint-tool-handlers-OG3NVVP3.js +1 -0
  135. package/dist/chunks/taint-tool-handlers-ON3G3FA7.js +68 -0
  136. package/dist/chunks/taint-tool-handlers-P4P5J6DB.js +68 -0
  137. package/dist/chunks/tracing-tool-handlers-4BDCXTZZ.js +3935 -0
  138. package/dist/chunks/tracing-tool-handlers-6FPNM7HX.js +3935 -0
  139. package/dist/chunks/tracing-tool-handlers-LQTQ5SKK.js +89 -0
  140. package/dist/chunks/tracing-tool-handlers-XRQX2DTS.js +3935 -0
  141. package/dist/chunks/validation-tool-handlers-DZUG7KYY.js +2 -0
  142. package/dist/chunks/validation-tool-handlers-O6TGFSH5.js +555 -0
  143. package/dist/chunks/validation-tool-handlers-RREUYKIR.js +555 -0
  144. package/dist/chunks/validation-tool-handlers-XPWSMS37.js +555 -0
  145. package/dist/index.js +13 -13
  146. package/dist/roslyn-addon/.build-hash +1 -1
  147. package/dist/roslyn-addon/ILGPU.Algorithms.dll +0 -0
  148. package/dist/roslyn-addon/ILGPU.dll +0 -0
  149. package/dist/roslyn-addon/UltraCode.CSharp.deps.json +35 -0
  150. package/dist/roslyn-addon/UltraCode.CSharp.dll +0 -0
  151. package/package.json +1 -1
@@ -0,0 +1,161 @@
1
+ import { init_storage_paths, storage_paths_exports, getProjectHash, getCurrentGitBranch, getProjectDir } from './chunk-TVOTA7EE.js';
2
+ import { init_logging, log } from './chunk-VCCBEJQ5.js';
3
+ import { __toCommonJS } from './chunk-NAQKA54E.js';
4
+ import { execSync } from 'child_process';
5
+ import { existsSync, readFileSync, writeFileSync } from 'fs';
6
+ import { join } from 'path';
7
+
8
+ // src/semantic/faiss/base-branch-detector.ts
9
+ init_logging();
10
+ init_storage_paths();
11
+ var BASE_BRANCH_CANDIDATES = ["main", "master", "dev", "develop", "trunk"];
12
+ var BASE_META_FILENAME = "faiss-base.meta.json";
13
+ function getBaseMetaPath(projectPath) {
14
+ return join(getProjectDir(projectPath), BASE_META_FILENAME);
15
+ }
16
+ function getBaseMetaPathByHash(projectHash) {
17
+ const { getProjectsDir } = (init_storage_paths(), __toCommonJS(storage_paths_exports));
18
+ return join(getProjectsDir(), projectHash, BASE_META_FILENAME);
19
+ }
20
+ function loadBaseMetadata(projectPath) {
21
+ const metaPath = getBaseMetaPath(projectPath);
22
+ if (!existsSync(metaPath)) {
23
+ return null;
24
+ }
25
+ try {
26
+ const data = readFileSync(metaPath, "utf-8");
27
+ return JSON.parse(data);
28
+ } catch (error) {
29
+ log.w("BASE_DETECT", "meta_read_fail", { path: metaPath, err: String(error) });
30
+ return null;
31
+ }
32
+ }
33
+ function saveBaseMetadata(projectPath, metadata) {
34
+ const metaPath = getBaseMetaPath(projectPath);
35
+ try {
36
+ writeFileSync(metaPath, JSON.stringify(metadata, null, 2), "utf-8");
37
+ log.d("BASE_DETECT", "meta_saved", { branch: metadata.baseBranch, path: metaPath });
38
+ } catch (error) {
39
+ log.e("BASE_DETECT", "meta_save_fail", { path: metaPath, err: String(error) });
40
+ }
41
+ }
42
+ function getLocalBranches(projectPath) {
43
+ try {
44
+ const output = execSync("git branch --list", {
45
+ cwd: projectPath,
46
+ encoding: "utf-8",
47
+ stdio: ["pipe", "pipe", "ignore"],
48
+ windowsHide: true
49
+ });
50
+ return output.split("\n").map((line) => line.trim().replace(/^\* /, "")).filter((name) => name.length > 0);
51
+ } catch {
52
+ return [];
53
+ }
54
+ }
55
+ function getRemoteDefaultBranch(projectPath) {
56
+ try {
57
+ const ref = execSync("git symbolic-ref refs/remotes/origin/HEAD", {
58
+ cwd: projectPath,
59
+ encoding: "utf-8",
60
+ stdio: ["pipe", "pipe", "ignore"],
61
+ windowsHide: true
62
+ }).trim();
63
+ const parts = ref.split("/");
64
+ return parts[parts.length - 1] || null;
65
+ } catch {
66
+ return null;
67
+ }
68
+ }
69
+ function detectBaseBranch(projectPath) {
70
+ const projectHash = getProjectHash(projectPath);
71
+ const metaPath = getBaseMetaPath(projectPath);
72
+ log.d("BASE_DETECT", "start", {
73
+ projectPath,
74
+ projectHash,
75
+ metaPath,
76
+ metaExists: existsSync(metaPath)
77
+ });
78
+ const existingMeta = loadBaseMetadata(projectPath);
79
+ if (existingMeta?.baseBranch) {
80
+ log.d("BASE_DETECT", "using_existing", {
81
+ project: projectHash,
82
+ branch: existingMeta.baseBranch
83
+ });
84
+ return existingMeta.baseBranch;
85
+ }
86
+ const remoteDefault = getRemoteDefaultBranch(projectPath);
87
+ if (remoteDefault) {
88
+ log.d("BASE_DETECT", "using_remote_default", {
89
+ project: projectHash,
90
+ branch: remoteDefault
91
+ });
92
+ return remoteDefault;
93
+ }
94
+ const localBranches = getLocalBranches(projectPath);
95
+ for (const candidate of BASE_BRANCH_CANDIDATES) {
96
+ if (localBranches.includes(candidate)) {
97
+ log.d("BASE_DETECT", "using_common_name", {
98
+ project: projectHash,
99
+ branch: candidate
100
+ });
101
+ return candidate;
102
+ }
103
+ }
104
+ const currentBranch = getCurrentGitBranch(projectPath);
105
+ if (currentBranch) {
106
+ log.d("BASE_DETECT", "using_current", {
107
+ project: projectHash,
108
+ branch: currentBranch
109
+ });
110
+ return currentBranch;
111
+ }
112
+ log.w("BASE_DETECT", "no_git_repo", { project: projectHash });
113
+ return null;
114
+ }
115
+ function createInitialBaseMetadata(projectPath, branchName, dimensions, vectorCount = 0) {
116
+ const metadata = {
117
+ baseBranch: branchName,
118
+ vectorCount,
119
+ createdAt: Date.now(),
120
+ updatedAt: Date.now(),
121
+ dimensions,
122
+ indexType: "hnsw"
123
+ };
124
+ try {
125
+ const commit = execSync("git rev-parse --short HEAD", {
126
+ cwd: projectPath,
127
+ encoding: "utf-8",
128
+ stdio: ["pipe", "pipe", "ignore"],
129
+ windowsHide: true
130
+ }).trim();
131
+ if (commit) {
132
+ metadata.baseCommit = commit;
133
+ }
134
+ } catch {
135
+ }
136
+ saveBaseMetadata(projectPath, metadata);
137
+ log.i("BASE_DETECT", "base_created", {
138
+ project: getProjectHash(projectPath),
139
+ branch: branchName,
140
+ vectors: vectorCount,
141
+ dimensions
142
+ });
143
+ return metadata;
144
+ }
145
+ function updateBaseMetadata(projectPath, vectorCount, commit) {
146
+ const existing = loadBaseMetadata(projectPath);
147
+ if (!existing) {
148
+ log.w("BASE_DETECT", "update_no_existing", { project: getProjectHash(projectPath) });
149
+ return;
150
+ }
151
+ existing.vectorCount = vectorCount;
152
+ existing.updatedAt = Date.now();
153
+ if (commit) {
154
+ existing.baseCommit = commit;
155
+ }
156
+ saveBaseMetadata(projectPath, existing);
157
+ }
158
+
159
+ export { createInitialBaseMetadata, detectBaseBranch, getBaseMetaPathByHash, loadBaseMetadata, updateBaseMetadata };
160
+ //# sourceMappingURL=chunk-G6J42I55.js.map
161
+ //# sourceMappingURL=chunk-G6J42I55.js.map
@@ -0,0 +1 @@
1
+ import {R,I}from'./chunk-4BI7EBPQ.js';R();var c=class n{services=new Map;resolutionStack=new Set;disposed=false;constructor(){this.registerInstance("DIContainer",this);}register(e,t,r="singleton",s=[]){if(this.ensureNotDisposed(),this.services.has(e))throw new Error(`Service '${e}' is already registered`);let o={name:e,factory:t,lifetime:r,dependencies:s};this.services.set(e,o),I.i("DICONTAINER","svc_registered",{name:e,lifetime:r});}registerSingleton(e,t,r=[]){this.register(e,t,"singleton",r);}registerTransient(e,t,r=[]){this.register(e,t,"transient",r);}registerInstance(e,t){if(this.ensureNotDisposed(),this.services.has(e))throw new Error(`Service '${e}' is already registered`);let r={name:e,factory:()=>t,lifetime:"singleton",instance:t};this.services.set(e,r),I.i("DICONTAINER","inst_registered",{name:e});}updateInstance(e,t){this.ensureNotDisposed();let r=this.services.get(e);if(!r){this.registerInstance(e,t);return}if(r.lifetime!=="singleton")throw new Error(`Cannot update non-singleton service '${e}'`);r.instance=t,r.factory=()=>t,I.i("DICONTAINER","inst_updated",{name:e});}registerAgent(e,t,r=[]){let s=`Agent:${e}`;this.register(s,t,"singleton",r);}async resolve(e){this.ensureNotDisposed();let t=this.services.get(e);if(!t)throw new Error(`Service '${e}' is not registered`);if(this.resolutionStack.has(e)){let r=Array.from(this.resolutionStack).join(" -> ");throw new Error(`Circular dependency detected: ${r} -> ${e}`)}if(t.lifetime==="singleton"&&t.instance!==void 0)return t.instance;this.resolutionStack.add(e);try{let r=await t.factory(this);return t.lifetime==="singleton"&&(t.instance=r),r}finally{this.resolutionStack.delete(e);}}async resolveAgent(e){let t=`Agent:${e}`;return this.resolve(t)}has(e){return this.services.has(e)}hasAgent(e){return this.has(`Agent:${e}`)}getServiceNames(){return Array.from(this.services.keys())}getAgentTypes(){let e=[];for(let t of this.services.keys())t.startsWith("Agent:")&&e.push(t.slice(6));return e}getDependencyGraph(e){let t=this.services.get(e);return t?t.dependencies||[]:[]}clearTransients(){for(let e of this.services.values())e.lifetime==="transient"&&delete e.instance;I.i("DICONTAINER","transients_cleared");}clearAgentInstances(){let e=0;for(let[t,r]of this.services)t.startsWith("Agent:")&&r.instance!==void 0&&(delete r.instance,e++);I.i("DICONTAINER","agents_cleared",{count:e});}clear(){this.services.clear(),this.resolutionStack.clear(),this.disposed=false,I.i("DICONTAINER","container_cleared");}async dispose(){if(this.disposed)return;I.i("DICONTAINER","disposing"),this.disposed=true;let e=Array.from(this.services.values()).reverse();for(let t of e)if(t.instance&&this.isDisposable(t.instance))try{await t.instance.dispose(),I.i("DICONTAINER","disposed_svc",{name:t.name});}catch(r){I.w("DICONTAINER","dispose_fail",{name:t.name,err:String(r)});}this.services.clear(),this.resolutionStack.clear(),I.i("DICONTAINER","disposed");}isDisposable(e){return e!==null&&typeof e=="object"&&"dispose"in e&&typeof e.dispose=="function"}ensureNotDisposed(){if(this.disposed)throw new Error("DIContainer has been disposed")}createScope(){let e=new n;for(let[t,r]of this.services)r.lifetime==="singleton"&&e.services.set(t,{...r,instance:void 0});return e}};var a=null;function d(){return a||(a=new c),a}R();async function h(n){I.i("AGENTREG","registering_all"),n.registerAgent("dev",async e=>{let{DevAgent:t}=await import('./dev-agent-DDDIVWOF.js');return new t}),n.registerAgent("semantic",async e=>{let{SemanticAgent:t}=await import('./semantic-agent-LH6IZ2L7.js');return new t}),n.registerAgent("dora",async e=>{let{DoraAgent:t}=await import('./dora-agent-CYBFVPMF.js');return new t}),n.registerAgent("parser",async e=>{let{ParserAgent:t}=await import('./parser-agent-INNGAGXW.js');return new t}),n.registerAgent("indexer",async e=>{let{IndexerAgent:t}=await import('./indexer-agent-ASKY7JPG.js'),r=new t;return await r.initialize(),r}),n.registerAgent("query",async e=>{let{QueryAgent:t}=await import('./query-agent-36ADGCFZ.js');return new t}),n.registerAgent("merge",async e=>{let{MergeAgent:t}=await import('./merge-agent-ZGK24WVF.js'),r=process.cwd(),s;try{let o=await e.resolve("Config");o?.directory&&(r=o.directory);}catch{}try{s=await e.resolve("BranchManager");}catch{}return new t({repoPath:r,fastPathEnabled:true,semanticMatchingEnabled:true,semanticThreshold:.7,autoResolveConflicts:false,branchManager:s})}),I.i("AGENTREG","all_registered");}async function m(n,e,t){let r=e.getAgentsByType(t);if(r.length>0)return r[0];if(!n.hasAgent(t))throw new Error(`Agent ${t} is not registered in DI container`);let s=await n.resolveAgent(t);return await s.initialize(),I.i("AGENTREG","agent_init",{type:t}),e.register(s),s}export{d as a,h as b,m as c};
@@ -0,0 +1 @@
1
+ import {a}from'./chunk-XJ2Z5QQO.js';function r(){return a().getCurrentProject()}function i(e){e&&a().switchProject(e);}export{r as a,i as b};
@@ -0,0 +1,2 @@
1
+ import {I,H,r,v,n}from'./chunk-SV3WKUNV.js';import {R,I as I$1}from'./chunk-4BI7EBPQ.js';import {f}from'./chunk-DXB73IDG.js';import {execSync}from'child_process';import {existsSync,readFileSync,writeFileSync}from'fs';import {join}from'path';R();I();var S=["main","master","dev","develop","trunk"],m="faiss-base.meta.json";function g(t){return join(n(t),m)}function F(t){let{getProjectsDir:r}=(I(),f(H));return join(r(),t,m)}function _(t){let r=g(t);if(!existsSync(r))return null;try{let e=readFileSync(r,"utf-8");return JSON.parse(e)}catch(e){return I$1.w("BASE_DETECT","meta_read_fail",{path:r,err:String(e)}),null}}function h(t,r){let e=g(t);try{writeFileSync(e,JSON.stringify(r,null,2),"utf-8"),I$1.d("BASE_DETECT","meta_saved",{branch:r.baseBranch,path:e});}catch(n){I$1.e("BASE_DETECT","meta_save_fail",{path:e,err:String(n)});}}function C(t){try{return execSync("git branch --list",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","ignore"],windowsHide:!0}).split(`
2
+ `).map(e=>e.trim().replace(/^\* /,"")).filter(e=>e.length>0)}catch{return []}}function w(t){try{let e=execSync("git symbolic-ref refs/remotes/origin/HEAD",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","ignore"],windowsHide:!0}).trim().split("/");return e[e.length-1]||null}catch{return null}}function J(t){let r$1=r(t),e=g(t);I$1.d("BASE_DETECT","start",{projectPath:t,projectHash:r$1,metaPath:e,metaExists:existsSync(e)});let n=_(t);if(n?.baseBranch)return I$1.d("BASE_DETECT","using_existing",{project:r$1,branch:n.baseBranch}),n.baseBranch;let s=w(t);if(s)return I$1.d("BASE_DETECT","using_remote_default",{project:r$1,branch:s}),s;let i=C(t);for(let u of S)if(i.includes(u))return I$1.d("BASE_DETECT","using_common_name",{project:r$1,branch:u}),u;let c=v(t);return c?(I$1.d("BASE_DETECT","using_current",{project:r$1,branch:c}),c):(I$1.w("BASE_DETECT","no_git_repo",{project:r$1}),null)}function L(t,r$1,e,n=0){let s={baseBranch:r$1,vectorCount:n,createdAt:Date.now(),updatedAt:Date.now(),dimensions:e,indexType:"hnsw"};try{let i=execSync("git rev-parse --short HEAD",{cwd:t,encoding:"utf-8",stdio:["pipe","pipe","ignore"],windowsHide:!0}).trim();i&&(s.baseCommit=i);}catch{}return h(t,s),I$1.i("BASE_DETECT","base_created",{project:r(t),branch:r$1,vectors:n,dimensions:e}),s}function N(t,r$1,e){let n=_(t);if(!n){I$1.w("BASE_DETECT","update_no_existing",{project:r(t)});return}n.vectorCount=r$1,n.updatedAt=Date.now(),e&&(n.baseCommit=e),h(t,n);}export{F as a,_ as b,J as c,L as d,N as e};