kodingo-cli 1.0.23 → 1.0.24

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.
@@ -56,6 +56,20 @@ const API_BASE = "https://kodingo-api.onrender.com";
56
56
  const APP_URL = "https://kodingo.xyz";
57
57
  const CONFIG_DIR = path.join(os.homedir(), ".kodingo");
58
58
  const AUTH_TOKEN_PATH = path.join(CONFIG_DIR, "auth.json");
59
+ // ── Machine ID ────────────────────────────────────────────────────────────────
60
+ function generateMachineId() {
61
+ const raw = `${os.hostname()}::${os.userInfo().username}::${process.platform}`;
62
+ return require("crypto").createHash("sha256").update(raw).digest("hex").slice(0, 32);
63
+ }
64
+ function getMachineId() {
65
+ const config = (0, persistence_config_1.readConfig)();
66
+ if (config.machineId)
67
+ return config.machineId;
68
+ const machineId = generateMachineId();
69
+ const existing = (0, persistence_config_1.readConfig)();
70
+ (0, persistence_config_1.writeConfig)({ ...existing, machineId });
71
+ return machineId;
72
+ }
59
73
  // ── Auth token storage ────────────────────────────────────────────────────────
60
74
  function readAuthToken() {
61
75
  try {
@@ -255,7 +269,8 @@ function registerInitCommand(program) {
255
269
  const apiUrl = API_BASE;
256
270
  // preserve existing workspaces, never overwrite global token
257
271
  const existingConfig = (0, persistence_config_1.readConfig)();
258
- (0, persistence_config_1.writeConfig)({ ...existingConfig, mode: "cloud", apiUrl });
272
+ const machineId = getMachineId();
273
+ (0, persistence_config_1.writeConfig)({ ...existingConfig, mode: "cloud", apiUrl, machineId });
259
274
  (0, persistence_config_1.writeWorkspaceConfig)(repoRoot, { mode: "cloud", apiUrl, token: selectedProject.token });
260
275
  ensureGitignoreEntry(repoRoot, ".kortex/");
261
276
  console.log(`✔ Connected. Token saved to ${persistence_config_1.CONFIG_PATH}`);
@@ -38,7 +38,7 @@ const IGNORED_DIRS = [
38
38
  "node_modules", ".git", ".kortex", "dist", "build",
39
39
  "out", ".next", "coverage", "__pycache__", "vendor",
40
40
  ];
41
- const MAX_SYMBOLS = 50;
41
+ const MAX_SYMBOLS = 200;
42
42
  const BATCH_SIZE = 5;
43
43
  const BATCH_DELAY_MS = 1200;
44
44
  function findRepoRoot(startPath) {
@@ -107,8 +107,12 @@ async function fetchExistingSymbols(token, repo) {
107
107
  break;
108
108
  const data = await res.json();
109
109
  for (const m of data.memories ?? []) {
110
- if (m.symbol)
110
+ if (m.symbol) {
111
+ // Store both symbol-only and symbol::repo keys for accurate matching
111
112
  known.add(m.symbol);
113
+ if (m.repo)
114
+ known.add(`${m.symbol}::${m.repo}`);
115
+ }
112
116
  }
113
117
  offset += limit;
114
118
  if (offset >= (data.total ?? 0))
@@ -195,7 +199,9 @@ async function scanRepoCommand(options = {}) {
195
199
  if (seen.has(key))
196
200
  continue;
197
201
  seen.add(key);
198
- if (!existingSymbols.has(sym.name))
202
+ const symRepoKey = `${sym.name}::${path_1.default.basename(sym.file)}`;
203
+ const hasMemory = existingSymbols.has(symRepoKey) || existingSymbols.has(sym.name);
204
+ if (!hasMemory)
199
205
  toCapture.push(sym);
200
206
  }
201
207
  if (toCapture.length === 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,