mdi-llmkit 1.0.6 → 1.1.1
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/README.md +2 -2
- package/dist/src/index.d.ts +1 -3
- package/dist/src/index.js +1 -3
- package/dist/src/jsonSurgery/index.d.ts +2 -0
- package/dist/src/jsonSurgery/index.js +2 -0
- package/dist/tests/{comparison → semanticMatch}/compareLists.test.js +1 -1
- package/dist/tests/subpathExports.test.js +11 -11
- package/package.json +6 -6
- /package/dist/src/{comparison → semanticMatch}/compareLists.d.ts +0 -0
- /package/dist/src/{comparison → semanticMatch}/compareLists.js +0 -0
- /package/dist/src/{comparison → semanticMatch}/index.d.ts +0 -0
- /package/dist/src/{comparison → semanticMatch}/index.js +0 -0
- /package/dist/tests/{comparison → semanticMatch}/compareLists.test.d.ts +0 -0
package/README.md
CHANGED
|
@@ -76,7 +76,7 @@ import { jsonSurgery } from 'mdi-llmkit/jsonSurgery';
|
|
|
76
76
|
- It supports optional schema guidance and key-skipping for model-visible context.
|
|
77
77
|
- It supports validation/progress callbacks and soft iteration/time limits.
|
|
78
78
|
|
|
79
|
-
## `compareItemLists` (
|
|
79
|
+
## `compareItemLists` (semanticMatch)
|
|
80
80
|
|
|
81
81
|
`compareItemLists` performs a semantic diff between a "before" list and an "after" list,
|
|
82
82
|
including LLM-assisted rename/add/remove decisions.
|
|
@@ -106,7 +106,7 @@ import {
|
|
|
106
106
|
compareItemLists,
|
|
107
107
|
ItemComparisonResult,
|
|
108
108
|
type OnComparingItemCallback,
|
|
109
|
-
} from 'mdi-llmkit/
|
|
109
|
+
} from 'mdi-llmkit/semanticMatch';
|
|
110
110
|
|
|
111
111
|
const client = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
|
|
112
112
|
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { OpenAI } from 'openai';
|
|
2
2
|
import { describe, expect, it } from 'vitest';
|
|
3
|
-
import { compareItemLists, ItemComparisonResult, } from '../../src/
|
|
3
|
+
import { compareItemLists, ItemComparisonResult, } from '../../src/semanticMatch/compareLists.js';
|
|
4
4
|
const OPENAI_API_KEY = process.env.OPENAI_API_KEY?.trim();
|
|
5
5
|
if (!OPENAI_API_KEY) {
|
|
6
6
|
throw new Error('OPENAI_API_KEY is required for compareItemLists live API tests. Configure your test environment to provide it.');
|
|
@@ -4,17 +4,17 @@ import { readFile } from 'node:fs/promises';
|
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
import { beforeAll, describe, expect, it } from 'vitest';
|
|
6
6
|
const DIST_GPTAPI_INDEX = path.resolve('dist/src/gptApi/index.js');
|
|
7
|
-
const DIST_JSON_SURGERY = path.resolve('dist/src/jsonSurgery/
|
|
8
|
-
const
|
|
7
|
+
const DIST_JSON_SURGERY = path.resolve('dist/src/jsonSurgery/index.js');
|
|
8
|
+
const DIST_SEMANTIC_MATCH_INDEX = path.resolve('dist/src/semanticMatch/index.js');
|
|
9
9
|
beforeAll(() => {
|
|
10
10
|
if (!existsSync(DIST_GPTAPI_INDEX) ||
|
|
11
11
|
!existsSync(DIST_JSON_SURGERY) ||
|
|
12
|
-
!existsSync(
|
|
12
|
+
!existsSync(DIST_SEMANTIC_MATCH_INDEX)) {
|
|
13
13
|
execSync('npm run build', { stdio: 'inherit' });
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
describe('package subpath exports', () => {
|
|
17
|
-
it('declares gptApi, jsonSurgery, and
|
|
17
|
+
it('declares gptApi, jsonSurgery, and semanticMatch in package exports', async () => {
|
|
18
18
|
const packageJsonPath = path.resolve('package.json');
|
|
19
19
|
const packageJsonRaw = await readFile(packageJsonPath, 'utf8');
|
|
20
20
|
const packageJson = JSON.parse(packageJsonRaw);
|
|
@@ -22,11 +22,11 @@ describe('package subpath exports', () => {
|
|
|
22
22
|
expect(packageJson.exports?.['./gptApi']?.types).toBe('./dist/src/gptApi/index.d.ts');
|
|
23
23
|
expect(packageJson.exports?.['./gptApi']?.import).toBe('./dist/src/gptApi/index.js');
|
|
24
24
|
expect(packageJson.exports?.['./jsonSurgery']).toBeDefined();
|
|
25
|
-
expect(packageJson.exports?.['./jsonSurgery']?.types).toBe('./dist/src/jsonSurgery/
|
|
26
|
-
expect(packageJson.exports?.['./jsonSurgery']?.import).toBe('./dist/src/jsonSurgery/
|
|
27
|
-
expect(packageJson.exports?.['./
|
|
28
|
-
expect(packageJson.exports?.['./
|
|
29
|
-
expect(packageJson.exports?.['./
|
|
25
|
+
expect(packageJson.exports?.['./jsonSurgery']?.types).toBe('./dist/src/jsonSurgery/index.d.ts');
|
|
26
|
+
expect(packageJson.exports?.['./jsonSurgery']?.import).toBe('./dist/src/jsonSurgery/index.js');
|
|
27
|
+
expect(packageJson.exports?.['./semanticMatch']).toBeDefined();
|
|
28
|
+
expect(packageJson.exports?.['./semanticMatch']?.types).toBe('./dist/src/semanticMatch/index.d.ts');
|
|
29
|
+
expect(packageJson.exports?.['./semanticMatch']?.import).toBe('./dist/src/semanticMatch/index.js');
|
|
30
30
|
});
|
|
31
31
|
it('imports GPT API symbols from "mdi-llmkit/gptApi"', async () => {
|
|
32
32
|
const mod = await import('mdi-llmkit/gptApi');
|
|
@@ -39,8 +39,8 @@ describe('package subpath exports', () => {
|
|
|
39
39
|
expect(typeof mod.jsonSurgery).toBe('function');
|
|
40
40
|
expect(typeof mod.JSONSurgeryError).toBe('function');
|
|
41
41
|
});
|
|
42
|
-
it('imports
|
|
43
|
-
const mod = await import('mdi-llmkit/
|
|
42
|
+
it('imports semanticMatch symbols from "mdi-llmkit/semanticMatch"', async () => {
|
|
43
|
+
const mod = await import('mdi-llmkit/semanticMatch');
|
|
44
44
|
expect(typeof mod.compareItemLists).toBe('function');
|
|
45
45
|
expect(typeof mod.ItemComparisonResult).toBe('object');
|
|
46
46
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mdi-llmkit",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Utilities for managing multi-shot conversations and structured data handling in LLM applications",
|
|
5
5
|
"author": "Mikhail Voloshin",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
"import": "./dist/src/gptApi/index.js"
|
|
23
23
|
},
|
|
24
24
|
"./jsonSurgery": {
|
|
25
|
-
"types": "./dist/src/jsonSurgery/
|
|
26
|
-
"import": "./dist/src/jsonSurgery/
|
|
25
|
+
"types": "./dist/src/jsonSurgery/index.d.ts",
|
|
26
|
+
"import": "./dist/src/jsonSurgery/index.js"
|
|
27
27
|
},
|
|
28
|
-
"./
|
|
29
|
-
"types": "./dist/src/
|
|
30
|
-
"import": "./dist/src/
|
|
28
|
+
"./semanticMatch": {
|
|
29
|
+
"types": "./dist/src/semanticMatch/index.d.ts",
|
|
30
|
+
"import": "./dist/src/semanticMatch/index.js"
|
|
31
31
|
}
|
|
32
32
|
},
|
|
33
33
|
"files": [
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|