@modelprofile.com/flexharness 10.12.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.
- 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 +17 -0
- package/dist_ts/classes.flexharness.js +222 -8
- package/dist_ts/classes.toolcatalog.d.ts +90 -0
- package/dist_ts/classes.toolcatalog.js +1398 -0
- package/dist_ts/index.d.ts +1 -0
- package/dist_ts/index.js +2 -1
- package/dist_ts/interfaces.d.ts +237 -3
- package/dist_ts/interfaces.js +50 -1
- package/dist_ts/plugins.d.ts +66 -1
- package/dist_ts/plugins.js +19 -1
- package/dist_ts/utils.harnessoptions.d.ts +7 -1
- package/dist_ts/utils.harnessoptions.js +48 -2
- package/dist_ts/utils.json.js +3 -1
- package/dist_ts/utils.schemadeclarations.d.ts +53 -0
- package/dist_ts/utils.schemadeclarations.js +315 -0
- 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 +17 -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 +242 -7
- package/ts/classes.toolcatalog.ts +1512 -0
- package/ts/index.ts +1 -0
- package/ts/interfaces.ts +285 -3
- package/ts/plugins.ts +86 -0
- package/ts/readme.md +1 -1
- package/ts/utils.harnessoptions.ts +55 -0
- package/ts/utils.json.ts +2 -0
- package/ts/utils.schemadeclarations.ts +322 -0
- package/ts/utils.tooloutput.ts +9 -0
- package/ts_compaction/plugins.ts +3 -3
- package/ts_compaction/smartagent.compaction.ts +90 -34
package/dist_ts/index.d.ts
CHANGED
package/dist_ts/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export * from './classes.flexharness.js';
|
|
2
2
|
export * from './classes.stores.js';
|
|
3
|
+
export { FlexToolCatalog } from './classes.toolcatalog.js';
|
|
3
4
|
export * from './errors.js';
|
|
4
5
|
export * from './interfaces.js';
|
|
5
6
|
export { normalizeJsonValue } from './utils.json.js';
|
|
6
7
|
export { assertFlexProjectManagementSnapshot, assertFlexProjectManagementRecord, assertFlexProjectManagementTombstone, createEmptyFlexProjectManagementSnapshot, } from './utils.projectmanagement.js';
|
|
7
8
|
export { FLEX_SLASH_COMMAND_MAX_INPUT_BYTES, isReservedSlashCommandName, isValidSlashCommandName, parseSlashCommand, } from './utils.slashcommands.js';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
9
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLDBCQUEwQixDQUFDO0FBQ3pDLGNBQWMscUJBQXFCLENBQUM7QUFDcEMsT0FBTyxFQUFFLGVBQWUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBQzNELGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsaUJBQWlCLENBQUM7QUFDaEMsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0saUJBQWlCLENBQUM7QUFDckQsT0FBTyxFQUNMLG1DQUFtQyxFQUNuQyxpQ0FBaUMsRUFDakMsb0NBQW9DLEVBQ3BDLHdDQUF3QyxHQUN6QyxNQUFNLDhCQUE4QixDQUFDO0FBQ3RDLE9BQU8sRUFDTCxrQ0FBa0MsRUFDbEMsMEJBQTBCLEVBQzFCLHVCQUF1QixFQUN2QixpQkFBaUIsR0FDbEIsTUFBTSwwQkFBMEIsQ0FBQyJ9
|
package/dist_ts/interfaces.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export type TFlexRetryReason = plugins.TAgentRetryReason;
|
|
|
23
23
|
* Every call carries `provider` and `requestedModelId`; key usage caps on those two.
|
|
24
24
|
*/
|
|
25
25
|
export type TFlexModelCallUsage = plugins.TAgentModelCallUsage;
|
|
26
|
+
/** A model call's usage as harness events carry it: a reported call also states its cache hit ratio. */
|
|
27
|
+
export type TFlexObservedModelCallUsage = plugins.TAgentObservedModelCallUsage;
|
|
26
28
|
export interface IFlexTextPromptPart {
|
|
27
29
|
type: 'text';
|
|
28
30
|
text: string;
|
|
@@ -109,6 +111,8 @@ export interface IFlexToolMessagePart {
|
|
|
109
111
|
output?: TJsonValue;
|
|
110
112
|
error?: string;
|
|
111
113
|
childSessionId?: string;
|
|
114
|
+
/** For a catalog call a `run_code` program made: the `run_code` call's ID. */
|
|
115
|
+
parentToolCallId?: string;
|
|
112
116
|
model?: IFlexModelIdentity;
|
|
113
117
|
/** ISO time the tool call began. Absent on parts recorded before part times existed. */
|
|
114
118
|
startedAt?: string;
|
|
@@ -531,12 +535,241 @@ export interface IFlexToolProviderContext<TScope> extends IFlexSessionGeneration
|
|
|
531
535
|
signal: AbortSignal;
|
|
532
536
|
requestPermission(request: IFlexPermissionRequestInput): Promise<void>;
|
|
533
537
|
}
|
|
534
|
-
export interface IFlexToolHandle {
|
|
538
|
+
export interface IFlexToolHandle<TScope = unknown> {
|
|
535
539
|
tools: TFlexAgentToolSet;
|
|
540
|
+
/**
|
|
541
|
+
* Methods the model finds with `search_tools`, reads with `describe_tools` and calls with
|
|
542
|
+
* `execute`, instead of seeing each one as a tool on every step. Return the same object on
|
|
543
|
+
* every run: FlexHarness prepares a catalog once per object and treats it as immutable.
|
|
544
|
+
*/
|
|
545
|
+
catalog?: IFlexToolCatalog<TScope>;
|
|
536
546
|
close?(): Promise<void> | void;
|
|
537
547
|
}
|
|
538
548
|
export interface IFlexToolProvider<TScope> {
|
|
539
|
-
provideTools(context: IFlexToolProviderContext<TScope>): Promise<IFlexToolHandle | undefined> | IFlexToolHandle | undefined;
|
|
549
|
+
provideTools(context: IFlexToolProviderContext<TScope>): Promise<IFlexToolHandle<TScope> | undefined> | IFlexToolHandle<TScope> | undefined;
|
|
550
|
+
}
|
|
551
|
+
/** The names of the built-in catalog tools, reserved while a run has a catalog. */
|
|
552
|
+
export declare const FLEX_TOOL_CATALOG_TOOL_NAMES: Readonly<{
|
|
553
|
+
readonly search: "search_tools";
|
|
554
|
+
readonly describe: "describe_tools";
|
|
555
|
+
readonly execute: "execute";
|
|
556
|
+
}>;
|
|
557
|
+
export declare const FLEX_TOOL_CATALOG_LIMITS: Readonly<{
|
|
558
|
+
maxMethods: 4096;
|
|
559
|
+
maxTypes: 4096;
|
|
560
|
+
maxMethodPathCharacters: 160;
|
|
561
|
+
maxMethodPathSegments: 8;
|
|
562
|
+
maxIdentifierCharacters: 128;
|
|
563
|
+
maxSummaryCharacters: 120;
|
|
564
|
+
maxDescriptionBytes: number;
|
|
565
|
+
maxDeclarationBytes: number;
|
|
566
|
+
maxTags: 16;
|
|
567
|
+
maxTagCharacters: 48;
|
|
568
|
+
maxExamples: 4;
|
|
569
|
+
maxExampleBytes: 1024;
|
|
570
|
+
maxSchemaBytes: number;
|
|
571
|
+
defaultSearchResults: 10;
|
|
572
|
+
maxSearchResults: 50;
|
|
573
|
+
maxQueryCharacters: 512;
|
|
574
|
+
maxDescribeMethods: 16;
|
|
575
|
+
maxDescribeTypes: 32;
|
|
576
|
+
maxDescribeBytes: number;
|
|
577
|
+
maxParamIssues: 10;
|
|
578
|
+
}>;
|
|
579
|
+
export interface IFlexCatalogSearchInput {
|
|
580
|
+
/** Words to rank methods by. */
|
|
581
|
+
query?: string;
|
|
582
|
+
/** A dotted namespace to search in or, without `query`, to list. */
|
|
583
|
+
namespace?: string;
|
|
584
|
+
limit?: number;
|
|
585
|
+
offset?: number;
|
|
586
|
+
}
|
|
587
|
+
export interface IFlexCatalogDescribeInput {
|
|
588
|
+
/** Dotted method paths. */
|
|
589
|
+
methods?: readonly string[];
|
|
590
|
+
/** Named types to declare again or for the first time. */
|
|
591
|
+
types?: readonly string[];
|
|
592
|
+
}
|
|
593
|
+
export interface IFlexCatalogDescribeResult {
|
|
594
|
+
/** TypeScript text, or a JSON object in `json-schema` mode. */
|
|
595
|
+
output: TJsonValue;
|
|
596
|
+
/** The named types the output declares. */
|
|
597
|
+
declaredTypes: string[];
|
|
598
|
+
}
|
|
599
|
+
/** One way `execute`'s params miss the method's schema. */
|
|
600
|
+
export interface IFlexCatalogParamIssue {
|
|
601
|
+
/** Where, such as `params.lines[0].amount`. */
|
|
602
|
+
path: string;
|
|
603
|
+
expected: string;
|
|
604
|
+
/** The given value as compact JSON, or `missing`. */
|
|
605
|
+
got: string;
|
|
606
|
+
}
|
|
607
|
+
/** What `execute` reports to the model, as JSON, when it cannot call a method. */
|
|
608
|
+
export type TFlexCatalogCallError = {
|
|
609
|
+
error: 'unknown_method';
|
|
610
|
+
method: string;
|
|
611
|
+
didYouMean: string[];
|
|
612
|
+
hint: string;
|
|
613
|
+
} | {
|
|
614
|
+
error: 'invalid_params';
|
|
615
|
+
method: string;
|
|
616
|
+
issues: IFlexCatalogParamIssue[];
|
|
617
|
+
/** How many more issues were found than listed. */
|
|
618
|
+
more?: number;
|
|
619
|
+
/** The lookup that returns the method's declaration. */
|
|
620
|
+
see: string;
|
|
621
|
+
} | {
|
|
622
|
+
error: 'denied';
|
|
623
|
+
method: string;
|
|
624
|
+
reason: string;
|
|
625
|
+
};
|
|
626
|
+
export interface IFlexCatalogToolDefinition {
|
|
627
|
+
description: string;
|
|
628
|
+
/** The tool's input as JSON Schema. */
|
|
629
|
+
inputSchema: plugins.JSONSchema7;
|
|
630
|
+
}
|
|
631
|
+
/**
|
|
632
|
+
* A parameter or result schema: a plain JSON Schema object, or a zod, Standard Schema or AI SDK
|
|
633
|
+
* schema. `$ref`s to `#/$defs/<Name>` or `#/definitions/<Name>` that the schema does not define name
|
|
634
|
+
* a catalog type.
|
|
635
|
+
*/
|
|
636
|
+
export type TFlexCatalogSchema = {
|
|
637
|
+
readonly [keyword: string]: unknown;
|
|
638
|
+
} | plugins.FlexibleSchema<unknown>;
|
|
639
|
+
export interface IFlexCatalogRunContext<TScope = unknown> {
|
|
640
|
+
/** The dotted path the model called. */
|
|
641
|
+
readonly method: string;
|
|
642
|
+
/**
|
|
643
|
+
* The call's ID, which its tool part and permission requests carry: the `execute` call's, or for
|
|
644
|
+
* a call inside `run_code` the inner call's, `<run_code call ID>.<n>`.
|
|
645
|
+
*/
|
|
646
|
+
readonly toolCallId: string;
|
|
647
|
+
readonly abortSignal: AbortSignal;
|
|
648
|
+
/** The run's tool-provider context: scope, session, run and `requestPermission`. */
|
|
649
|
+
readonly provider: Readonly<IFlexToolProviderContext<TScope>>;
|
|
650
|
+
}
|
|
651
|
+
export interface IFlexCatalogMethod<TScope = unknown, TParams = any, TResult = unknown> {
|
|
652
|
+
/**
|
|
653
|
+
* The dotted path the model calls, such as `banking.listMovements`: up to 8 segments, each a
|
|
654
|
+
* JavaScript identifier of letters, digits and `_`.
|
|
655
|
+
*/
|
|
656
|
+
method: string;
|
|
657
|
+
/** One line of at most 120 characters, shown in search results. */
|
|
658
|
+
summary: string;
|
|
659
|
+
/** The full description, shown with the declaration. */
|
|
660
|
+
description?: string;
|
|
661
|
+
/** More words `search_tools` matches. */
|
|
662
|
+
tags?: readonly string[];
|
|
663
|
+
/** Code shown as `@example` in the declaration. */
|
|
664
|
+
examples?: readonly string[];
|
|
665
|
+
/** The parameter object's schema; `execute` validates every call against it. */
|
|
666
|
+
inputSchema: TFlexCatalogSchema;
|
|
667
|
+
/** The result's schema, declared as the method's return type. */
|
|
668
|
+
outputSchema?: TFlexCatalogSchema;
|
|
669
|
+
/**
|
|
670
|
+
* Declaration text that replaces the generated one, such as a declaration built from TypeScript
|
|
671
|
+
* sources with their JSDoc: `function listMovements(params: …): Promise<…>;`, optionally after
|
|
672
|
+
* its JSDoc, with the last path segment as the function name.
|
|
673
|
+
*/
|
|
674
|
+
declaration?: string;
|
|
675
|
+
/** Runs the method with validated parameters. */
|
|
676
|
+
run(params: TParams, context: IFlexCatalogRunContext<TScope>): TResult | PromiseLike<TResult> | AsyncIterable<TResult>;
|
|
677
|
+
/**
|
|
678
|
+
* Decides each validated call before it runs: `run` (the default without this hook), `propose`
|
|
679
|
+
* to hand it to the catalog's `onProposals` instead of running it, or `{ deny }` to refuse it.
|
|
680
|
+
*/
|
|
681
|
+
onCall?(params: TParams, context: IFlexCatalogRunContext<TScope>): TFlexCatalogCallDecision | PromiseLike<TFlexCatalogCallDecision>;
|
|
682
|
+
}
|
|
683
|
+
export type TFlexCatalogCallDecision = 'run' | 'propose' | {
|
|
684
|
+
deny: string;
|
|
685
|
+
};
|
|
686
|
+
/** A call a method's `onCall` decided to propose instead of running. */
|
|
687
|
+
export interface IFlexCatalogProposal {
|
|
688
|
+
/** The call's ID: the `execute` call's, or the inner call's inside `run_code`. */
|
|
689
|
+
id: string;
|
|
690
|
+
method: string;
|
|
691
|
+
params: unknown;
|
|
692
|
+
}
|
|
693
|
+
export interface IFlexCatalogProposalContext<TScope = unknown> {
|
|
694
|
+
/** The `execute` or `run_code` call that made the proposals. */
|
|
695
|
+
readonly toolCallId: string;
|
|
696
|
+
readonly abortSignal: AbortSignal;
|
|
697
|
+
readonly provider: Readonly<IFlexToolProviderContext<TScope>>;
|
|
698
|
+
}
|
|
699
|
+
/** A named type that method declarations refer to; it needs a `declaration`, a `schema`, or both. */
|
|
700
|
+
export interface IFlexCatalogType {
|
|
701
|
+
/** A JavaScript identifier such as `IMoney`. */
|
|
702
|
+
name: string;
|
|
703
|
+
description?: string;
|
|
704
|
+
/** Validates parameters that refer to this type, and generates its declaration. */
|
|
705
|
+
schema?: TFlexCatalogSchema;
|
|
706
|
+
/** Declaration text that replaces the generated one, such as `interface IMoney { … }`. */
|
|
707
|
+
declaration?: string;
|
|
708
|
+
}
|
|
709
|
+
export interface IFlexToolCatalog<TScope = unknown> {
|
|
710
|
+
methods: readonly IFlexCatalogMethod<TScope>[];
|
|
711
|
+
types?: readonly IFlexCatalogType[];
|
|
712
|
+
/**
|
|
713
|
+
* Receives the calls `onCall` proposed, as one batch: the proposed call of an `execute`, or every
|
|
714
|
+
* call a `run_code` program proposed, once the program finished. A failed program proposes
|
|
715
|
+
* nothing. What it returns is what the model sees for them.
|
|
716
|
+
*/
|
|
717
|
+
onProposals?(proposals: readonly IFlexCatalogProposal[], context: IFlexCatalogProposalContext<TScope>): unknown;
|
|
718
|
+
}
|
|
719
|
+
export interface IFlexToolCatalogOptions {
|
|
720
|
+
/**
|
|
721
|
+
* What `describe_tools` returns: `typescript` (default) declarations with named types shared
|
|
722
|
+
* across the session, or `json-schema` with each method's self-contained JSON Schema.
|
|
723
|
+
*/
|
|
724
|
+
declarations?: 'typescript' | 'json-schema';
|
|
725
|
+
/**
|
|
726
|
+
* Adds `run_code`, which runs a short TypeScript or JavaScript program against the catalog in a
|
|
727
|
+
* QuickJS sandbox. Needs the optional peers `quickjs-emscripten-core`,
|
|
728
|
+
* `@jitl/quickjs-ng-wasmfile-release-sync` and `amaro`.
|
|
729
|
+
*/
|
|
730
|
+
codeMode?: boolean | IFlexCodeModeOptions;
|
|
731
|
+
}
|
|
732
|
+
export interface IFlexCodeModeOptions {
|
|
733
|
+
limits?: Partial<IFlexCodeModeLimits>;
|
|
734
|
+
}
|
|
735
|
+
/** The bounds of one `run_code` program. */
|
|
736
|
+
export interface IFlexCodeModeLimits {
|
|
737
|
+
/** UTF-8 bytes of the program. */
|
|
738
|
+
maxSourceBytes: number;
|
|
739
|
+
/** Milliseconds the program may compute; time waiting for calls does not count. */
|
|
740
|
+
cpuMs: number;
|
|
741
|
+
/** Milliseconds the program may take in all, not counting waits for a permission decision. */
|
|
742
|
+
wallMs: number;
|
|
743
|
+
/** Bytes of the sandbox's heap. */
|
|
744
|
+
memoryBytes: number;
|
|
745
|
+
/**
|
|
746
|
+
* Bytes of the sandbox's stack. QuickJS runs on the host's stack as well, so a larger value lets
|
|
747
|
+
* deep recursion reach the host's limit first; the program then fails at its `stack` limit all
|
|
748
|
+
* the same.
|
|
749
|
+
*/
|
|
750
|
+
stackBytes: number;
|
|
751
|
+
/** Catalog calls per program. */
|
|
752
|
+
maxCalls: number;
|
|
753
|
+
/** Catalog calls running at once; further calls wait for a slot. */
|
|
754
|
+
maxConcurrentCalls: number;
|
|
755
|
+
/** UTF-8 bytes of console output kept; more is cut off. */
|
|
756
|
+
maxLogBytes: number;
|
|
757
|
+
}
|
|
758
|
+
export declare const FLEX_CODE_MODE_TOOL_NAME = "run_code";
|
|
759
|
+
export declare const FLEX_CODE_MODE_DEFAULT_LIMITS: Readonly<IFlexCodeModeLimits>;
|
|
760
|
+
export declare const FLEX_CODE_MODE_MAXIMUM_LIMITS: Readonly<IFlexCodeModeLimits>;
|
|
761
|
+
/** What `run_code` reports to the model, as JSON, when a program does not finish. */
|
|
762
|
+
export interface IFlexCodeRunFailure {
|
|
763
|
+
error: 'syntax_error' | 'program_error' | 'limit_exceeded' | 'aborted';
|
|
764
|
+
/** The limit that stopped the program, for `limit_exceeded`. */
|
|
765
|
+
limit?: 'source' | 'cpu' | 'wall' | 'memory' | 'stack' | 'calls';
|
|
766
|
+
name?: string;
|
|
767
|
+
message: string;
|
|
768
|
+
/** The program's line, when known. */
|
|
769
|
+
line?: number;
|
|
770
|
+
/** Catalog calls the program made. */
|
|
771
|
+
calls: number;
|
|
772
|
+
logs?: string;
|
|
540
773
|
}
|
|
541
774
|
export interface IFlexResourceToolProviderResolverContext<TScope> extends IFlexSessionGeneration {
|
|
542
775
|
scopeId: string;
|
|
@@ -1096,6 +1329,7 @@ export interface IFlexHarnessOptions<TScope> {
|
|
|
1096
1329
|
externalErrorProjector?: TFlexExternalErrorProjector;
|
|
1097
1330
|
subagents?: IFlexSubagentDefinition[];
|
|
1098
1331
|
builtInTools?: IFlexBuiltInToolsOptions;
|
|
1332
|
+
toolCatalog?: IFlexToolCatalogOptions;
|
|
1099
1333
|
slashCommands?: readonly TFlexSlashCommandRegistration<TScope>[];
|
|
1100
1334
|
/** Maximum child depth (root is 0). Defaults to 6; configurable from 1 through 8. */
|
|
1101
1335
|
maxSubagentDepth?: number;
|
|
@@ -1251,7 +1485,7 @@ export type TFlexModelUsageEvent = IFlexEventBase & {
|
|
|
1251
1485
|
readonly type: 'model.usage';
|
|
1252
1486
|
readonly runId?: string;
|
|
1253
1487
|
readonly source: 'generation' | 'compaction';
|
|
1254
|
-
} & Readonly<
|
|
1488
|
+
} & Readonly<TFlexObservedModelCallUsage>;
|
|
1255
1489
|
export interface IFlexPromptQueueEvent extends IFlexEventBase {
|
|
1256
1490
|
readonly type: 'prompt.queued' | 'prompt.started' | 'prompt.running' | 'prompt.finished';
|
|
1257
1491
|
readonly queueId: string;
|
package/dist_ts/interfaces.js
CHANGED
|
@@ -16,6 +16,55 @@ export const FLEX_SESSION_IMPORT_MAXIMUM_LIMITS = Object.freeze({
|
|
|
16
16
|
maxPageBytes: 1536 * 1024,
|
|
17
17
|
stagedImportIdleTimeoutMs: 60 * 60 * 1000,
|
|
18
18
|
});
|
|
19
|
+
/** The names of the built-in catalog tools, reserved while a run has a catalog. */
|
|
20
|
+
export const FLEX_TOOL_CATALOG_TOOL_NAMES = Object.freeze({
|
|
21
|
+
search: 'search_tools',
|
|
22
|
+
describe: 'describe_tools',
|
|
23
|
+
execute: 'execute',
|
|
24
|
+
});
|
|
25
|
+
export const FLEX_TOOL_CATALOG_LIMITS = Object.freeze({
|
|
26
|
+
maxMethods: 4096,
|
|
27
|
+
maxTypes: 4096,
|
|
28
|
+
maxMethodPathCharacters: 160,
|
|
29
|
+
maxMethodPathSegments: 8,
|
|
30
|
+
maxIdentifierCharacters: 128,
|
|
31
|
+
maxSummaryCharacters: 120,
|
|
32
|
+
maxDescriptionBytes: 16 * 1024,
|
|
33
|
+
maxDeclarationBytes: 16 * 1024,
|
|
34
|
+
maxTags: 16,
|
|
35
|
+
maxTagCharacters: 48,
|
|
36
|
+
maxExamples: 4,
|
|
37
|
+
maxExampleBytes: 1024,
|
|
38
|
+
maxSchemaBytes: 64 * 1024,
|
|
39
|
+
defaultSearchResults: 10,
|
|
40
|
+
maxSearchResults: 50,
|
|
41
|
+
maxQueryCharacters: 512,
|
|
42
|
+
maxDescribeMethods: 16,
|
|
43
|
+
maxDescribeTypes: 32,
|
|
44
|
+
maxDescribeBytes: 64 * 1024,
|
|
45
|
+
maxParamIssues: 10,
|
|
46
|
+
});
|
|
47
|
+
export const FLEX_CODE_MODE_TOOL_NAME = 'run_code';
|
|
48
|
+
export const FLEX_CODE_MODE_DEFAULT_LIMITS = Object.freeze({
|
|
49
|
+
maxSourceBytes: 32 * 1024,
|
|
50
|
+
cpuMs: 5_000,
|
|
51
|
+
wallMs: 60_000,
|
|
52
|
+
memoryBytes: 64 * 1024 * 1024,
|
|
53
|
+
stackBytes: 64 * 1024,
|
|
54
|
+
maxCalls: 200,
|
|
55
|
+
maxConcurrentCalls: 8,
|
|
56
|
+
maxLogBytes: 16 * 1024,
|
|
57
|
+
});
|
|
58
|
+
export const FLEX_CODE_MODE_MAXIMUM_LIMITS = Object.freeze({
|
|
59
|
+
maxSourceBytes: 256 * 1024,
|
|
60
|
+
cpuMs: 60_000,
|
|
61
|
+
wallMs: 30 * 60_000,
|
|
62
|
+
memoryBytes: 512 * 1024 * 1024,
|
|
63
|
+
stackBytes: 256 * 1024,
|
|
64
|
+
maxCalls: 10_000,
|
|
65
|
+
maxConcurrentCalls: 64,
|
|
66
|
+
maxLogBytes: 256 * 1024,
|
|
67
|
+
});
|
|
19
68
|
export const FLEX_PROJECT_MANAGEMENT_SCHEMA_VERSION = 1;
|
|
20
69
|
export const FLEX_SESSION_GENERATION_ID_MAX_BYTES = 128;
|
|
21
70
|
export const FLEX_SESSION_GENERATION_COHORT_MAX_ENTRIES = 2048;
|
|
@@ -46,4 +95,4 @@ export const FLEX_REVERSION_MAX_AFFECTED_WORKSPACES = 64;
|
|
|
46
95
|
export const FLEX_REVERSION_WORKSPACE_ID_MAX_BYTES = 512;
|
|
47
96
|
export const FLEX_REVERSION_WORKSPACE_LABEL_MAX_BYTES = 2048;
|
|
48
97
|
export const FLEX_REVERSION_REASON_CODE_MAX_BYTES = 128;
|
|
49
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
98
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL2ludGVyZmFjZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBNlRBLHlGQUF5RjtBQUN6RixNQUFNLENBQUMsTUFBTSxxQ0FBcUMsR0FBRyxHQUFHLEdBQUcsSUFBSSxDQUFDO0FBQ2hFLE1BQU0sQ0FBQyxNQUFNLHFDQUFxQyxHQUFHLEVBQUUsR0FBRyxJQUFJLENBQUM7QUFDL0QsTUFBTSxDQUFDLE1BQU0sNkJBQTZCLEdBQUcsQ0FBQyxDQUFDO0FBRS9DLE1BQU0sQ0FBQyxNQUFNLGtDQUFrQyxHQUFHLE1BQU0sQ0FBQyxNQUFNLENBQUM7SUFDOUQsY0FBYyxFQUFFLENBQUM7SUFDakIscUJBQXFCLEVBQUUsSUFBSTtJQUMzQixlQUFlLEVBQUUsRUFBRSxHQUFHLElBQUksR0FBRyxJQUFJO0lBQ2pDLFlBQVksRUFBRSxJQUFJLEdBQUcsSUFBSTtJQUN6Qix5QkFBeUIsRUFBRSxDQUFDLEdBQUcsRUFBRSxHQUFHLElBQUk7Q0FDekMsQ0FBQyxDQUFDO0FBRUgsTUFBTSxDQUFDLE1BQU0sa0NBQWtDLEdBQUcsTUFBTSxDQUFDLE1BQU0sQ0FBQztJQUM5RCxjQUFjLEVBQUUsRUFBRTtJQUNsQixxQkFBcUIsRUFBRSxNQUFNO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FBcUMsR0FBRyxHQUFHLENBQUM7QUFDekQsTUFBTSxDQUFDLE1BQU0sd0NBQXdDLEdBQUcsSUFBSSxDQUFDO0FBQzdELE1BQU0sQ0FBQyxNQUFNLG9DQUFvQyxHQUFHLEdBQUcsQ0FBQyJ9
|
package/dist_ts/plugins.d.ts
CHANGED
|
@@ -3,9 +3,74 @@ import * as crypto from 'node:crypto';
|
|
|
3
3
|
import * as fs from 'node:fs/promises';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
5
|
export { AsyncLocalStorage, crypto, fs, path };
|
|
6
|
+
import { asSchema, jsonSchema } from 'ai';
|
|
7
|
+
import { Validator as JsonSchemaValidator } from '@cfworker/json-schema';
|
|
8
|
+
export { asSchema, jsonSchema, JsonSchemaValidator };
|
|
9
|
+
export type { FlexibleSchema, JSONSchema7, ModelMessage, Schema } from 'ai';
|
|
10
|
+
/** A value inside a QuickJS context; the host disposes every handle it owns. */
|
|
11
|
+
export interface IQuickJsHandle {
|
|
12
|
+
readonly alive: boolean;
|
|
13
|
+
dispose(): void;
|
|
14
|
+
}
|
|
15
|
+
export type TQuickJsResult = {
|
|
16
|
+
value: IQuickJsHandle;
|
|
17
|
+
error?: undefined;
|
|
18
|
+
} | {
|
|
19
|
+
error: IQuickJsHandle;
|
|
20
|
+
value?: undefined;
|
|
21
|
+
};
|
|
22
|
+
export interface IQuickJsDeferredPromise {
|
|
23
|
+
readonly handle: IQuickJsHandle;
|
|
24
|
+
readonly alive: boolean;
|
|
25
|
+
resolve(value?: IQuickJsHandle): void;
|
|
26
|
+
reject(value?: IQuickJsHandle): void;
|
|
27
|
+
dispose(): void;
|
|
28
|
+
}
|
|
29
|
+
export interface IQuickJsContext {
|
|
30
|
+
readonly global: IQuickJsHandle;
|
|
31
|
+
newString(value: string): IQuickJsHandle;
|
|
32
|
+
getString(handle: IQuickJsHandle): string;
|
|
33
|
+
newFunction(name: string, implementation: (...args: IQuickJsHandle[]) => IQuickJsHandle | void): IQuickJsHandle;
|
|
34
|
+
setProp(target: IQuickJsHandle, key: string, value: IQuickJsHandle): void;
|
|
35
|
+
newPromise(): IQuickJsDeferredPromise;
|
|
36
|
+
newError(message: string): IQuickJsHandle;
|
|
37
|
+
evalCode(code: string, filename?: string): TQuickJsResult;
|
|
38
|
+
resolvePromise(handle: IQuickJsHandle): Promise<TQuickJsResult>;
|
|
39
|
+
dump(handle: IQuickJsHandle): unknown;
|
|
40
|
+
dispose(): void;
|
|
41
|
+
}
|
|
42
|
+
export interface IQuickJsRuntime {
|
|
43
|
+
readonly alive: boolean;
|
|
44
|
+
setMemoryLimit(bytes: number): void;
|
|
45
|
+
setMaxStackSize(bytes: number): void;
|
|
46
|
+
setInterruptHandler(handler: () => boolean): void;
|
|
47
|
+
newContext(): IQuickJsContext;
|
|
48
|
+
/** Runs the queued promise jobs; `error` is an exception none of them caught. */
|
|
49
|
+
executePendingJobs(): {
|
|
50
|
+
error?: IQuickJsHandle;
|
|
51
|
+
};
|
|
52
|
+
dispose(): void;
|
|
53
|
+
}
|
|
54
|
+
export interface IQuickJsModule {
|
|
55
|
+
newRuntime(): IQuickJsRuntime;
|
|
56
|
+
}
|
|
57
|
+
/** A failed strip, as amaro reports it. */
|
|
58
|
+
export interface IAmaroError {
|
|
59
|
+
code?: string;
|
|
60
|
+
message?: string;
|
|
61
|
+
startLine?: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ICodeSandboxEngine {
|
|
64
|
+
/** A new WebAssembly instance of QuickJS-ng, with a memory of its own. */
|
|
65
|
+
newModule(): Promise<IQuickJsModule>;
|
|
66
|
+
/** Removes TypeScript type syntax, keeping every line where it was. */
|
|
67
|
+
stripTypes(source: string): string;
|
|
68
|
+
}
|
|
69
|
+
/** Loads QuickJS and amaro, the optional peers code mode needs. */
|
|
70
|
+
export declare const importCodeSandboxEngine: () => Promise<ICodeSandboxEngine>;
|
|
6
71
|
import { AgentEventStoreConflictError, AgentPendingInputQueue, AgentPendingInputRejectedError, AgentSession, buildModelMessages, ToolJobStoreConflictError, createAgentEvent, filterModelVisibleAgentEvents, getAgentGenerationTransactions, isGenerationInModelContext, modelMessagesToAgentEvents, tool, validateAgentEventArchiveV2, validateAgentEventSnapshotV2, z } from '@modelprofile.com/flexharness-agent';
|
|
7
72
|
export { AgentEventStoreConflictError, AgentPendingInputQueue, AgentPendingInputRejectedError, AgentSession, buildModelMessages, ToolJobStoreConflictError, createAgentEvent, filterModelVisibleAgentEvents, getAgentGenerationTransactions, isGenerationInModelContext, modelMessagesToAgentEvents, tool, validateAgentEventArchiveV2, validateAgentEventSnapshotV2, z, };
|
|
8
|
-
export type { IAgentAppliedInput, ISmartAiCacheDispatch, IAgentEventArchiveV2, IAgentContextCompactionOptions, IAgentEventSnapshotV2, IAgentEventStoreV2, IAgentGenerateResult, IAgentGenerationHandle, IAgentGenerationLease, IAgentRetryEvent, IAgentRunResult, IAgentSession, IAgentSessionOptions, IAgentToolCallUpdateEvent, IAgentRuntimeEventPayload, IGenerationBegunEvent, IGenerationExecutionCompletedEvent, IGenerationExecutionStartedEvent, IGenerationOutcomeEvent, IToolExecutionContext, IToolExecutionIntentEvent, IToolJobSnapshot, IToolJobState, IToolJobStore, TAgentContextBuilder, TAgentContextCompactor, TAgentEvent, TAgentGenerationOutcome, TAgentModelCallUsage, TAgentModelCallUsageEvent, TAgentRetryReason, TAgentToolCallFinishEvent, TAgentToolExecutionReconciliationOptions, } from '@modelprofile.com/flexharness-agent';
|
|
73
|
+
export type { IAgentAppliedInput, ISmartAiCacheDispatch, IAgentEventArchiveV2, IAgentContextCompactionOptions, IAgentEventSnapshotV2, IAgentEventStoreV2, IAgentGenerateResult, IAgentGenerationHandle, IAgentGenerationLease, IAgentRetryEvent, IAgentRunResult, IAgentSession, IAgentSessionOptions, IAgentToolCallUpdateEvent, IAgentRuntimeEventPayload, IGenerationBegunEvent, IGenerationExecutionCompletedEvent, IGenerationExecutionStartedEvent, IGenerationOutcomeEvent, IToolExecutionContext, IToolExecutionIntentEvent, IToolJobSnapshot, IToolJobState, IToolJobStore, TAgentContextBuilder, TAgentContextCompactor, TAgentEvent, TAgentGenerationOutcome, TAgentModelCallUsage, TAgentModelCallUsageEvent, TAgentObservedModelCallUsage, TAgentRetryReason, TAgentToolCallFinishEvent, TAgentToolExecutionReconciliationOptions, } from '@modelprofile.com/flexharness-agent';
|
|
9
74
|
import { getSmartAiCacheWaitMs, isModelLimitError, isModelLimitInfo } from '@modelprofile.com/flexharness-models';
|
|
10
75
|
export { getSmartAiCacheWaitMs, isModelLimitError, isModelLimitInfo };
|
|
11
76
|
export type { IModelLimitInfo } from '@modelprofile.com/flexharness-models';
|
package/dist_ts/plugins.js
CHANGED
|
@@ -4,9 +4,27 @@ import * as crypto from 'node:crypto';
|
|
|
4
4
|
import * as fs from 'node:fs/promises';
|
|
5
5
|
import * as path from 'node:path';
|
|
6
6
|
export { AsyncLocalStorage, crypto, fs, path };
|
|
7
|
+
// third party scope
|
|
8
|
+
import { asSchema, jsonSchema } from 'ai';
|
|
9
|
+
import { Validator as JsonSchemaValidator } from '@cfworker/json-schema';
|
|
10
|
+
export { asSchema, jsonSchema, JsonSchemaValidator };
|
|
11
|
+
/** Loads QuickJS and amaro, the optional peers code mode needs. */
|
|
12
|
+
export const importCodeSandboxEngine = async () => {
|
|
13
|
+
const [core, variant, amaro] = await Promise.all([
|
|
14
|
+
import('quickjs-emscripten-core'),
|
|
15
|
+
import('@jitl/quickjs-ng-wasmfile-release-sync'),
|
|
16
|
+
import('amaro'),
|
|
17
|
+
]);
|
|
18
|
+
// The variant's typings resolve as CommonJS; at run time the default export is the variant.
|
|
19
|
+
const quickjsVariant = variant.default;
|
|
20
|
+
return {
|
|
21
|
+
newModule: async () => await core.newQuickJSWASMModuleFromVariant(quickjsVariant),
|
|
22
|
+
stripTypes: (source) => amaro.transformSync(source, { mode: 'strip-only' }).code,
|
|
23
|
+
};
|
|
24
|
+
};
|
|
7
25
|
// @push.rocks scope
|
|
8
26
|
import { AgentEventStoreConflictError, AgentPendingInputQueue, AgentPendingInputRejectedError, AgentSession, buildModelMessages, ToolJobStoreConflictError, createAgentEvent, filterModelVisibleAgentEvents, getAgentGenerationTransactions, isGenerationInModelContext, modelMessagesToAgentEvents, tool, validateAgentEventArchiveV2, validateAgentEventSnapshotV2, z, } from '@modelprofile.com/flexharness-agent';
|
|
9
27
|
export { AgentEventStoreConflictError, AgentPendingInputQueue, AgentPendingInputRejectedError, AgentSession, buildModelMessages, ToolJobStoreConflictError, createAgentEvent, filterModelVisibleAgentEvents, getAgentGenerationTransactions, isGenerationInModelContext, modelMessagesToAgentEvents, tool, validateAgentEventArchiveV2, validateAgentEventSnapshotV2, z, };
|
|
10
28
|
import { getSmartAiCacheWaitMs, isModelLimitError, isModelLimitInfo } from '@modelprofile.com/flexharness-models';
|
|
11
29
|
export { getSmartAiCacheWaitMs, isModelLimitError, isModelLimitInfo };
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3BsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsb0JBQW9CO0FBQ3BCLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLGtCQUFrQixDQUFDO0FBQ3JELE9BQU8sS0FBSyxNQUFNLE1BQU0sYUFBYSxDQUFDO0FBQ3RDLE9BQU8sS0FBSyxFQUFFLE1BQU0sa0JBQWtCLENBQUM7QUFDdkMsT0FBTyxLQUFLLElBQUksTUFBTSxXQUFXLENBQUM7QUFFbEMsT0FBTyxFQUFFLGlCQUFpQixFQUFFLE1BQU0sRUFBRSxFQUFFLEVBQUUsSUFBSSxFQUFFLENBQUM7QUFFL0Msb0JBQW9CO0FBQ3BCLE9BQU8sRUFBRSxRQUFRLEVBQUUsVUFBVSxFQUFFLE1BQU0sSUFBSSxDQUFDO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MEJBQTBCLEVBQzFCLElBQUksRUFDSiwyQkFBMkIsRUFDM0IsNEJBQTRCLEVBQzVCLENBQUMsR0FDRixNQUFNLHFDQUFxQyxDQUFDO0FBRTdDLE9BQU8sRUFDTCw0QkFBNEIsRUFDNUIsc0JBQXNCLEVBQ3RCLDhCQUE4QixFQUM5QixZQUFZLEVBQ1osa0JBQWtCLEVBQ2xCLHlCQUF5QixFQUN6QixnQkFBZ0IsRUFDaEIsNkJBQTZCLEVBQzdCLDhCQUE4QixFQUM5QiwwQkFBMEIsRUFDMUIsMEJBQTBCLEVBQzFCLElBQUksRUFDSiwyQkFBMkIsRUFDM0IsNEJBQTRCLEVBQzVCLENBQUMsR0FDRixDQUFDO0FBc0NGLE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxpQkFBaUIsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLHNDQUFzQyxDQUFDO0FBRWxILE9BQU8sRUFBRSxxQkFBcUIsRUFBRSxpQkFBaUIsRUFBRSxnQkFBZ0IsRUFBRSxDQUFDIn0=
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IFlexAgentSessionPolicy, IFlexCallbackLimits, IFlexHarnessOptions, IFlexHarnessStores, IFlexPromptQueueLimits, IFlexReversionLimits, IFlexSlashCommandHandlerRegistration, IFlexSlashCommandTemplateRegistration, IFlexSubagentDefinition, TFlexSlashCommandRegistration } from './interfaces.js';
|
|
1
|
+
import type { IFlexAgentSessionPolicy, IFlexCallbackLimits, IFlexHarnessOptions, IFlexHarnessStores, IFlexPromptQueueLimits, IFlexReversionLimits, IFlexSlashCommandHandlerRegistration, IFlexSlashCommandTemplateRegistration, IFlexCodeModeLimits, IFlexSubagentDefinition, IFlexToolCatalogOptions, TFlexSlashCommandRegistration } from './interfaces.js';
|
|
2
2
|
export type TRegisteredSlashCommand<TScope> = Readonly<IFlexSlashCommandTemplateRegistration> | Readonly<IFlexSlashCommandHandlerRegistration<TScope>>;
|
|
3
3
|
export interface INormalizedProjectManagementTools {
|
|
4
4
|
readonly task: boolean;
|
|
@@ -12,6 +12,12 @@ export interface INormalizedBuiltInTools {
|
|
|
12
12
|
export declare const maxSubagentNameBytes = 128;
|
|
13
13
|
export declare function normalizeAllowedTools(names: readonly string[] | undefined, label?: string): readonly string[] | undefined;
|
|
14
14
|
export declare function normalizeSubagents(definitions: readonly IFlexSubagentDefinition[] | undefined): ReadonlyMap<string, Readonly<IFlexSubagentDefinition>>;
|
|
15
|
+
export interface INormalizedToolCatalogOptions {
|
|
16
|
+
readonly declarations: 'typescript' | 'json-schema';
|
|
17
|
+
/** The limits of `run_code`; absent while code mode is off. */
|
|
18
|
+
readonly codeMode?: Readonly<IFlexCodeModeLimits>;
|
|
19
|
+
}
|
|
20
|
+
export declare function normalizeToolCatalogOptions(options: IFlexToolCatalogOptions | undefined): INormalizedToolCatalogOptions;
|
|
15
21
|
export declare function normalizeBuiltInTools(options: IFlexHarnessOptions<unknown>['builtInTools']): INormalizedBuiltInTools;
|
|
16
22
|
export declare function normalizeSlashCommands<TScope>(registrations: readonly TFlexSlashCommandRegistration<TScope>[] | undefined): ReadonlyMap<string, TRegisteredSlashCommand<TScope>>;
|
|
17
23
|
export declare function resolveBoundedPositiveInteger(value: number | undefined, name: string, defaultValue: number, maximum: number): number;
|