@noyrax/5d-database-plugin 0.1.14-beta.5 → 0.1.14-beta.8

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 (121) hide show
  1. package/out/api/adr-api.d.ts +0 -6
  2. package/out/api/adr-api.d.ts.map +1 -1
  3. package/out/api/adr-api.js +14 -49
  4. package/out/api/adr-api.js.map +1 -1
  5. package/out/api/bootstrap-api.d.ts +4 -1
  6. package/out/api/bootstrap-api.d.ts.map +1 -1
  7. package/out/api/bootstrap-api.js +27 -4
  8. package/out/api/bootstrap-api.js.map +1 -1
  9. package/out/api/context-builder.d.ts.map +1 -1
  10. package/out/api/context-builder.js +21 -5
  11. package/out/api/context-builder.js.map +1 -1
  12. package/out/api/evidence-grader.d.ts +83 -0
  13. package/out/api/evidence-grader.d.ts.map +1 -0
  14. package/out/api/evidence-grader.js +161 -0
  15. package/out/api/evidence-grader.js.map +1 -0
  16. package/out/api/index.d.ts +5 -0
  17. package/out/api/index.d.ts.map +1 -1
  18. package/out/api/index.js +11 -1
  19. package/out/api/index.js.map +1 -1
  20. package/out/api/learning-path-api.d.ts +3 -0
  21. package/out/api/learning-path-api.d.ts.map +1 -1
  22. package/out/api/learning-path-api.js +15 -2
  23. package/out/api/learning-path-api.js.map +1 -1
  24. package/out/api/module-api.d.ts +0 -1
  25. package/out/api/module-api.d.ts.map +1 -1
  26. package/out/api/module-api.js +4 -38
  27. package/out/api/module-api.js.map +1 -1
  28. package/out/api/self-explanation-api.d.ts +11 -1
  29. package/out/api/self-explanation-api.d.ts.map +1 -1
  30. package/out/api/self-explanation-api.js +285 -19
  31. package/out/api/self-explanation-api.js.map +1 -1
  32. package/out/api/semantic-search-api.d.ts +3 -0
  33. package/out/api/semantic-search-api.d.ts.map +1 -1
  34. package/out/api/semantic-search-api.js +39 -2
  35. package/out/api/semantic-search-api.js.map +1 -1
  36. package/out/api/source-access-contract-api.d.ts +60 -0
  37. package/out/api/source-access-contract-api.d.ts.map +1 -0
  38. package/out/api/source-access-contract-api.js +231 -0
  39. package/out/api/source-access-contract-api.js.map +1 -0
  40. package/out/api/source-snippet-api.d.ts +58 -0
  41. package/out/api/source-snippet-api.d.ts.map +1 -0
  42. package/out/api/source-snippet-api.js +187 -0
  43. package/out/api/source-snippet-api.js.map +1 -0
  44. package/out/api/vector-backend-status-api.d.ts +68 -0
  45. package/out/api/vector-backend-status-api.d.ts.map +1 -0
  46. package/out/api/vector-backend-status-api.js +241 -0
  47. package/out/api/vector-backend-status-api.js.map +1 -0
  48. package/out/cli/ingest-cli.js +44 -5
  49. package/out/cli/ingest-cli.js.map +1 -1
  50. package/out/cli/tool-cli.js +1 -1
  51. package/out/cli/tool-cli.js.map +1 -1
  52. package/out/core/migration-manager.d.ts.map +1 -1
  53. package/out/core/migration-manager.js +61 -32
  54. package/out/core/migration-manager.js.map +1 -1
  55. package/out/core/multi-db-manager.d.ts +26 -0
  56. package/out/core/multi-db-manager.d.ts.map +1 -1
  57. package/out/core/multi-db-manager.js +143 -2
  58. package/out/core/multi-db-manager.js.map +1 -1
  59. package/out/core/path-normalizer.d.ts +46 -0
  60. package/out/core/path-normalizer.d.ts.map +1 -0
  61. package/out/core/path-normalizer.js +152 -0
  62. package/out/core/path-normalizer.js.map +1 -0
  63. package/out/ingestors/adr-ingestor.d.ts.map +1 -1
  64. package/out/ingestors/adr-ingestor.js +7 -8
  65. package/out/ingestors/adr-ingestor.js.map +1 -1
  66. package/out/ingestors/module-ingestor.d.ts.map +1 -1
  67. package/out/ingestors/module-ingestor.js +17 -0
  68. package/out/ingestors/module-ingestor.js.map +1 -1
  69. package/out/ingestors/symbol-ingestor.d.ts.map +1 -1
  70. package/out/ingestors/symbol-ingestor.js +24 -2
  71. package/out/ingestors/symbol-ingestor.js.map +1 -1
  72. package/out/mcp/tools/gap-analysis.d.ts +16 -2
  73. package/out/mcp/tools/gap-analysis.d.ts.map +1 -1
  74. package/out/mcp/tools/gap-analysis.js +177 -31
  75. package/out/mcp/tools/gap-analysis.js.map +1 -1
  76. package/out/mcp/tools/learning-path.d.ts.map +1 -1
  77. package/out/mcp/tools/learning-path.js +19 -5
  78. package/out/mcp/tools/learning-path.js.map +1 -1
  79. package/out/mcp/tools/semantic-discovery.d.ts.map +1 -1
  80. package/out/mcp/tools/semantic-discovery.js +44 -4
  81. package/out/mcp/tools/semantic-discovery.js.map +1 -1
  82. package/out/mcp/tools/source-access-contract.d.ts +26 -0
  83. package/out/mcp/tools/source-access-contract.d.ts.map +1 -0
  84. package/out/mcp/tools/source-access-contract.js +45 -0
  85. package/out/mcp/tools/source-access-contract.js.map +1 -0
  86. package/out/mcp/tools/source-snippet.d.ts +71 -0
  87. package/out/mcp/tools/source-snippet.d.ts.map +1 -0
  88. package/out/mcp/tools/source-snippet.js +82 -0
  89. package/out/mcp/tools/source-snippet.js.map +1 -0
  90. package/out/models/action-hint.d.ts +36 -0
  91. package/out/models/action-hint.d.ts.map +1 -0
  92. package/out/models/action-hint.js +38 -0
  93. package/out/models/action-hint.js.map +1 -0
  94. package/out/models/evidence.d.ts +68 -0
  95. package/out/models/evidence.d.ts.map +1 -0
  96. package/out/models/evidence.js +91 -0
  97. package/out/models/evidence.js.map +1 -0
  98. package/out/models/module.d.ts +2 -0
  99. package/out/models/module.d.ts.map +1 -1
  100. package/out/models/reason-codes.d.ts +52 -0
  101. package/out/models/reason-codes.d.ts.map +1 -0
  102. package/out/models/reason-codes.js +83 -0
  103. package/out/models/reason-codes.js.map +1 -0
  104. package/out/models/symbol.d.ts +6 -0
  105. package/out/models/symbol.d.ts.map +1 -1
  106. package/out/repositories/module-repository.d.ts.map +1 -1
  107. package/out/repositories/module-repository.js +9 -3
  108. package/out/repositories/module-repository.js.map +1 -1
  109. package/out/repositories/symbol-repository.d.ts.map +1 -1
  110. package/out/repositories/symbol-repository.js +22 -4
  111. package/out/repositories/symbol-repository.js.map +1 -1
  112. package/out/services/cross-dimension-linker.d.ts +0 -5
  113. package/out/services/cross-dimension-linker.d.ts.map +1 -1
  114. package/out/services/cross-dimension-linker.js +2 -35
  115. package/out/services/cross-dimension-linker.js.map +1 -1
  116. package/package.json +196 -196
  117. package/schemas/sqlite/001_add_source_code_spans_modules.sql +7 -0
  118. package/schemas/sqlite/001_z_add_source_code_spans_modules.sql +13 -0
  119. package/schemas/sqlite/002_add_source_code_spans_symbols.sql +15 -0
  120. package/schemas/sqlite/002_z_add_source_code_spans_symbols.sql +21 -0
  121. package/schemas/sqlite/006_add_source_access_config.sql +33 -0
@@ -0,0 +1,26 @@
1
+ import { MultiDbManager } from '../../core/multi-db-manager.js';
2
+ /**
3
+ * MCP Tool: source_access_contract
4
+ * Get source access contract (deterministic status of code availability)
5
+ */
6
+ export declare const sourceAccessContractTool: {
7
+ name: string;
8
+ description: string;
9
+ inputSchema: {
10
+ type: string;
11
+ properties: {
12
+ workspaceRoot: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ };
17
+ required: never[];
18
+ };
19
+ };
20
+ /**
21
+ * Executes source_access_contract tool.
22
+ */
23
+ export declare function executeSourceAccessContract(args: {
24
+ workspaceRoot?: string;
25
+ }, dbManager: MultiDbManager): Promise<string>;
26
+ //# sourceMappingURL=source-access-contract.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-access-contract.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/source-access-contract.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;CAcpC,CAAC;AAEF;;GAEG;AACH,wBAAsB,2BAA2B,CAC7C,IAAI,EAAE;IAAE,aAAa,CAAC,EAAE,MAAM,CAAA;CAAE,EAChC,SAAS,EAAE,cAAc,GAC1B,OAAO,CAAC,MAAM,CAAC,CAgBjB"}
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sourceAccessContractTool = void 0;
4
+ exports.executeSourceAccessContract = executeSourceAccessContract;
5
+ const source_access_contract_api_js_1 = require("../../api/source-access-contract-api.js");
6
+ /**
7
+ * MCP Tool: source_access_contract
8
+ * Get source access contract (deterministic status of code availability)
9
+ */
10
+ exports.sourceAccessContractTool = {
11
+ name: 'source_access_contract',
12
+ description: 'Get source access contract (deterministic status of code availability). ' +
13
+ 'Returns whether source code is available, constraints, and reason codes.',
14
+ inputSchema: {
15
+ type: 'object',
16
+ properties: {
17
+ workspaceRoot: {
18
+ type: 'string',
19
+ description: 'Workspace root path (optional, defaults to current working directory)'
20
+ }
21
+ },
22
+ required: []
23
+ }
24
+ };
25
+ /**
26
+ * Executes source_access_contract tool.
27
+ */
28
+ async function executeSourceAccessContract(args, dbManager) {
29
+ try {
30
+ const api = new source_access_contract_api_js_1.SourceAccessContractApi(dbManager);
31
+ // Use workspace root from dbManager if not provided
32
+ const workspaceRoot = args.workspaceRoot || dbManager.getWorkspaceRoot();
33
+ const contract = await api.getContract(workspaceRoot);
34
+ return JSON.stringify(contract, null, 2);
35
+ }
36
+ catch (error) {
37
+ const errorMsg = error?.message || String(error);
38
+ return JSON.stringify({
39
+ error: `Failed to get source access contract: ${errorMsg}`,
40
+ status: 'UNAVAILABLE',
41
+ reason_codes: ['NOT_MOUNTED']
42
+ }, null, 2);
43
+ }
44
+ }
45
+ //# sourceMappingURL=source-access-contract.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-access-contract.js","sourceRoot":"","sources":["../../../src/mcp/tools/source-access-contract.ts"],"names":[],"mappings":";;;AA0BA,kEAmBC;AA7CD,2FAAkF;AAGlF;;;GAGG;AACU,QAAA,wBAAwB,GAAG;IACpC,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,0EAA0E;QAC1E,0EAA0E;IACvF,WAAW,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,uEAAuE;aACvF;SACJ;QACD,QAAQ,EAAE,EAAE;KACf;CACJ,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,2BAA2B,CAC7C,IAAgC,EAChC,SAAyB;IAEzB,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,uDAAuB,CAAC,SAAS,CAAC,CAAC;QACnD,oDAAoD;QACpD,MAAM,aAAa,GAAG,IAAI,CAAC,aAAa,IAAI,SAAS,CAAC,gBAAgB,EAAE,CAAC;QACzE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,WAAW,CAAC,aAAa,CAAC,CAAC;QAEtD,OAAO,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,MAAM,QAAQ,GAAG,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC;YAClB,KAAK,EAAE,yCAAyC,QAAQ,EAAE;YAC1D,MAAM,EAAE,aAAa;YACrB,YAAY,EAAE,CAAC,aAAa,CAAC;SAChC,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -0,0 +1,71 @@
1
+ import { MultiDbManager } from '../../core/multi-db-manager.js';
2
+ /**
3
+ * MCP Tool: source_snippet
4
+ * Fetch source code snippet by reference (gated, refs-first)
5
+ */
6
+ export declare const sourceSnippetTool: {
7
+ name: string;
8
+ description: string;
9
+ inputSchema: {
10
+ type: string;
11
+ properties: {
12
+ symbol_id: {
13
+ type: string;
14
+ description: string;
15
+ };
16
+ file_path: {
17
+ type: string;
18
+ description: string;
19
+ };
20
+ start_line: {
21
+ type: string;
22
+ description: string;
23
+ };
24
+ end_line: {
25
+ type: string;
26
+ description: string;
27
+ };
28
+ content_hash: {
29
+ type: string;
30
+ description: string;
31
+ };
32
+ include_context: {
33
+ type: string;
34
+ description: string;
35
+ };
36
+ context_lines: {
37
+ type: string;
38
+ description: string;
39
+ };
40
+ verify_hash: {
41
+ type: string;
42
+ description: string;
43
+ };
44
+ pluginId: {
45
+ type: string;
46
+ description: string;
47
+ };
48
+ workspaceRoot: {
49
+ type: string;
50
+ description: string;
51
+ };
52
+ };
53
+ required: string[];
54
+ };
55
+ };
56
+ /**
57
+ * Executes source_snippet tool.
58
+ */
59
+ export declare function executeSourceSnippet(args: {
60
+ symbol_id?: string;
61
+ file_path?: string;
62
+ start_line?: number;
63
+ end_line?: number;
64
+ content_hash?: string;
65
+ include_context?: boolean;
66
+ context_lines?: number;
67
+ verify_hash?: boolean;
68
+ pluginId: string;
69
+ workspaceRoot?: string;
70
+ }, dbManager: MultiDbManager): Promise<string>;
71
+ //# sourceMappingURL=source-snippet.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-snippet.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/source-snippet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkD7B,CAAC;AAEF;;GAEG;AACH,wBAAsB,oBAAoB,CACtC,IAAI,EAAE;IACF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,CAAC;CAC1B,EACD,SAAS,EAAE,cAAc,GAC1B,OAAO,CAAC,MAAM,CAAC,CAiBjB"}
@@ -0,0 +1,82 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.sourceSnippetTool = void 0;
4
+ exports.executeSourceSnippet = executeSourceSnippet;
5
+ const source_snippet_api_js_1 = require("../../api/source-snippet-api.js");
6
+ /**
7
+ * MCP Tool: source_snippet
8
+ * Fetch source code snippet by reference (gated, refs-first)
9
+ */
10
+ exports.sourceSnippetTool = {
11
+ name: 'source_snippet',
12
+ description: 'Fetch source code snippet by reference (gated, refs-first). ' +
13
+ 'Retrieves actual source code for a symbol or file range with size limits and hash verification.',
14
+ inputSchema: {
15
+ type: 'object',
16
+ properties: {
17
+ symbol_id: {
18
+ type: 'string',
19
+ description: 'Symbol ID to fetch (e.g., "ts://path/to/file.ts#ClassName.methodName()")'
20
+ },
21
+ file_path: {
22
+ type: 'string',
23
+ description: 'File path (alternative to symbol_id)'
24
+ },
25
+ start_line: {
26
+ type: 'number',
27
+ description: 'Start line number (1-indexed, alternative to symbol_id)'
28
+ },
29
+ end_line: {
30
+ type: 'number',
31
+ description: 'End line number (1-indexed, inclusive, alternative to symbol_id)'
32
+ },
33
+ content_hash: {
34
+ type: 'string',
35
+ description: 'Expected content hash for verification (optional)'
36
+ },
37
+ include_context: {
38
+ type: 'boolean',
39
+ description: 'Include context lines before/after (default: false)'
40
+ },
41
+ context_lines: {
42
+ type: 'number',
43
+ description: 'Number of context lines (default: 5)'
44
+ },
45
+ verify_hash: {
46
+ type: 'boolean',
47
+ description: 'Fail if hash mismatch (default: false)'
48
+ },
49
+ pluginId: {
50
+ type: 'string',
51
+ description: 'Plugin ID'
52
+ },
53
+ workspaceRoot: {
54
+ type: 'string',
55
+ description: 'Workspace root path (optional)'
56
+ }
57
+ },
58
+ required: ['pluginId']
59
+ }
60
+ };
61
+ /**
62
+ * Executes source_snippet tool.
63
+ */
64
+ async function executeSourceSnippet(args, dbManager) {
65
+ try {
66
+ const api = new source_snippet_api_js_1.SourceSnippetApi(dbManager);
67
+ const result = await api.fetchSnippet(args);
68
+ return JSON.stringify(result, null, 2);
69
+ }
70
+ catch (error) {
71
+ const errorMsg = error?.message || String(error);
72
+ return JSON.stringify({
73
+ error: `Failed to fetch source snippet: ${errorMsg}`,
74
+ evidence: {
75
+ grade: 'INFERRED',
76
+ sources: [],
77
+ description: `Error: ${errorMsg}`
78
+ }
79
+ }, null, 2);
80
+ }
81
+ }
82
+ //# sourceMappingURL=source-snippet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"source-snippet.js","sourceRoot":"","sources":["../../../src/mcp/tools/source-snippet.ts"],"names":[],"mappings":";;;AA8DA,oDA+BC;AA7FD,2EAAmE;AAGnE;;;GAGG;AACU,QAAA,iBAAiB,GAAG;IAC7B,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,8DAA8D;QAC9D,iGAAiG;IAC9G,WAAW,EAAE;QACT,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACR,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,0EAA0E;aAC1F;YACD,SAAS,EAAE;gBACP,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC;aACtD;YACD,UAAU,EAAE;gBACR,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,yDAAyD;aACzE;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,kEAAkE;aAClF;YACD,YAAY,EAAE;gBACV,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,mDAAmD;aACnE;YACD,eAAe,EAAE;gBACb,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,qDAAqD;aACrE;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,sCAAsC;aACtD;YACD,WAAW,EAAE;gBACT,IAAI,EAAE,SAAS;gBACf,WAAW,EAAE,wCAAwC;aACxD;YACD,QAAQ,EAAE;gBACN,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,WAAW;aAC3B;YACD,aAAa,EAAE;gBACX,IAAI,EAAE,QAAQ;gBACd,WAAW,EAAE,gCAAgC;aAChD;SACJ;QACD,QAAQ,EAAE,CAAC,UAAU,CAAC;KACzB;CACJ,CAAC;AAEF;;GAEG;AACI,KAAK,UAAU,oBAAoB,CACtC,IAWC,EACD,SAAyB;IAEzB,IAAI,CAAC;QACD,MAAM,GAAG,GAAG,IAAI,wCAAgB,CAAC,SAAS,CAAC,CAAC;QAC5C,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAU,EAAE,CAAC;QAClB,MAAM,QAAQ,GAAG,KAAK,EAAE,OAAO,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;QACjD,OAAO,IAAI,CAAC,SAAS,CAAC;YAClB,KAAK,EAAE,mCAAmC,QAAQ,EAAE;YACpD,QAAQ,EAAE;gBACN,KAAK,EAAE,UAAU;gBACjB,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,UAAU,QAAQ,EAAE;aACpC;SACJ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChB,CAAC;AACL,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Action hints for machine-readable fix recipes.
3
+ * Used to provide OS-specific commands and instructions for resolving issues.
4
+ */
5
+ /**
6
+ * Supported operating systems for action hints.
7
+ */
8
+ export type OperatingSystem = 'windows' | 'linux' | 'mac';
9
+ /**
10
+ * Action hint structure for providing machine-readable fix instructions.
11
+ */
12
+ export interface ActionHint {
13
+ /** Operating system this hint applies to */
14
+ os: OperatingSystem;
15
+ /** Command to execute (OS-specific) */
16
+ command: string;
17
+ /** Prerequisites that must be met before running the command */
18
+ prerequisites?: string[];
19
+ /** Steps to verify the fix worked */
20
+ verify_steps?: string[];
21
+ /** Human-readable description of what this action does */
22
+ description?: string;
23
+ }
24
+ /**
25
+ * Helper function to create an action hint.
26
+ */
27
+ export declare function createActionHint(os: OperatingSystem, command: string, prerequisites?: string[], verify_steps?: string[], description?: string): ActionHint;
28
+ /**
29
+ * Helper function to get action hints for a specific OS.
30
+ */
31
+ export declare function getActionHintsForOS(hints: ActionHint[], os: OperatingSystem): ActionHint[];
32
+ /**
33
+ * Helper function to get all action hints for all OSes.
34
+ */
35
+ export declare function getAllActionHints(hints: ActionHint[]): Record<OperatingSystem, ActionHint[]>;
36
+ //# sourceMappingURL=action-hint.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-hint.d.ts","sourceRoot":"","sources":["../../src/models/action-hint.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,4CAA4C;IAC5C,EAAE,EAAE,eAAe,CAAC;IAEpB,uCAAuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAEhB,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IAEzB,qCAAqC;IACrC,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC5B,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EAAE,EACxB,YAAY,CAAC,EAAE,MAAM,EAAE,EACvB,WAAW,CAAC,EAAE,MAAM,GACrB,UAAU,CAQZ;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,UAAU,EAAE,EAAE,EAAE,EAAE,eAAe,GAAG,UAAU,EAAE,CAE1F;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAAC,eAAe,EAAE,UAAU,EAAE,CAAC,CAM5F"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ /**
3
+ * Action hints for machine-readable fix recipes.
4
+ * Used to provide OS-specific commands and instructions for resolving issues.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createActionHint = createActionHint;
8
+ exports.getActionHintsForOS = getActionHintsForOS;
9
+ exports.getAllActionHints = getAllActionHints;
10
+ /**
11
+ * Helper function to create an action hint.
12
+ */
13
+ function createActionHint(os, command, prerequisites, verify_steps, description) {
14
+ return {
15
+ os,
16
+ command,
17
+ prerequisites,
18
+ verify_steps,
19
+ description
20
+ };
21
+ }
22
+ /**
23
+ * Helper function to get action hints for a specific OS.
24
+ */
25
+ function getActionHintsForOS(hints, os) {
26
+ return hints.filter(hint => hint.os === os);
27
+ }
28
+ /**
29
+ * Helper function to get all action hints for all OSes.
30
+ */
31
+ function getAllActionHints(hints) {
32
+ return {
33
+ windows: getActionHintsForOS(hints, 'windows'),
34
+ linux: getActionHintsForOS(hints, 'linux'),
35
+ mac: getActionHintsForOS(hints, 'mac')
36
+ };
37
+ }
38
+ //# sourceMappingURL=action-hint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"action-hint.js","sourceRoot":"","sources":["../../src/models/action-hint.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA8BH,4CAcC;AAKD,kDAEC;AAKD,8CAMC;AAnCD;;GAEG;AACH,SAAgB,gBAAgB,CAC5B,EAAmB,EACnB,OAAe,EACf,aAAwB,EACxB,YAAuB,EACvB,WAAoB;IAEpB,OAAO;QACH,EAAE;QACF,OAAO;QACP,aAAa;QACb,YAAY;QACZ,WAAW;KACd,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAgB,mBAAmB,CAAC,KAAmB,EAAE,EAAmB;IACxE,OAAO,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAChD,CAAC;AAED;;GAEG;AACH,SAAgB,iBAAiB,CAAC,KAAmB;IACjD,OAAO;QACH,OAAO,EAAE,mBAAmB,CAAC,KAAK,EAAE,SAAS,CAAC;QAC9C,KAAK,EAAE,mBAAmB,CAAC,KAAK,EAAE,OAAO,CAAC;QAC1C,GAAG,EAAE,mBAAmB,CAAC,KAAK,EAAE,KAAK,CAAC;KACzC,CAAC;AACN,CAAC"}
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Evidence grading system for system-wide governance.
3
+ * Ensures all claims have structured sources and explicit grading.
4
+ */
5
+ /**
6
+ * Evidence grade levels.
7
+ */
8
+ export type EvidenceGrade = 'FACT' | 'INFERRED' | 'HEURISTIC';
9
+ /**
10
+ * Evidence source types.
11
+ */
12
+ export type EvidenceSourceType = 'ADR' | 'MODULE' | 'SYMBOL' | 'DEPENDENCY' | 'DB_QUERY' | 'STATUS_CHECK' | 'CONTRACT' | 'CODE_SNIPPET' | 'FILESYSTEM_READ' | 'HEURISTIC';
13
+ /**
14
+ * Structured evidence source.
15
+ * Normalform for all evidence sources.
16
+ */
17
+ export interface EvidenceSource {
18
+ /** Type of source */
19
+ type: EvidenceSourceType;
20
+ /** Identifier (e.g., ADR number, symbol ID) */
21
+ id?: string;
22
+ /** File path (if applicable) */
23
+ path?: string;
24
+ /** Content hash (if applicable) */
25
+ hash?: string;
26
+ /** Additional metadata */
27
+ metadata?: Record<string, any>;
28
+ }
29
+ /**
30
+ * Evidence information attached to responses.
31
+ */
32
+ export interface Evidence {
33
+ /** Grade of the evidence */
34
+ grade: EvidenceGrade;
35
+ /** Structured sources */
36
+ sources: EvidenceSource[];
37
+ /** Optional description */
38
+ description?: string;
39
+ }
40
+ /**
41
+ * Helper function to create an evidence source.
42
+ */
43
+ export declare function createEvidenceSource(type: EvidenceSourceType, id?: string, path?: string, hash?: string, metadata?: Record<string, any>): EvidenceSource;
44
+ /**
45
+ * Helper function to create evidence.
46
+ */
47
+ export declare function createEvidence(grade: EvidenceGrade, sources: EvidenceSource[], description?: string): Evidence;
48
+ /**
49
+ * Helper function to create FACT evidence.
50
+ */
51
+ export declare function createFactEvidence(sources: EvidenceSource[], description?: string): Evidence;
52
+ /**
53
+ * Helper function to create INFERRED evidence.
54
+ */
55
+ export declare function createInferredEvidence(sources: EvidenceSource[], description?: string): Evidence;
56
+ /**
57
+ * Helper function to create HEURISTIC evidence.
58
+ */
59
+ export declare function createHeuristicEvidence(sources: EvidenceSource[], description?: string): Evidence;
60
+ /**
61
+ * Validates that evidence has sources (for FACT and INFERRED).
62
+ * HEURISTIC may have empty sources.
63
+ */
64
+ export declare function validateEvidence(evidence: Evidence): {
65
+ valid: boolean;
66
+ error?: string;
67
+ };
68
+ //# sourceMappingURL=evidence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence.d.ts","sourceRoot":"","sources":["../../src/models/evidence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE9D;;GAEG;AACH,MAAM,MAAM,kBAAkB,GACxB,KAAK,GACL,QAAQ,GACR,QAAQ,GACR,YAAY,GACZ,UAAU,GACV,cAAc,GACd,UAAU,GACV,cAAc,GACd,iBAAiB,GACjB,WAAW,CAAC;AAElB;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,qBAAqB;IACrB,IAAI,EAAE,kBAAkB,CAAC;IAEzB,+CAA+C;IAC/C,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ,gCAAgC;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,0BAA0B;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACrB,4BAA4B;IAC5B,KAAK,EAAE,aAAa,CAAC;IAErB,yBAAyB;IACzB,OAAO,EAAE,cAAc,EAAE,CAAC;IAE1B,2BAA2B;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAChC,IAAI,EAAE,kBAAkB,EACxB,EAAE,CAAC,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,EACb,IAAI,CAAC,EAAE,MAAM,EACb,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAC/B,cAAc,CAQhB;AAED;;GAEG;AACH,wBAAgB,cAAc,CAC1B,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,CAAC,EAAE,MAAM,GACrB,QAAQ,CAMV;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAC9B,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,CAAC,EAAE,MAAM,GACrB,QAAQ,CAEV;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,CAAC,EAAE,MAAM,GACrB,QAAQ,CAEV;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CACnC,OAAO,EAAE,cAAc,EAAE,EACzB,WAAW,CAAC,EAAE,MAAM,GACrB,QAAQ,CAEV;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAqCvF"}
@@ -0,0 +1,91 @@
1
+ "use strict";
2
+ /**
3
+ * Evidence grading system for system-wide governance.
4
+ * Ensures all claims have structured sources and explicit grading.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.createEvidenceSource = createEvidenceSource;
8
+ exports.createEvidence = createEvidence;
9
+ exports.createFactEvidence = createFactEvidence;
10
+ exports.createInferredEvidence = createInferredEvidence;
11
+ exports.createHeuristicEvidence = createHeuristicEvidence;
12
+ exports.validateEvidence = validateEvidence;
13
+ /**
14
+ * Helper function to create an evidence source.
15
+ */
16
+ function createEvidenceSource(type, id, path, hash, metadata) {
17
+ return {
18
+ type,
19
+ id,
20
+ path,
21
+ hash,
22
+ metadata
23
+ };
24
+ }
25
+ /**
26
+ * Helper function to create evidence.
27
+ */
28
+ function createEvidence(grade, sources, description) {
29
+ return {
30
+ grade,
31
+ sources,
32
+ description
33
+ };
34
+ }
35
+ /**
36
+ * Helper function to create FACT evidence.
37
+ */
38
+ function createFactEvidence(sources, description) {
39
+ return createEvidence('FACT', sources, description);
40
+ }
41
+ /**
42
+ * Helper function to create INFERRED evidence.
43
+ */
44
+ function createInferredEvidence(sources, description) {
45
+ return createEvidence('INFERRED', sources, description);
46
+ }
47
+ /**
48
+ * Helper function to create HEURISTIC evidence.
49
+ */
50
+ function createHeuristicEvidence(sources, description) {
51
+ return createEvidence('HEURISTIC', sources, description);
52
+ }
53
+ /**
54
+ * Validates that evidence has sources (for FACT and INFERRED).
55
+ * HEURISTIC may have empty sources.
56
+ */
57
+ function validateEvidence(evidence) {
58
+ if (!evidence || !evidence.grade) {
59
+ return {
60
+ valid: false,
61
+ error: 'Evidence must have a grade'
62
+ };
63
+ }
64
+ if (!evidence.sources) {
65
+ return {
66
+ valid: false,
67
+ error: 'Evidence must have sources'
68
+ };
69
+ }
70
+ if (evidence.grade === 'FACT' || evidence.grade === 'INFERRED') {
71
+ if (!Array.isArray(evidence.sources) || evidence.sources.length === 0) {
72
+ return {
73
+ valid: false,
74
+ error: `${evidence.grade} evidence must have at least one source`
75
+ };
76
+ }
77
+ }
78
+ // Validate sources
79
+ if (Array.isArray(evidence.sources)) {
80
+ for (const source of evidence.sources) {
81
+ if (!source.type) {
82
+ return {
83
+ valid: false,
84
+ error: 'Evidence source must have a type'
85
+ };
86
+ }
87
+ }
88
+ }
89
+ return { valid: true };
90
+ }
91
+ //# sourceMappingURL=evidence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"evidence.js","sourceRoot":"","sources":["../../src/models/evidence.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AA4DH,oDAcC;AAKD,wCAUC;AAKD,gDAKC;AAKD,wDAKC;AAKD,0DAKC;AAMD,4CAqCC;AAzGD;;GAEG;AACH,SAAgB,oBAAoB,CAChC,IAAwB,EACxB,EAAW,EACX,IAAa,EACb,IAAa,EACb,QAA8B;IAE9B,OAAO;QACH,IAAI;QACJ,EAAE;QACF,IAAI;QACJ,IAAI;QACJ,QAAQ;KACX,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAgB,cAAc,CAC1B,KAAoB,EACpB,OAAyB,EACzB,WAAoB;IAEpB,OAAO;QACH,KAAK;QACL,OAAO;QACP,WAAW;KACd,CAAC;AACN,CAAC;AAED;;GAEG;AACH,SAAgB,kBAAkB,CAC9B,OAAyB,EACzB,WAAoB;IAEpB,OAAO,cAAc,CAAC,MAAM,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,SAAgB,sBAAsB,CAClC,OAAyB,EACzB,WAAoB;IAEpB,OAAO,cAAc,CAAC,UAAU,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAC5D,CAAC;AAED;;GAEG;AACH,SAAgB,uBAAuB,CACnC,OAAyB,EACzB,WAAoB;IAEpB,OAAO,cAAc,CAAC,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAC7D,CAAC;AAED;;;GAGG;AACH,SAAgB,gBAAgB,CAAC,QAAkB;IAC/C,IAAI,CAAC,QAAQ,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;QAC/B,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,4BAA4B;SACtC,CAAC;IACN,CAAC;IAED,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpB,OAAO;YACH,KAAK,EAAE,KAAK;YACZ,KAAK,EAAE,4BAA4B;SACtC,CAAC;IACN,CAAC;IAED,IAAI,QAAQ,CAAC,KAAK,KAAK,MAAM,IAAI,QAAQ,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC7D,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACpE,OAAO;gBACH,KAAK,EAAE,KAAK;gBACZ,KAAK,EAAE,GAAG,QAAQ,CAAC,KAAK,yCAAyC;aACpE,CAAC;QACN,CAAC;IACL,CAAC;IAED,mBAAmB;IACnB,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,KAAK,MAAM,MAAM,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;YACpC,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;gBACf,OAAO;oBACH,KAAK,EAAE,KAAK;oBACZ,KAAK,EAAE,kCAAkC;iBAC5C,CAAC;YACN,CAAC;QACL,CAAC;IACL,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;AAC3B,CAAC"}
@@ -8,6 +8,8 @@ export interface Module {
8
8
  file_path: string;
9
9
  content_hash: string;
10
10
  content_markdown: string;
11
+ line_count: number | null;
12
+ byte_size: number | null;
11
13
  deleted_at: Date | null;
12
14
  created_at: Date;
13
15
  updated_at: Date;
@@ -1 +1 @@
1
- {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/models/module.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
1
+ {"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../src/models/module.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,MAAM;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,IAAI,GAAG,IAAI,CAAC;IACxB,UAAU,EAAE,IAAI,CAAC;IACjB,UAAU,EAAE,IAAI,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACvB"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Global reason codes for runtime diagnostics.
3
+ * Used by all diagnostic tools (vector backend, ingestion, check_status, etc.)
4
+ * to provide machine-readable error/situation codes.
5
+ */
6
+ /**
7
+ * Standardized reason codes for runtime diagnostics.
8
+ */
9
+ export declare enum ReasonCode {
10
+ /** Vector backend is not reachable */
11
+ VECTOR_BACKEND_UNREACHABLE = "VECTOR_BACKEND_UNREACHABLE",
12
+ /** Wrong path configured */
13
+ WRONG_PATH = "WRONG_PATH",
14
+ /** API version is incompatible */
15
+ WRONG_API_VERSION = "WRONG_API_VERSION",
16
+ /** No embeddings available */
17
+ NO_EMBEDDINGS = "NO_EMBEDDINGS",
18
+ /** Permission denied */
19
+ PERMISSION_DENIED = "PERMISSION_DENIED",
20
+ /** Operation timed out */
21
+ TIMEOUT = "TIMEOUT",
22
+ /** System is misconfigured */
23
+ MISCONFIGURED = "MISCONFIGURED",
24
+ /** Required dependency is missing */
25
+ DEPENDENCY_MISSING = "DEPENDENCY_MISSING",
26
+ /** Component is not installed */
27
+ NOT_INSTALLED = "NOT_INSTALLED",
28
+ /** Service is not running */
29
+ NOT_RUNNING = "NOT_RUNNING",
30
+ /** Workspace is not mounted (source code unavailable) */
31
+ NOT_MOUNTED = "NOT_MOUNTED",
32
+ /** Path mapping is missing (for snapshot imports) */
33
+ PATH_MAPPING_MISSING = "PATH_MAPPING_MISSING",
34
+ /** File not found */
35
+ FILE_NOT_FOUND = "FILE_NOT_FOUND",
36
+ /** Hash mismatch (code changed since scan) */
37
+ HASH_MISMATCH = "HASH_MISMATCH",
38
+ /** Legacy symbol cleanup (unknown:// replaced by ts://) */
39
+ LEGACY_CLEANUP = "LEGACY_CLEANUP",
40
+ /** Everything is OK (no error) */
41
+ OK = "OK"
42
+ }
43
+ /**
44
+ * Helper function to parse a string to ReasonCode.
45
+ * Returns the ReasonCode if valid, otherwise returns undefined.
46
+ */
47
+ export declare function parseReasonCode(code: string): ReasonCode | undefined;
48
+ /**
49
+ * Helper function to get a human-readable description for a reason code.
50
+ */
51
+ export declare function getReasonCodeDescription(code: ReasonCode): string;
52
+ //# sourceMappingURL=reason-codes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reason-codes.d.ts","sourceRoot":"","sources":["../../src/models/reason-codes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,oBAAY,UAAU;IAClB,sCAAsC;IACtC,0BAA0B,+BAA+B;IAEzD,4BAA4B;IAC5B,UAAU,eAAe;IAEzB,kCAAkC;IAClC,iBAAiB,sBAAsB;IAEvC,8BAA8B;IAC9B,aAAa,kBAAkB;IAE/B,wBAAwB;IACxB,iBAAiB,sBAAsB;IAEvC,0BAA0B;IAC1B,OAAO,YAAY;IAEnB,8BAA8B;IAC9B,aAAa,kBAAkB;IAE/B,qCAAqC;IACrC,kBAAkB,uBAAuB;IAEzC,iCAAiC;IACjC,aAAa,kBAAkB;IAE/B,6BAA6B;IAC7B,WAAW,gBAAgB;IAE3B,yDAAyD;IACzD,WAAW,gBAAgB;IAE3B,qDAAqD;IACrD,oBAAoB,yBAAyB;IAE7C,qBAAqB;IACrB,cAAc,mBAAmB;IAEjC,8CAA8C;IAC9C,aAAa,kBAAkB;IAE/B,2DAA2D;IAC3D,cAAc,mBAAmB;IAEjC,kCAAkC;IAClC,EAAE,OAAO;CACZ;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAKpE;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAoBjE"}
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ /**
3
+ * Global reason codes for runtime diagnostics.
4
+ * Used by all diagnostic tools (vector backend, ingestion, check_status, etc.)
5
+ * to provide machine-readable error/situation codes.
6
+ */
7
+ Object.defineProperty(exports, "__esModule", { value: true });
8
+ exports.ReasonCode = void 0;
9
+ exports.parseReasonCode = parseReasonCode;
10
+ exports.getReasonCodeDescription = getReasonCodeDescription;
11
+ /**
12
+ * Standardized reason codes for runtime diagnostics.
13
+ */
14
+ var ReasonCode;
15
+ (function (ReasonCode) {
16
+ /** Vector backend is not reachable */
17
+ ReasonCode["VECTOR_BACKEND_UNREACHABLE"] = "VECTOR_BACKEND_UNREACHABLE";
18
+ /** Wrong path configured */
19
+ ReasonCode["WRONG_PATH"] = "WRONG_PATH";
20
+ /** API version is incompatible */
21
+ ReasonCode["WRONG_API_VERSION"] = "WRONG_API_VERSION";
22
+ /** No embeddings available */
23
+ ReasonCode["NO_EMBEDDINGS"] = "NO_EMBEDDINGS";
24
+ /** Permission denied */
25
+ ReasonCode["PERMISSION_DENIED"] = "PERMISSION_DENIED";
26
+ /** Operation timed out */
27
+ ReasonCode["TIMEOUT"] = "TIMEOUT";
28
+ /** System is misconfigured */
29
+ ReasonCode["MISCONFIGURED"] = "MISCONFIGURED";
30
+ /** Required dependency is missing */
31
+ ReasonCode["DEPENDENCY_MISSING"] = "DEPENDENCY_MISSING";
32
+ /** Component is not installed */
33
+ ReasonCode["NOT_INSTALLED"] = "NOT_INSTALLED";
34
+ /** Service is not running */
35
+ ReasonCode["NOT_RUNNING"] = "NOT_RUNNING";
36
+ /** Workspace is not mounted (source code unavailable) */
37
+ ReasonCode["NOT_MOUNTED"] = "NOT_MOUNTED";
38
+ /** Path mapping is missing (for snapshot imports) */
39
+ ReasonCode["PATH_MAPPING_MISSING"] = "PATH_MAPPING_MISSING";
40
+ /** File not found */
41
+ ReasonCode["FILE_NOT_FOUND"] = "FILE_NOT_FOUND";
42
+ /** Hash mismatch (code changed since scan) */
43
+ ReasonCode["HASH_MISMATCH"] = "HASH_MISMATCH";
44
+ /** Legacy symbol cleanup (unknown:// replaced by ts://) */
45
+ ReasonCode["LEGACY_CLEANUP"] = "LEGACY_CLEANUP";
46
+ /** Everything is OK (no error) */
47
+ ReasonCode["OK"] = "OK";
48
+ })(ReasonCode || (exports.ReasonCode = ReasonCode = {}));
49
+ /**
50
+ * Helper function to parse a string to ReasonCode.
51
+ * Returns the ReasonCode if valid, otherwise returns undefined.
52
+ */
53
+ function parseReasonCode(code) {
54
+ if (Object.values(ReasonCode).includes(code)) {
55
+ return code;
56
+ }
57
+ return undefined;
58
+ }
59
+ /**
60
+ * Helper function to get a human-readable description for a reason code.
61
+ */
62
+ function getReasonCodeDescription(code) {
63
+ const descriptions = {
64
+ [ReasonCode.VECTOR_BACKEND_UNREACHABLE]: 'Vector backend is not reachable',
65
+ [ReasonCode.WRONG_PATH]: 'Wrong path configured',
66
+ [ReasonCode.WRONG_API_VERSION]: 'API version is incompatible',
67
+ [ReasonCode.NO_EMBEDDINGS]: 'No embeddings available',
68
+ [ReasonCode.PERMISSION_DENIED]: 'Permission denied',
69
+ [ReasonCode.TIMEOUT]: 'Operation timed out',
70
+ [ReasonCode.MISCONFIGURED]: 'System is misconfigured',
71
+ [ReasonCode.DEPENDENCY_MISSING]: 'Required dependency is missing',
72
+ [ReasonCode.NOT_INSTALLED]: 'Component is not installed',
73
+ [ReasonCode.NOT_RUNNING]: 'Service is not running',
74
+ [ReasonCode.NOT_MOUNTED]: 'Workspace is not mounted (source code unavailable)',
75
+ [ReasonCode.PATH_MAPPING_MISSING]: 'Path mapping is missing (for snapshot imports)',
76
+ [ReasonCode.FILE_NOT_FOUND]: 'File not found',
77
+ [ReasonCode.HASH_MISMATCH]: 'Hash mismatch (code changed since scan)',
78
+ [ReasonCode.LEGACY_CLEANUP]: 'Legacy symbol cleanup (unknown:// replaced by ts://)',
79
+ [ReasonCode.OK]: 'Everything is OK'
80
+ };
81
+ return descriptions[code] || 'Unknown reason code';
82
+ }
83
+ //# sourceMappingURL=reason-codes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"reason-codes.js","sourceRoot":"","sources":["../../src/models/reason-codes.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AA2DH,0CAKC;AAKD,4DAoBC;AAvFD;;GAEG;AACH,IAAY,UAgDX;AAhDD,WAAY,UAAU;IAClB,sCAAsC;IACtC,uEAAyD,CAAA;IAEzD,4BAA4B;IAC5B,uCAAyB,CAAA;IAEzB,kCAAkC;IAClC,qDAAuC,CAAA;IAEvC,8BAA8B;IAC9B,6CAA+B,CAAA;IAE/B,wBAAwB;IACxB,qDAAuC,CAAA;IAEvC,0BAA0B;IAC1B,iCAAmB,CAAA;IAEnB,8BAA8B;IAC9B,6CAA+B,CAAA;IAE/B,qCAAqC;IACrC,uDAAyC,CAAA;IAEzC,iCAAiC;IACjC,6CAA+B,CAAA;IAE/B,6BAA6B;IAC7B,yCAA2B,CAAA;IAE3B,yDAAyD;IACzD,yCAA2B,CAAA;IAE3B,qDAAqD;IACrD,2DAA6C,CAAA;IAE7C,qBAAqB;IACrB,+CAAiC,CAAA;IAEjC,8CAA8C;IAC9C,6CAA+B,CAAA;IAE/B,2DAA2D;IAC3D,+CAAiC,CAAA;IAEjC,kCAAkC;IAClC,uBAAS,CAAA;AACb,CAAC,EAhDW,UAAU,0BAAV,UAAU,QAgDrB;AAED;;;GAGG;AACH,SAAgB,eAAe,CAAC,IAAY;IACxC,IAAI,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,IAAkB,CAAC,EAAE,CAAC;QACzD,OAAO,IAAkB,CAAC;IAC9B,CAAC;IACD,OAAO,SAAS,CAAC;AACrB,CAAC;AAED;;GAEG;AACH,SAAgB,wBAAwB,CAAC,IAAgB;IACrD,MAAM,YAAY,GAA+B;QAC7C,CAAC,UAAU,CAAC,0BAA0B,CAAC,EAAE,iCAAiC;QAC1E,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,uBAAuB;QAChD,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,6BAA6B;QAC7D,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,yBAAyB;QACrD,CAAC,UAAU,CAAC,iBAAiB,CAAC,EAAE,mBAAmB;QACnD,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,qBAAqB;QAC3C,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,yBAAyB;QACrD,CAAC,UAAU,CAAC,kBAAkB,CAAC,EAAE,gCAAgC;QACjE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,4BAA4B;QACxD,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,wBAAwB;QAClD,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,oDAAoD;QAC9E,CAAC,UAAU,CAAC,oBAAoB,CAAC,EAAE,gDAAgD;QACnF,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,gBAAgB;QAC7C,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,yCAAyC;QACrE,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,sDAAsD;QACnF,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,kBAAkB;KACtC,CAAC;IACF,OAAO,YAAY,CAAC,IAAI,CAAC,IAAI,qBAAqB,CAAC;AACvD,CAAC"}