oreshnik-cli 0.1.0 → 0.1.2

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.
package/dist/cli.js CHANGED
@@ -364,8 +364,16 @@ async function initCommand(options) {
364
364
  mkdirSync(vaultDir, { recursive: true });
365
365
  mkdirSync(handoffsDir, { recursive: true });
366
366
  writeFileSync(configPath, JSON.stringify(config, null, 2) + "\n", "utf8");
367
- writeFileSync(join(varDir, "task-board.json"), JSON.stringify(taskBoard, null, 2) + "\n", "utf8");
368
- writeFileSync(join(varDir, ".mother-version.json"), JSON.stringify({ version: 1, current: mainBranch, branches: [] }, null, 2) + "\n", "utf8");
367
+ const taskBoardPath = join(varDir, "task-board.json");
368
+ if (existsSync(taskBoardPath)) {
369
+ log("WARN", "task-board.json already exists \u2014 not overwriting. Use --force to overwrite all files.");
370
+ } else {
371
+ writeFileSync(taskBoardPath, JSON.stringify(taskBoard, null, 2) + "\n", "utf8");
372
+ }
373
+ const motherPath = join(varDir, ".mother-version.json");
374
+ if (!existsSync(motherPath) || options.force) {
375
+ writeFileSync(motherPath, JSON.stringify({ version: 1, current: mainBranch, branches: [] }, null, 2) + "\n", "utf8");
376
+ }
369
377
  writeFileSync(join(handoffsDir, "zone-map.json"), JSON.stringify(zoneMap, null, 2) + "\n", "utf8");
370
378
  writeFileSync(join(vaultDir, config.vault.centralDoc), generateCentralDoc(projectNameFinal), "utf8");
371
379
  const collabDir = join(vaultDir, "COLABORADORES");
@@ -2092,17 +2100,27 @@ var init_notes_ingestion_service = __esm({
2092
2100
  }
2093
2101
  classifyProject(text, validIds) {
2094
2102
  const lower = text.toLowerCase();
2095
- const ids = [];
2103
+ const candidates = [];
2096
2104
  for (const [pid, keywords] of Object.entries(PROJECT_KEYWORDS)) {
2097
2105
  if (!validIds.has(pid)) continue;
2098
2106
  for (const kw of keywords) {
2099
- if (lower.includes(kw)) {
2100
- ids.push(pid);
2107
+ const pos = lower.indexOf(kw);
2108
+ if (pos >= 0) {
2109
+ candidates.push({ id: pid, pos });
2101
2110
  break;
2102
2111
  }
2103
2112
  }
2104
2113
  }
2105
- return ids;
2114
+ if (candidates.length === 0) return [];
2115
+ if (candidates.length === 1) return [candidates[0].id];
2116
+ candidates.sort((a, b) => a.pos - b.pos);
2117
+ const first = candidates[0];
2118
+ const nearby = candidates.filter((c) => c.pos - first.pos <= 40);
2119
+ if (nearby.length > 1) {
2120
+ const span = lower.slice(first.pos, first.pos + 40);
2121
+ if (span.includes(" y ") || span.includes(" and ")) return nearby.map((c) => c.id);
2122
+ }
2123
+ return [first.id];
2106
2124
  }
2107
2125
  classifyOwner(text) {
2108
2126
  const lower = text.toLowerCase();