kodingo-cli 1.0.26 → 1.0.27

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.
@@ -4,6 +4,39 @@
4
4
  * Drop-in replacement for memory-persistence.ts — same function signatures,
5
5
  * same return types, but talks to kodingo-api over HTTP instead of psql.
6
6
  */
7
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
8
+ if (k2 === undefined) k2 = k;
9
+ var desc = Object.getOwnPropertyDescriptor(m, k);
10
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
11
+ desc = { enumerable: true, get: function() { return m[k]; } };
12
+ }
13
+ Object.defineProperty(o, k2, desc);
14
+ }) : (function(o, m, k, k2) {
15
+ if (k2 === undefined) k2 = k;
16
+ o[k2] = m[k];
17
+ }));
18
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
19
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
20
+ }) : function(o, v) {
21
+ o["default"] = v;
22
+ });
23
+ var __importStar = (this && this.__importStar) || (function () {
24
+ var ownKeys = function(o) {
25
+ ownKeys = Object.getOwnPropertyNames || function (o) {
26
+ var ar = [];
27
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
28
+ return ar;
29
+ };
30
+ return ownKeys(o);
31
+ };
32
+ return function (mod) {
33
+ if (mod && mod.__esModule) return mod;
34
+ var result = {};
35
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
36
+ __setModuleDefault(result, mod);
37
+ return result;
38
+ };
39
+ })();
7
40
  Object.defineProperty(exports, "__esModule", { value: true });
8
41
  exports.initDb = initDb;
9
42
  exports.checkDatabaseConnection = checkDatabaseConnection;
@@ -18,6 +51,8 @@ exports.getProposedOrIgnoredRecordBySymbol = getProposedOrIgnoredRecordBySymbol;
18
51
  exports.deleteMemoryById = deleteMemoryById;
19
52
  exports.queryMemory = queryMemory;
20
53
  exports.queryMemoryBySymbol = queryMemoryBySymbol;
54
+ const os = __importStar(require("os"));
55
+ const persistence_config_1 = require("../../utils/persistence-config");
21
56
  function getConfig() {
22
57
  const apiUrl = process.env.KODINGO_API_URL;
23
58
  const token = process.env.KODINGO_API_TOKEN;
@@ -124,6 +159,15 @@ async function saveMemory(input) {
124
159
  body.correctsId = input.correctsId;
125
160
  if (input.correctedById)
126
161
  body.correctedById = input.correctedById;
162
+ // Attribution
163
+ try {
164
+ const config = (0, persistence_config_1.readConfig)();
165
+ if (config.machineId) {
166
+ body.machineId = config.machineId;
167
+ body.displayName = os.hostname();
168
+ }
169
+ }
170
+ catch { }
127
171
  const record = await apiFetch("/memory", {
128
172
  method: "POST",
129
173
  body: JSON.stringify(body),
@@ -12,6 +12,39 @@
12
12
  * Caps at 50 symbols per run to avoid overwhelming the API.
13
13
  * Safe to run multiple times — skips symbols that already have memory.
14
14
  */
15
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
16
+ if (k2 === undefined) k2 = k;
17
+ var desc = Object.getOwnPropertyDescriptor(m, k);
18
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
19
+ desc = { enumerable: true, get: function() { return m[k]; } };
20
+ }
21
+ Object.defineProperty(o, k2, desc);
22
+ }) : (function(o, m, k, k2) {
23
+ if (k2 === undefined) k2 = k;
24
+ o[k2] = m[k];
25
+ }));
26
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
27
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
28
+ }) : function(o, v) {
29
+ o["default"] = v;
30
+ });
31
+ var __importStar = (this && this.__importStar) || (function () {
32
+ var ownKeys = function(o) {
33
+ ownKeys = Object.getOwnPropertyNames || function (o) {
34
+ var ar = [];
35
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
36
+ return ar;
37
+ };
38
+ return ownKeys(o);
39
+ };
40
+ return function (mod) {
41
+ if (mod && mod.__esModule) return mod;
42
+ var result = {};
43
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
44
+ __setModuleDefault(result, mod);
45
+ return result;
46
+ };
47
+ })();
15
48
  var __importDefault = (this && this.__importDefault) || function (mod) {
16
49
  return (mod && mod.__esModule) ? mod : { "default": mod };
17
50
  };
@@ -20,6 +53,7 @@ exports.scanRepoCommand = scanRepoCommand;
20
53
  const fs_1 = __importDefault(require("fs"));
21
54
  const path_1 = __importDefault(require("path"));
22
55
  const persistence_config_1 = require("../utils/persistence-config");
56
+ const os = __importStar(require("os"));
23
57
  const API_BASE = "https://kodingo-api.onrender.com";
24
58
  const SUPPORTED_EXTENSIONS = [
25
59
  ".ts", ".tsx", ".js", ".jsx",
@@ -144,6 +178,8 @@ async function inferAndCapture(token, symbol, repo) {
144
178
  tags: [...(inferred.tags ?? []), "scan-repo"],
145
179
  status: "proposed",
146
180
  confidence: 0.35,
181
+ machineId: (0, persistence_config_1.readConfig)().machineId ?? undefined,
182
+ displayName: os.hostname(),
147
183
  }),
148
184
  });
149
185
  return saveRes.ok;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.0.26",
3
+ "version": "1.0.27",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,