@untestutils/ai 0.5.0 → 0.5.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/model.d.ts +9 -8
- package/dist/model.d.ts.map +1 -1
- package/dist/prompts.d.mts +6 -0
- package/dist/prompts.d.ts.map +1 -1
- package/dist/tools/fs.d.mts +16 -0
- package/dist/tools/fs.d.ts +7 -6
- package/dist/tools/fs.d.ts.map +1 -1
- package/dist/tree.d.mts +17 -0
- package/dist/tree.d.ts.map +1 -1
- package/dist/workflows/generate.d.mts +28 -0
- package/dist/workflows/generate.d.ts.map +1 -1
- package/package.json +16 -16
package/dist/model.d.ts
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import type { runLlmGenerate } from './agent/run';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
importOpenai: () => Promise<typeof import("@ai-sdk/openai")>;
|
|
9
|
-
/** Bound after define — coverage tests spy imports then call via _internals */
|
|
2
|
+
type ModelInternals = {
|
|
3
|
+
importAi: () => Promise<typeof import('ai')>;
|
|
4
|
+
importAnthropic: () => Promise<typeof import('@ai-sdk/anthropic')>;
|
|
5
|
+
importXai: () => Promise<typeof import('@ai-sdk/xai')>;
|
|
6
|
+
importGoogle: () => Promise<typeof import('@ai-sdk/google')>;
|
|
7
|
+
importOpenai: () => Promise<typeof import('@ai-sdk/openai')>;
|
|
10
8
|
resolveModel: () => Promise<unknown>;
|
|
11
9
|
runLlmGenerate: typeof runLlmGenerate;
|
|
12
10
|
};
|
|
11
|
+
/** @internal test seams for LLM path */
|
|
12
|
+
export declare const _internals: ModelInternals;
|
|
13
13
|
export declare function resolveModel(): Promise<unknown>;
|
|
14
|
+
export {};
|
|
14
15
|
//# sourceMappingURL=model.d.ts.map
|
package/dist/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC;IAC7C,eAAe,EAAE,MAAM,OAAO,CAAC,cAAc,mBAAmB,CAAC,CAAC,CAAC;IACnE,SAAS,EAAE,MAAM,OAAO,CAAC,cAAc,aAAa,CAAC,CAAC,CAAC;IACvD,YAAY,EAAE,MAAM,OAAO,CAAC,cAAc,gBAAgB,CAAC,CAAC,CAAC;IAC7D,YAAY,EAAE,MAAM,OAAO,CAAC,cAAc,gBAAgB,CAAC,CAAC,CAAC;IAC7D,YAAY,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACrC,cAAc,EAAE,OAAO,cAAc,CAAC;CACvC,CAAC;AAEF,wCAAwC;AACxC,eAAO,MAAM,UAAU,EAAE,cASxB,CAAC;AAEF,wBAAsB,YAAY,IAAI,OAAO,CAAC,OAAO,CAAC,CAgBrD"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export type PromptName = "v1" | "convert-v1" | "fix-v1" | "cover-v1";
|
|
2
|
+
export declare function loadPrompt(name: PromptName): Promise<string>;
|
|
3
|
+
export declare const loadSystemPrompt: () => Promise<string>;
|
|
4
|
+
export declare const loadConvertPrompt: () => Promise<string>;
|
|
5
|
+
export declare const loadFixPrompt: () => Promise<string>;
|
|
6
|
+
export declare const loadCoverPrompt: () => Promise<string>;
|
package/dist/prompts.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,gBAAgB;AAChB,eAAO,MAAM,IAAI
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../src/prompts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAI5C,gBAAgB;AAChB,eAAO,MAAM,IAAI,EAAE;IACjB,UAAU,EAAE,OAAO,UAAU,CAAC;IAC9B,QAAQ,EAAE,OAAO,QAAQ,CAAC;CAI3B,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,CAAC;AASrE,wBAAsB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAWlE;AAED,eAAO,MAAM,gBAAgB,QAAO,OAAO,CAAC,MAAM,CAAqB,CAAC;AACxE,eAAO,MAAM,iBAAiB,QAAO,OAAO,CAAC,MAAM,CAA6B,CAAC;AACjF,eAAO,MAAM,aAAa,QAAO,OAAO,CAAC,MAAM,CAAyB,CAAC;AACzE,eAAO,MAAM,eAAe,QAAO,OAAO,CAAC,MAAM,CAA2B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { AgentToolBag } from "../agent/types.mjs";
|
|
2
|
+
export type AiTools = {
|
|
3
|
+
readPaths: () => string[];
|
|
4
|
+
list_dir: (path?: string) => Promise<unknown>;
|
|
5
|
+
read_file: (path: string) => Promise<unknown>;
|
|
6
|
+
grep: (pattern: string, path?: string) => Promise<unknown>;
|
|
7
|
+
};
|
|
8
|
+
export declare function createFsTools(root: string, limits: {
|
|
9
|
+
maxFilesRead: number;
|
|
10
|
+
maxBytesTotal: number;
|
|
11
|
+
}): AgentToolBag;
|
|
12
|
+
/** Back-compat wrapper used by older call sites */
|
|
13
|
+
export declare function createAiTools(root: string, limits: {
|
|
14
|
+
maxFilesRead: number;
|
|
15
|
+
maxBytesTotal: number;
|
|
16
|
+
}): AiTools;
|
package/dist/tools/fs.d.ts
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import type { AgentToolBag } from '../agent/types';
|
|
2
|
+
export type AiTools = {
|
|
3
|
+
readPaths: () => string[];
|
|
4
|
+
list_dir: (path?: string) => Promise<unknown>;
|
|
5
|
+
read_file: (path: string) => Promise<unknown>;
|
|
6
|
+
grep: (pattern: string, path?: string) => Promise<unknown>;
|
|
7
|
+
};
|
|
2
8
|
export declare function createFsTools(root: string, limits: {
|
|
3
9
|
maxFilesRead: number;
|
|
4
10
|
maxBytesTotal: number;
|
|
@@ -7,10 +13,5 @@ export declare function createFsTools(root: string, limits: {
|
|
|
7
13
|
export declare function createAiTools(root: string, limits: {
|
|
8
14
|
maxFilesRead: number;
|
|
9
15
|
maxBytesTotal: number;
|
|
10
|
-
}):
|
|
11
|
-
readPaths: () => string[];
|
|
12
|
-
list_dir: (path?: string) => Promise<unknown>;
|
|
13
|
-
read_file: (path: string) => Promise<unknown>;
|
|
14
|
-
grep: (pattern: string, path?: string) => Promise<unknown>;
|
|
15
|
-
};
|
|
16
|
+
}): AiTools;
|
|
16
17
|
//# sourceMappingURL=fs.d.ts.map
|
package/dist/tools/fs.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/tools/fs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"fs.d.ts","sourceRoot":"","sources":["../../src/tools/fs.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAa,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAK9D,MAAM,MAAM,OAAO,GAAG;IACpB,SAAS,EAAE,MAAM,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,CAAC,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,SAAS,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;IAC9C,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CAC5D,CAAC;AAQF,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACtD,YAAY,CAmGd;AAED,mDAAmD;AACnD,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GACtD,OAAO,CAWT"}
|
package/dist/tree.d.mts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { readdir } from "node:fs/promises";
|
|
2
|
+
export declare const IGNORE: Set<string>;
|
|
3
|
+
export interface FileTreeEntry {
|
|
4
|
+
path: string;
|
|
5
|
+
size: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function buildFileTree(root: string, maxEntries?: number): Promise<FileTreeEntry[]>;
|
|
8
|
+
export declare function treeSignature(tree: FileTreeEntry[]): string;
|
|
9
|
+
export declare function fingerprint(partsOrOpts: string[] | {
|
|
10
|
+
prompt: string;
|
|
11
|
+
root: string;
|
|
12
|
+
recipes: string[];
|
|
13
|
+
focus: string[];
|
|
14
|
+
treeSig: string;
|
|
15
|
+
}): string;
|
|
16
|
+
export declare function listTestFiles(root: string): Promise<string[]>;
|
|
17
|
+
export { readdir };
|
package/dist/tree.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAIjD,eAAO,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"tree.d.ts","sourceRoot":"","sources":["../src/tree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAIjD,eAAO,MAAM,MAAM,EAAE,GAAG,CAAC,MAAM,CAU7B,CAAC;AAEH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,SAAO,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAwB7F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,MAAM,CAI3D;AAED,wBAAgB,WAAW,CACzB,WAAW,EACP,MAAM,EAAE,GACR;IACE,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,GACJ,MAAM,CAiBR;AAED,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAQnE;AAED,OAAO,EAAE,OAAO,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type FileTreeEntry } from "../tree.mjs";
|
|
2
|
+
import type { GenerateResult } from "./types.mjs";
|
|
3
|
+
export declare const AI_PROMPT_VERSION = "v1";
|
|
4
|
+
export declare const CONVERT_PROMPT_VERSION = "convert-v1";
|
|
5
|
+
export interface AiTestOptions {
|
|
6
|
+
id: string;
|
|
7
|
+
prompt: string;
|
|
8
|
+
root: string;
|
|
9
|
+
recipes?: string[];
|
|
10
|
+
focus?: string[];
|
|
11
|
+
maxAttempts?: number;
|
|
12
|
+
maxExploreSteps?: number;
|
|
13
|
+
maxFilesRead?: number;
|
|
14
|
+
maxBytesTotal?: number;
|
|
15
|
+
baseURL?: string;
|
|
16
|
+
browser?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function aiTest(opts: AiTestOptions): Promise<GenerateResult>;
|
|
19
|
+
export interface ConvertTestOptions {
|
|
20
|
+
path: string;
|
|
21
|
+
root: string;
|
|
22
|
+
maxFilesRead?: number;
|
|
23
|
+
maxBytesTotal?: number;
|
|
24
|
+
maxExploreSteps?: number;
|
|
25
|
+
}
|
|
26
|
+
export declare function convertTestFile(opts: ConvertTestOptions): Promise<GenerateResult>;
|
|
27
|
+
export declare function aiTestFromFile(path: string, defaults?: Partial<AiTestOptions>): Promise<GenerateResult>;
|
|
28
|
+
export type { FileTreeEntry };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/workflows/generate.ts"],"names":[],"mappings":"AAQA,OAAO,EAA6C,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AACxF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAE9C,eAAO,MAAM,iBAAiB,OAAO,CAAC;AACtC,eAAO,MAAM,sBAAsB,eAAe,CAAC;AAEnD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAoBD,wBAAsB,MAAM,CA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AAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAsB,eAAe,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,cAAc,CAAC,CA2DvF;AAED,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,QAAQ,GAAE,OAAO,CAAC,aAAa,CAAM,GACpC,OAAO,CAAC,cAAc,CAAC,CA+BzB;AAED,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@untestutils/ai",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"homepage": "https://s00d.github.io/untestutils/",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/s00d/untestutils.git",
|
|
9
|
+
"directory": "packages/ai"
|
|
10
|
+
},
|
|
4
11
|
"files": [
|
|
5
12
|
"dist"
|
|
6
13
|
],
|
|
7
14
|
"type": "module",
|
|
8
15
|
"sideEffects": false,
|
|
16
|
+
"main": "./dist/index.mjs",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
9
18
|
"exports": {
|
|
10
19
|
".": {
|
|
11
20
|
"types": "./dist/index.d.ts",
|
|
@@ -14,16 +23,19 @@
|
|
|
14
23
|
},
|
|
15
24
|
"./package.json": "./package.json"
|
|
16
25
|
},
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
17
29
|
"dependencies": {
|
|
18
30
|
"pathe": "^2.0.3",
|
|
19
31
|
"tinyglobby": "^0.2.17",
|
|
20
|
-
"@untestutils/core": "0.5.
|
|
32
|
+
"@untestutils/core": "0.5.2"
|
|
21
33
|
},
|
|
22
34
|
"devDependencies": {
|
|
23
35
|
"@types/node": "^26.6.1",
|
|
36
|
+
"obuild": "^0.4.40",
|
|
24
37
|
"publint": "^0.3.24",
|
|
25
|
-
"typescript": "^6.0.3"
|
|
26
|
-
"obuild": "^0.4.40"
|
|
38
|
+
"typescript": "^6.0.3"
|
|
27
39
|
},
|
|
28
40
|
"peerDependencies": {
|
|
29
41
|
"@ai-sdk/anthropic": "^4.0.57",
|
|
@@ -56,18 +68,6 @@
|
|
|
56
68
|
"engines": {
|
|
57
69
|
"node": ">=20"
|
|
58
70
|
},
|
|
59
|
-
"license": "MIT",
|
|
60
|
-
"homepage": "https://s00d.github.io/untestutils/",
|
|
61
|
-
"repository": {
|
|
62
|
-
"type": "git",
|
|
63
|
-
"url": "git+https://github.com/s00d/untestutils.git",
|
|
64
|
-
"directory": "packages/ai"
|
|
65
|
-
},
|
|
66
|
-
"main": "./dist/index.mjs",
|
|
67
|
-
"types": "./dist/index.d.ts",
|
|
68
|
-
"publishConfig": {
|
|
69
|
-
"access": "public"
|
|
70
|
-
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "obuild && tsc -p tsconfig.build.json",
|
|
73
73
|
"publint": "publint --strict"
|