@modelprofile.com/flexharness 10.13.0 → 10.14.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.
@@ -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,8 @@ 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;
21
25
  private namespaceTree?;
22
26
  private constructor();
23
27
  /**
@@ -32,8 +36,14 @@ export declare class FlexToolCatalog<TScope = unknown> {
32
36
  /** The same catalog offering only `paths`. */
33
37
  restrict(paths: Iterable<string>): FlexToolCatalog<TScope>;
34
38
  has(path: string): boolean;
35
- /** The three built-in tools as the model sees them. Their text depends only on the catalog. */
39
+ /**
40
+ * The built-in tools as the model sees them: the three catalog tools, and `run_code` in code
41
+ * mode. Their text depends only on the catalog and its options.
42
+ */
36
43
  toolDefinitions(): Record<string, IFlexCatalogToolDefinition>;
44
+ private codeToolDefinition;
45
+ /** Hands proposed calls to the catalog's `onProposals` and returns what the model sees for them. */
46
+ propose(proposals: readonly IFlexCatalogProposal[], context: IFlexCatalogProposalContext<TScope>): Promise<unknown>;
37
47
  /** Search results or a namespace listing as text. */
38
48
  search(input?: IFlexCatalogSearchInput): string;
39
49
  /**
@@ -68,8 +78,8 @@ export declare class FlexToolCatalog<TScope = unknown> {
68
78
  private foreignIssues;
69
79
  }
70
80
  /**
71
- * While a run has a catalog, its three tool names are reserved, and a method path must differ from
72
- * every tool name.
81
+ * While a run has a catalog, its tool names are reserved (`run_code` in code mode too), and a
82
+ * method path must differ from every tool name.
73
83
  */
74
84
  export declare const assertNoCatalogCollisions: (catalog: FlexToolCatalog<unknown>, tools: Readonly<Record<string, unknown>>) => void;
75
85
  /**