@modelprofile.com/flexharness 10.13.0 → 10.15.0
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_ts/00_commitinfo_data.js +1 -1
- package/dist_ts/classes.codesandbox.d.ts +39 -0
- package/dist_ts/classes.codesandbox.js +539 -0
- package/dist_ts/classes.flexharness.d.ts +10 -0
- package/dist_ts/classes.flexharness.js +148 -16
- package/dist_ts/classes.toolcatalog.d.ts +27 -7
- package/dist_ts/classes.toolcatalog.js +311 -69
- package/dist_ts/interfaces.d.ts +137 -5
- package/dist_ts/interfaces.js +32 -1
- package/dist_ts/plugins.d.ts +62 -1
- package/dist_ts/plugins.js +15 -1
- package/dist_ts/utils.harnessoptions.d.ts +9 -2
- package/dist_ts/utils.harnessoptions.js +52 -11
- package/dist_ts/utils.json.js +3 -1
- package/dist_ts/utils.tooloutput.d.ts +2 -0
- package/dist_ts/utils.tooloutput.js +11 -1
- package/dist_ts_compaction/plugins.d.ts +3 -3
- package/dist_ts_compaction/plugins.js +3 -3
- package/dist_ts_compaction/smartagent.compaction.d.ts +10 -1
- package/dist_ts_compaction/smartagent.compaction.js +79 -38
- package/package.json +16 -4
- package/readme.md +1 -1
- package/ts/00_commitinfo_data.ts +1 -1
- package/ts/classes.codesandbox.ts +565 -0
- package/ts/classes.flexharness.ts +152 -15
- package/ts/classes.toolcatalog.ts +344 -66
- package/ts/interfaces.ts +169 -5
- package/ts/plugins.ts +79 -0
- package/ts/readme.md +1 -1
- package/ts/utils.harnessoptions.ts +68 -12
- package/ts/utils.json.ts +2 -0
- package/ts/utils.tooloutput.ts +9 -0
- package/ts_compaction/plugins.ts +3 -3
- package/ts_compaction/smartagent.compaction.ts +90 -34
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import * as plugins from './plugins.js';
|
|
2
|
-
import { type IFlexCatalogDescribeInput, type IFlexCatalogDescribeResult, type IFlexCatalogMethod, type IFlexCatalogRunContext, type IFlexCatalogSearchInput, type IFlexCatalogToolDefinition, type IFlexToolCatalog, type IFlexToolCatalogOptions, type TFlexCatalogCallError } from './interfaces.js';
|
|
2
|
+
import { type IFlexCatalogProposal, type IFlexCatalogProposalContext, type IFlexCodeModeLimits, type TFlexCatalogCallDecision, type IFlexCatalogDescribeInput, type IFlexCatalogDescribeResult, type IFlexCatalogMethod, type IFlexCatalogRunContext, type IFlexCatalogSearchInput, type IFlexCatalogToolDefinition, type IFlexToolCatalog, type IFlexToolCatalogOptions, type TFlexCatalogCallError } from './interfaces.js';
|
|
3
3
|
interface IPreparedCall {
|
|
4
4
|
readonly success: true;
|
|
5
5
|
readonly method: string;
|
|
6
6
|
readonly params: unknown;
|
|
7
|
+
/** The method's `onCall` decision for the call; `run` without the hook. */
|
|
8
|
+
decide(context: IFlexCatalogRunContext<any>): Promise<TFlexCatalogCallDecision>;
|
|
7
9
|
run(context: IFlexCatalogRunContext<any>): ReturnType<IFlexCatalogMethod['run']>;
|
|
8
10
|
}
|
|
9
11
|
interface IFailedCall {
|
|
@@ -18,6 +20,12 @@ interface IFailedCall {
|
|
|
18
20
|
export declare class FlexToolCatalog<TScope = unknown> {
|
|
19
21
|
private readonly core;
|
|
20
22
|
private readonly admitted;
|
|
23
|
+
/** The limits of `run_code`; absent while code mode is off. */
|
|
24
|
+
readonly codeMode: Readonly<IFlexCodeModeLimits> | undefined;
|
|
25
|
+
/** Levels of a result's named types a TypeScript declaration declares. */
|
|
26
|
+
private readonly outputTypeDepth;
|
|
27
|
+
/** `search` follows a clear top match with its declaration. */
|
|
28
|
+
private readonly describeTopMatch;
|
|
21
29
|
private namespaceTree?;
|
|
22
30
|
private constructor();
|
|
23
31
|
/**
|
|
@@ -32,10 +40,22 @@ export declare class FlexToolCatalog<TScope = unknown> {
|
|
|
32
40
|
/** The same catalog offering only `paths`. */
|
|
33
41
|
restrict(paths: Iterable<string>): FlexToolCatalog<TScope>;
|
|
34
42
|
has(path: string): boolean;
|
|
35
|
-
/**
|
|
43
|
+
/**
|
|
44
|
+
* The built-in tools as the model sees them: the three catalog tools, and `run_code` in code
|
|
45
|
+
* mode. Their text depends only on the catalog and its options.
|
|
46
|
+
*/
|
|
36
47
|
toolDefinitions(): Record<string, IFlexCatalogToolDefinition>;
|
|
37
|
-
|
|
38
|
-
|
|
48
|
+
private codeToolDefinition;
|
|
49
|
+
/** Hands proposed calls to the catalog's `onProposals` and returns what the model sees for them. */
|
|
50
|
+
propose(proposals: readonly IFlexCatalogProposal[], context: IFlexCatalogProposalContext<TScope>): Promise<unknown>;
|
|
51
|
+
/**
|
|
52
|
+
* Search results or a namespace listing as text. A clear top match of a query's first page is
|
|
53
|
+
* followed by its declaration, as `describe` gives it with `options`.
|
|
54
|
+
*/
|
|
55
|
+
search(input?: IFlexCatalogSearchInput, options?: {
|
|
56
|
+
declaredTypes?: Iterable<string>;
|
|
57
|
+
maxBytes?: number;
|
|
58
|
+
}): string;
|
|
39
59
|
/**
|
|
40
60
|
* The declarations of `input.methods` and `input.types`. Method declarations bring the named
|
|
41
61
|
* types they use, minus `declaredTypes`, which a session already has.
|
|
@@ -44,7 +64,7 @@ export declare class FlexToolCatalog<TScope = unknown> {
|
|
|
44
64
|
declaredTypes?: Iterable<string>;
|
|
45
65
|
maxBytes?: number;
|
|
46
66
|
}): IFlexCatalogDescribeResult;
|
|
47
|
-
/** The named types `describe_tools` results in `messages` declared. */
|
|
67
|
+
/** The named types the `describe_tools` and `search_tools` results in `messages` declared. */
|
|
48
68
|
declaredTypesIn(messages: readonly plugins.ModelMessage[] | undefined): Set<string>;
|
|
49
69
|
/**
|
|
50
70
|
* Resolves and validates a call. A failure is the error `execute` reports to the model; success
|
|
@@ -68,8 +88,8 @@ export declare class FlexToolCatalog<TScope = unknown> {
|
|
|
68
88
|
private foreignIssues;
|
|
69
89
|
}
|
|
70
90
|
/**
|
|
71
|
-
* While a run has a catalog, its
|
|
72
|
-
* every tool name.
|
|
91
|
+
* While a run has a catalog, its tool names are reserved (`run_code` in code mode too), and a
|
|
92
|
+
* method path must differ from every tool name.
|
|
73
93
|
*/
|
|
74
94
|
export declare const assertNoCatalogCollisions: (catalog: FlexToolCatalog<unknown>, tools: Readonly<Record<string, unknown>>) => void;
|
|
75
95
|
/**
|