@gestaltrun/dsh-agent-eval 0.0.0-stage → 0.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/LICENSE +21 -0
- package/README.i18n.yaml +58 -0
- package/README.md +194 -2
- package/README.zh.md +195 -0
- package/cordis.patch.yml +13 -0
- package/lib/cs-hosting-plugin-B9bjLaoE.js +6980 -0
- package/lib/cs-hosting.js +2 -0
- package/lib/index.js +2 -0
- package/lib/types/agent-runs.d.ts +56 -0
- package/lib/types/cs-hosting-evaluation.d.ts +235 -0
- package/lib/types/cs-hosting-plugin.d.ts +10 -0
- package/lib/types/handoff.d.ts +4 -0
- package/lib/types/human-actions.d.ts +36 -0
- package/lib/types/im-purchase-intent.d.ts +12 -0
- package/lib/types/im-target.d.ts +45 -0
- package/lib/types/index.d.ts +22 -0
- package/lib/types/input-admission.d.ts +10 -0
- package/lib/types/practice-failure.d.ts +17 -0
- package/lib/types/product-field-policy.d.ts +129 -0
- package/lib/types/production-budget.d.ts +21 -0
- package/lib/types/production-buyers.d.ts +20 -0
- package/lib/types/production-workspace.d.ts +64 -0
- package/lib/types/purchase-intent.d.ts +66 -0
- package/lib/types/record.d.ts +169 -0
- package/lib/types/replay-world.d.ts +25 -0
- package/lib/types/reply-latency.d.ts +21 -0
- package/lib/types/runner.d.ts +97 -0
- package/lib/types/sales.d.ts +33 -0
- package/lib/types/script-production.d.ts +955 -0
- package/lib/types/server-script-source.d.ts +65 -0
- package/lib/types/simulated-buyer-role.d.ts +41 -0
- package/lib/types/snapshot-replay.d.ts +15 -0
- package/lib/types/step-failure.d.ts +25 -0
- package/lib/types/types.d.ts +174 -0
- package/locale/en.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +106 -3
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { MerchantAccount } from '@gestaltrun/dsh-merchant-account';
|
|
2
|
+
import { type SalesCaseFeature, type SalesCoverageResult, type SalesScriptVersion } from '@gestaltrun/dsh-cs-hosting/sales-case-contract';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { type EvaluationCaseRecord } from './record.ts';
|
|
5
|
+
import type { EvaluationCaseId } from './record.ts';
|
|
6
|
+
import type { EvaluationReplayRequirement, EvaluationScript, EvaluationScriptSource } from './types.ts';
|
|
7
|
+
type StoredScript = z.infer<typeof SalesScriptVersion>;
|
|
8
|
+
type StoredFeature = z.infer<typeof SalesCaseFeature>;
|
|
9
|
+
/** The runner script plus the server checks that produced it. */
|
|
10
|
+
export interface ServerEvaluationScript extends EvaluationScript {
|
|
11
|
+
/** Human-readable script subject for administrative inspection. */
|
|
12
|
+
readonly displayTitle?: string;
|
|
13
|
+
readonly scriptVersionId: string;
|
|
14
|
+
/** Demand-line revision the script was written from; selects the matching locally collected replay. */
|
|
15
|
+
readonly caseRevision: number;
|
|
16
|
+
/** Reads that supply the cited replay records. */
|
|
17
|
+
readonly requiredReads: readonly EvaluationReplayRequirement[];
|
|
18
|
+
readonly checks: StoredScript['script']['checks'];
|
|
19
|
+
/** Judge inputs derived only from frozen checks and verified replay records. */
|
|
20
|
+
readonly metrics: Pick<EvaluationCaseRecord, 'checks' | 'requiredFacts' | 'orderFactsAvailable'>;
|
|
21
|
+
}
|
|
22
|
+
/** Tenant-authenticated reads used by the source; a caller can substitute another transport. */
|
|
23
|
+
export interface ServerScriptReader {
|
|
24
|
+
/** @param scriptVersionId - Concrete script version UUID. @param signal - Case lifetime. @returns Stored version. */
|
|
25
|
+
loadScript(scriptVersionId: string, signal: AbortSignal): Promise<z.infer<typeof SalesScriptVersion>>;
|
|
26
|
+
/** @param setId - Coverage set UUID. @param signal - Case lifetime. @returns Coverage result with case material. */
|
|
27
|
+
loadCoverage(setId: string, signal: AbortSignal): Promise<z.infer<typeof SalesCoverageResult>>;
|
|
28
|
+
}
|
|
29
|
+
/** Merchant-session reader used by the source; only request is needed. */
|
|
30
|
+
export type ServerScriptAccount = Pick<MerchantAccount, 'request'>;
|
|
31
|
+
/** Options for the server-backed source. */
|
|
32
|
+
export interface ServerScriptSourceOptions {
|
|
33
|
+
/** Operation label recorded in generated replay envelopes. */
|
|
34
|
+
readonly operationId?: string;
|
|
35
|
+
}
|
|
36
|
+
/** Loads a frozen script by its concrete server version UUID. */
|
|
37
|
+
export declare class MerchantServerScriptSource implements EvaluationScriptSource {
|
|
38
|
+
private readonly reader;
|
|
39
|
+
private readonly options;
|
|
40
|
+
/** @param reader - Tenant-authenticated script and coverage reads. @param options - Stable replay operation label. */
|
|
41
|
+
constructor(reader: ServerScriptReader, options?: ServerScriptSourceOptions);
|
|
42
|
+
/**
|
|
43
|
+
* @param id - Concrete `SalesScriptVersion.id` UUID, branded as a case id by the runner.
|
|
44
|
+
* @param signal - Case lifetime.
|
|
45
|
+
* @returns Script, replay entries and server checks.
|
|
46
|
+
* @throws When the reader rejects the read or the script has no matching case material.
|
|
47
|
+
*/
|
|
48
|
+
load(id: EvaluationCaseId, signal: AbortSignal): Promise<ServerEvaluationScript>;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Build the production reader from a signed-in merchant account.
|
|
52
|
+
* @param account - Merchant account whose tenant routes are requested.
|
|
53
|
+
* @returns Reader using the synced script and coverage routes.
|
|
54
|
+
*/
|
|
55
|
+
export declare function merchantScriptReader(account: Pick<MerchantAccount, 'request'>): ServerScriptReader;
|
|
56
|
+
/**
|
|
57
|
+
* Convert one stored script and its case material into the runner form.
|
|
58
|
+
* @param stored - Immutable server script version.
|
|
59
|
+
* @param feature - Coverage feature containing original messages.
|
|
60
|
+
* @param destinationName - Display name of the script destination.
|
|
61
|
+
* @param operationId - Replay envelope operation label.
|
|
62
|
+
* @returns Runner script with messages, replay entries and checks.
|
|
63
|
+
*/
|
|
64
|
+
export declare function scriptOf(stored: StoredScript, feature: StoredFeature, destinationName: string, operationId?: string): ServerEvaluationScript;
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
2
|
+
import { type BuyerJudge, type SimulatedBuyerThresholds } from '@gestaltrun/dsh-cs-hosting';
|
|
3
|
+
import type { ImEvaluationBinding } from './im-target.ts';
|
|
4
|
+
import type { EvaluationAction, EvaluationRole, EvaluationScript } from './types.ts';
|
|
5
|
+
/** Options of the simulated-buyer role. */
|
|
6
|
+
export interface SimulatedBuyerRoleOptions {
|
|
7
|
+
/** Host with the buyer Session, IM runtime, Session persistence and tool registry. */
|
|
8
|
+
readonly ctx: Context;
|
|
9
|
+
/** Recorded or live System One decision client. */
|
|
10
|
+
readonly judge: BuyerJudge;
|
|
11
|
+
/** Deployment-resolved probability thresholds; the customer-service Host exposes them through its service. */
|
|
12
|
+
readonly thresholds: SimulatedBuyerThresholds;
|
|
13
|
+
/** Real milliseconds allowed for one buyer model turn; defaults to 120000. */
|
|
14
|
+
readonly stepTimeoutMs?: number;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Buyer role backed by the simulated-buyer Workspace Agent.
|
|
18
|
+
*
|
|
19
|
+
* The buyer Agent is the dual-Session simulated user created by `ImEvaluationTarget`; this role
|
|
20
|
+
* prepares each Host step, admits native IM replies and relays only approved buyer messages.
|
|
21
|
+
*/
|
|
22
|
+
export declare class SimulatedBuyerRole implements EvaluationRole<ImEvaluationBinding> {
|
|
23
|
+
private readonly options;
|
|
24
|
+
private buyer;
|
|
25
|
+
/** @param options - Context, decision client and step bounds. */
|
|
26
|
+
constructor(options: SimulatedBuyerRoleOptions);
|
|
27
|
+
/** @returns Whether the buyer mindset reached the ordering state during this case. */
|
|
28
|
+
outcome(): {
|
|
29
|
+
readonly simulatedDeal: boolean;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* @param script - Frozen script, knowledge card and optional buying psychology.
|
|
33
|
+
* @param signal - Case lifetime.
|
|
34
|
+
* @param binding - Running pair and its buyer Agent.
|
|
35
|
+
* @returns Host-approved messages in order, ending with the script completion or an invalid marker.
|
|
36
|
+
*/
|
|
37
|
+
actions(script: EvaluationScript, signal: AbortSignal, binding: ImEvaluationBinding): AsyncIterable<EvaluationAction>;
|
|
38
|
+
private historyCursor;
|
|
39
|
+
private readMindsetEvidence;
|
|
40
|
+
private rows;
|
|
41
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CliResult, SimulationReadRequest } from '@gestaltrun/dsh-cs-hosting/merchant-cli';
|
|
2
|
+
import type { EvaluationReplayEntry } from './types.ts';
|
|
3
|
+
type Selection = {
|
|
4
|
+
readonly entry?: EvaluationReplayEntry;
|
|
5
|
+
readonly result?: CliResult;
|
|
6
|
+
readonly reason: string;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Resolve recorded first/second screens and case-local search; third/sku have no collected baseline.
|
|
10
|
+
* @param request - Validated simulated seller read and its case clock.
|
|
11
|
+
* @param entries - Case-local CLI results; collection records require their actual observedAt.
|
|
12
|
+
* @returns A replay result or explicit missing facts; undefined delegates unrelated commands.
|
|
13
|
+
*/
|
|
14
|
+
export declare function snapshotReplay(request: SimulationReadRequest, entries: readonly EvaluationReplayEntry[]): Selection | undefined;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** Partial, settled target evidence retained when a model step cannot finish normally. */
|
|
2
|
+
import type { EvaluationTurn } from './types.ts';
|
|
3
|
+
import type { EvaluationCaseRecord } from './record.ts';
|
|
4
|
+
/** Host-only failure; its cause is not serialized into the case record. */
|
|
5
|
+
export declare class EvaluationStepFailure extends Error {
|
|
6
|
+
readonly partial: EvaluationTurn;
|
|
7
|
+
/** @param partial - Messages, tools and usage already observed after target cleanup. @param cause - Original failure for Host diagnostics. */
|
|
8
|
+
constructor(partial: EvaluationTurn, cause: unknown);
|
|
9
|
+
}
|
|
10
|
+
/** Settled case evidence retained when setup or cleanup prevents the runner from returning. */
|
|
11
|
+
export declare class EvaluationCaseFailure extends Error {
|
|
12
|
+
readonly record: EvaluationCaseRecord;
|
|
13
|
+
/** @param record - Observed case data, including an empty transcript before admission. @param cause - Original Host failure, kept out of wire records. */
|
|
14
|
+
constructor(record: EvaluationCaseRecord, cause: unknown);
|
|
15
|
+
}
|
|
16
|
+
/** Provider-neutral failure from the tested Agent's persisted terminal event. */
|
|
17
|
+
export declare class EvaluationModelFailure extends Error {
|
|
18
|
+
readonly code: string;
|
|
19
|
+
/** @param code - Machine code already recorded by the model adapter. */
|
|
20
|
+
constructor(code: string);
|
|
21
|
+
}
|
|
22
|
+
/** Host reply-wait deadline; it does not cancel the tested Agent or the evaluation. */
|
|
23
|
+
export declare class EvaluationReplyTimeout extends Error {
|
|
24
|
+
constructor();
|
|
25
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/** Host extension points for evaluating an Agent without embedding domain rules in the runner. */
|
|
2
|
+
import type { Branded } from '@deepseek-ai/dsh-brand';
|
|
3
|
+
import type { CliResult } from '@gestaltrun/dsh-cs-hosting/merchant-cli';
|
|
4
|
+
import type { FirstReplyTiming } from '@gestaltrun/dsh-cs-hosting/types';
|
|
5
|
+
import type { EvaluationCaseRecord } from './record.ts';
|
|
6
|
+
import type { EvaluationHumanAction } from './human-actions.ts';
|
|
7
|
+
import type { EvaluationInputId } from './purchase-intent.ts';
|
|
8
|
+
/** Ephemeral tool identity used to join a domain world's read observations. */
|
|
9
|
+
export type EvaluationCallId = Branded<'EvaluationCallId'>;
|
|
10
|
+
/** One production CLI result retained for a script; the world returns it at or after `at`. */
|
|
11
|
+
export interface EvaluationReplayEntry {
|
|
12
|
+
readonly command: string;
|
|
13
|
+
readonly args: Readonly<Record<string, unknown>>;
|
|
14
|
+
readonly at: number;
|
|
15
|
+
/** Inclusive last equal sample, when retained by collection; diagnostic only, not an expiry. */
|
|
16
|
+
readonly validThrough?: number | undefined;
|
|
17
|
+
/** Actual collection time of detail data; omission never substitutes the historical anchor at. */
|
|
18
|
+
readonly observedAt?: number | undefined;
|
|
19
|
+
/** Collection data supplies only explicitly classified slow fields; omission retains command-specific interpretation. */
|
|
20
|
+
readonly usage?: 'historical' | 'collection' | undefined;
|
|
21
|
+
readonly result: CliResult;
|
|
22
|
+
}
|
|
23
|
+
/** A replay read that supplies a fact the reference conclusion or a check cites; only misses on these reads leave the environment incomplete. */
|
|
24
|
+
export interface EvaluationReplayRequirement {
|
|
25
|
+
readonly command: `seller.${string}` | `platform.${string}`;
|
|
26
|
+
/** Product `itemId`, order `orderId` or POI `poiId` of the cited record. */
|
|
27
|
+
readonly entityId: string;
|
|
28
|
+
/** Detail screen of a cited collection record; absent for snapshot and order reads. */
|
|
29
|
+
readonly screen?: string;
|
|
30
|
+
}
|
|
31
|
+
/** Buying-psychology card the Host uses to judge concern resolution; never model-generated. */
|
|
32
|
+
export interface EvaluationBuyingPsychology {
|
|
33
|
+
readonly intent: string;
|
|
34
|
+
readonly drivers: readonly string[];
|
|
35
|
+
readonly concerns: readonly {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
readonly text: string;
|
|
38
|
+
readonly resolution: string;
|
|
39
|
+
}[];
|
|
40
|
+
readonly bottomLine: string;
|
|
41
|
+
readonly decisionMode: string;
|
|
42
|
+
/** Condition under which the buyer places the order. */
|
|
43
|
+
readonly purchaseCondition?: string;
|
|
44
|
+
}
|
|
45
|
+
/** Input shared by deterministic and Agent-backed buyer roles. */
|
|
46
|
+
export interface EvaluationScript extends Pick<EvaluationCaseRecord, 'caseId' | 'scriptId' | 'scriptVersion' | 'originalMessages' | 'buyerKnowledge' | 'referenceConclusion' | 'facts'> {
|
|
47
|
+
readonly segments: readonly {
|
|
48
|
+
readonly at: number;
|
|
49
|
+
readonly messages: readonly string[];
|
|
50
|
+
}[];
|
|
51
|
+
readonly completion: 'goal_reached' | 'buyer_abandoned';
|
|
52
|
+
/** Frozen script card; absent for scripts that do not evaluate a model-driven buyer. */
|
|
53
|
+
readonly buyingPsychology?: EvaluationBuyingPsychology;
|
|
54
|
+
/** Script-authored candidates for Host-side human collaboration sampling. */
|
|
55
|
+
readonly humanActions?: readonly EvaluationHumanAction[];
|
|
56
|
+
/** Script-local replay results; a server script source supplies these. */
|
|
57
|
+
readonly replay?: readonly EvaluationReplayEntry[];
|
|
58
|
+
/** Sales phase; present only for scripts scored by the cs-sales-v1 metric pack. */
|
|
59
|
+
readonly sales?: {
|
|
60
|
+
readonly phase: 'presales' | 'other';
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/** A domain-independent role action; advancement is between completed target steps. */
|
|
64
|
+
export type EvaluationAction = {
|
|
65
|
+
readonly kind: 'advance';
|
|
66
|
+
readonly at: number;
|
|
67
|
+
} | {
|
|
68
|
+
readonly kind: 'message' | 'staff';
|
|
69
|
+
readonly text: string;
|
|
70
|
+
} | {
|
|
71
|
+
readonly kind: 'resume';
|
|
72
|
+
} | {
|
|
73
|
+
readonly kind: 'finish';
|
|
74
|
+
readonly reason: EvaluationScript['completion'];
|
|
75
|
+
} | {
|
|
76
|
+
readonly kind: 'invalid';
|
|
77
|
+
readonly reason: EvaluationInvalidReason;
|
|
78
|
+
};
|
|
79
|
+
/** Host-observed role invalidity; the case must not be scored. */
|
|
80
|
+
export type EvaluationInvalidReason = NonNullable<EvaluationCaseRecord['buyerInvalidReason']>;
|
|
81
|
+
/** Script selection may read a local fixture or a versioned server source. */
|
|
82
|
+
export interface EvaluationScriptSource {
|
|
83
|
+
/** @param id - Requested case. @param signal - Caller lifetime. @returns The frozen script and source facts. */
|
|
84
|
+
load(id: EvaluationCaseRecord['caseId'], signal: AbortSignal): Promise<EvaluationScript>;
|
|
85
|
+
}
|
|
86
|
+
/** Buyer-side generation; implementations must stop when the signal aborts. */
|
|
87
|
+
export interface EvaluationRole<Binding = undefined> {
|
|
88
|
+
/** @param script - Frozen knowledge and segments. @param signal - Caller lifetime. @param binding - Target-owned references for Agent-backed roles; opaque to the runner. @returns Ordered role actions. */
|
|
89
|
+
actions(script: EvaluationScript, signal: AbortSignal, binding: Binding): AsyncIterable<EvaluationAction>;
|
|
90
|
+
/** @returns Host-observed sales outcome after the run; omitted by roles that do not model purchase. */
|
|
91
|
+
outcome?(): {
|
|
92
|
+
readonly simulatedDeal: boolean;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
/** One switchable run condition; paired sales runs apply exactly an annotation-on and annotation-off variant. */
|
|
96
|
+
export interface EvaluationVariant {
|
|
97
|
+
readonly id: string;
|
|
98
|
+
/** Whether this group receives buying-psychology annotations; absent means off. */
|
|
99
|
+
readonly annotation?: boolean;
|
|
100
|
+
/** @param signal - Run lifetime. @returns Disposer restoring the deployment condition. */
|
|
101
|
+
apply(signal: AbortSignal): Promise<() => void | Promise<void>>;
|
|
102
|
+
}
|
|
103
|
+
/** Observations through target settlement or the reply-wait deadline. */
|
|
104
|
+
export interface EvaluationTurn {
|
|
105
|
+
/** Transport inputs whose receipt completed; observers additionally require their persisted Session admission. */
|
|
106
|
+
readonly inputIds?: readonly EvaluationInputId[];
|
|
107
|
+
/** Simulated sending instant from the accepted buyer receipt; absent when no buyer input was accepted. */
|
|
108
|
+
readonly inputAt?: number;
|
|
109
|
+
readonly messages: readonly {
|
|
110
|
+
readonly role: 'assistant' | 'operator';
|
|
111
|
+
readonly text: string;
|
|
112
|
+
readonly at: number;
|
|
113
|
+
}[];
|
|
114
|
+
readonly tools: readonly {
|
|
115
|
+
readonly at: number;
|
|
116
|
+
readonly id: EvaluationCallId;
|
|
117
|
+
readonly command: string;
|
|
118
|
+
readonly arguments: EvaluationCaseRecord['tools'][number]['arguments'];
|
|
119
|
+
readonly result: EvaluationCaseRecord['tools'][number]['result'];
|
|
120
|
+
readonly status: 'ok' | 'error' | 'timeout';
|
|
121
|
+
}[];
|
|
122
|
+
/** Present only after a buyer input was durably accepted; excludes target cleanup. */
|
|
123
|
+
readonly replyTiming?: FirstReplyTiming;
|
|
124
|
+
/** Reply waiting expired; the tested Agent remains running and the case can continue. */
|
|
125
|
+
readonly replyTimedOut?: true;
|
|
126
|
+
readonly usage: EvaluationCaseRecord['usage'];
|
|
127
|
+
readonly end?: 'handoff' | 'paused';
|
|
128
|
+
}
|
|
129
|
+
/** Domain bindings stay opaque to the runner and are shared only with its world adapter. */
|
|
130
|
+
export interface EvaluationConversation<Binding> {
|
|
131
|
+
readonly binding: Binding;
|
|
132
|
+
/** @returns Current simulated Unix milliseconds, including real elapsed time. */
|
|
133
|
+
currentTime(): number;
|
|
134
|
+
/** @param at - Next original segment time; earlier instants leave the running clock unchanged. */
|
|
135
|
+
advance(at: number): void;
|
|
136
|
+
/** @param text - Buyer message. @param signal - Step deadline and caller lifetime. @param human - Optional action admitted after buyer acceptance; omission sends only the buyer. @returns Observations through settlement or reply timeout; caller cancellation rejects. */
|
|
137
|
+
send(text: string, signal: AbortSignal, human?: EvaluationHumanInput): Promise<EvaluationTurn>;
|
|
138
|
+
/** @param text - Simulated shop staff reply during a confirmed handoff. @param signal - Step lifetime. @returns Durable operator record without awaiting an AI reply. */
|
|
139
|
+
staff?(text: string, signal: AbortSignal): Promise<EvaluationTurn>;
|
|
140
|
+
/** @param signal - Step lifetime. @returns Observations after restoring automatic handling; failure rejects without discarding earlier records. */
|
|
141
|
+
resume?(signal: AbortSignal): Promise<EvaluationTurn>;
|
|
142
|
+
/** @param action - Selected script plan, never generated by the buyer role. @param signal - Step lifetime. @param accepted - Called once after durable input acceptance, before awaiting a response. @returns Settled observations; a human conversation step may produce no customer reply. */
|
|
143
|
+
intervene?(action: EvaluationHumanAction, signal: AbortSignal, accepted: () => void): Promise<EvaluationTurn>;
|
|
144
|
+
/** Cancel outstanding work and await all resources owned by this conversation. */
|
|
145
|
+
close(): Promise<void>;
|
|
146
|
+
}
|
|
147
|
+
/** One human input admitted immediately after a buyer message, before collecting the reply. */
|
|
148
|
+
export interface EvaluationHumanInput {
|
|
149
|
+
readonly action: EvaluationHumanAction;
|
|
150
|
+
/** Acknowledge durable operator input exactly once. */
|
|
151
|
+
readonly accepted: () => void;
|
|
152
|
+
}
|
|
153
|
+
/** Creates the actual target, including its production preset and configuration. */
|
|
154
|
+
export interface EvaluationTarget<Binding> {
|
|
155
|
+
/** @param script - Case input. @param signal - Caller lifetime. @returns One isolated target conversation. */
|
|
156
|
+
open(script: EvaluationScript, signal: AbortSignal): Promise<EvaluationConversation<Binding>>;
|
|
157
|
+
}
|
|
158
|
+
/** World evidence joined to the target's logged tool calls. */
|
|
159
|
+
export interface EvaluationWorldHandle {
|
|
160
|
+
/** @param id - Target tool identity. @returns Replay classification, or not_applicable for unrelated tools. */
|
|
161
|
+
classify(id: EvaluationCallId): Pick<EvaluationCaseRecord['tools'][number], 'replay' | 'affectsConclusion'>;
|
|
162
|
+
/** Detach all per-case registrations after the target is closed. */
|
|
163
|
+
dispose(): Promise<void>;
|
|
164
|
+
}
|
|
165
|
+
/** Installs domain-specific replay and live-world behavior. */
|
|
166
|
+
export interface EvaluationWorld<Binding> {
|
|
167
|
+
/** @param binding - Target-owned references. @param script - Frozen case input. @param signal - Caller lifetime. @returns Per-case world evidence and cleanup. */
|
|
168
|
+
attach(binding: Binding, script: EvaluationScript, signal: AbortSignal): Promise<EvaluationWorldHandle>;
|
|
169
|
+
}
|
|
170
|
+
/** Metric packs declare questions and required facts; the runner performs no semantic scoring. */
|
|
171
|
+
export interface EvaluationMetricPack {
|
|
172
|
+
/** @param script - Frozen case input. @param messages - Completed simulated timeline; excludes unexecuted turns. @returns Applicable checks and required facts for the server judge. */
|
|
173
|
+
prepare(script: EvaluationScript, messages: EvaluationCaseRecord['messages']): Pick<EvaluationCaseRecord, 'checks' | 'requiredFacts' | 'orderFactsAvailable'>;
|
|
174
|
+
}
|
package/locale/en.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,109 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gestaltrun/dsh-agent-eval",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "Product agent evaluation runner and customer-service replay adapters",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/types/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
"./package.json": "./package.json",
|
|
10
|
+
"./cordis.patch.yml": "./cordis.patch.yml",
|
|
11
|
+
"./locale/*.json": "./locale/*.json",
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./lib/types/index.d.ts",
|
|
14
|
+
"default": "./lib/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./cs-hosting": {
|
|
17
|
+
"default": "./lib/cs-hosting.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"cordis.patch.yml",
|
|
22
|
+
"locale/*.json",
|
|
23
|
+
"lib",
|
|
24
|
+
"README.md",
|
|
25
|
+
"README.zh.md",
|
|
26
|
+
"LICENSE"
|
|
27
|
+
],
|
|
28
|
+
"license": "MIT",
|
|
29
|
+
"repository": {
|
|
30
|
+
"type": "git",
|
|
31
|
+
"url": "https://github.com/gestaltrun/deepseek-harness.git",
|
|
32
|
+
"directory": "product/agent-eval"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"access": "public",
|
|
36
|
+
"registry": "https://registry.npmjs.org/",
|
|
37
|
+
"tag": "candidate"
|
|
38
|
+
},
|
|
39
|
+
"dsh": {
|
|
40
|
+
"engines": {
|
|
41
|
+
"dsh": ">=0.2.1-rc.2"
|
|
42
|
+
},
|
|
43
|
+
"bundle": {
|
|
44
|
+
"patch": "./cordis.patch.yml"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"zod": "4.4.3"
|
|
49
|
+
},
|
|
50
|
+
"peerDependencies": {
|
|
51
|
+
"@deepseek-ai/cordis": "4.0.6-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
|
|
53
|
+
"@deepseek-ai/dsh-brand": "0.2.2-alpha.2",
|
|
54
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.2",
|
|
55
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.2-alpha.2",
|
|
56
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
57
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-alpha.2",
|
|
58
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.2-alpha.2",
|
|
59
|
+
"@deepseek-ai/dsh-agent-default-model": "0.2.2-alpha.2",
|
|
60
|
+
"@gestaltrun/dsh-workspace-bundle": ">=0.1.0",
|
|
61
|
+
"@gestaltrun/dsh-im-runtime": ">=0.1.5 <0.2.0",
|
|
62
|
+
"@gestaltrun/dsh-cs-hosting": ">=0.1.7 <0.2.0",
|
|
63
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-alpha.2",
|
|
64
|
+
"@gestaltrun/dsh-merchant-account": ">=0.1.0-gestaltrun.0",
|
|
65
|
+
"@deepseek-ai/dsh-tool-executor-ptc": "0.2.2-alpha.2"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@deepseek-ai/cordis": "4.0.6-alpha.1",
|
|
69
|
+
"@deepseek-ai/dsh-agent": "0.2.2-alpha.2",
|
|
70
|
+
"@deepseek-ai/dsh-brand": "0.2.2-alpha.2",
|
|
71
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.2",
|
|
72
|
+
"@deepseek-ai/dsh-session-persistence": "0.2.2-alpha.2",
|
|
73
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.2",
|
|
74
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-alpha.2",
|
|
75
|
+
"@gestaltrun/dsh-im-runtime": "^0.1.6",
|
|
76
|
+
"@gestaltrun/dsh-cs-hosting": "^0.1.7",
|
|
77
|
+
"typescript": "6.0.3",
|
|
78
|
+
"vitest": "4.1.8",
|
|
79
|
+
"tsdown": "0.22.2",
|
|
80
|
+
"@types/node": "22.20.0",
|
|
81
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-alpha.2",
|
|
82
|
+
"@deepseek-ai/cordis-plugin-include": "1.0.11-alpha.1",
|
|
83
|
+
"@deepseek-ai/cordis-plugin-loader": "1.0.7-alpha.1",
|
|
84
|
+
"@deepseek-ai/dsh-agent-loop": "0.2.2-alpha.2",
|
|
85
|
+
"@deepseek-ai/dsh-agent-loop-testkit": "0.2.2-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-agent-default-model": "0.2.2-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-credentials-local": "0.2.2-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-storage": "0.2.2-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.2-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-storage-json": "0.2.2-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-session-persistence-jsonl": "0.2.2-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-skill": "0.2.2-alpha.2",
|
|
93
|
+
"@gestaltrun/dsh-workspace-bundle": "^0.1.1",
|
|
94
|
+
"js-yaml": "4.2.0",
|
|
95
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.2-alpha.2",
|
|
96
|
+
"@gestaltrun/dsh-merchant-account": "^0.1.5",
|
|
97
|
+
"@deepseek-ai/cordis-plugin-group": "1.0.6-alpha.1",
|
|
98
|
+
"@deepseek-ai/dsh-ptc-runtime-node": "0.2.2-alpha.2",
|
|
99
|
+
"@deepseek-ai/dsh-sandbox-local": "0.2.2-alpha.2",
|
|
100
|
+
"@deepseek-ai/dsh-tool-executor-ptc": "0.2.2-alpha.2"
|
|
101
|
+
},
|
|
102
|
+
"scripts": {
|
|
103
|
+
"build": "node -e \"require('node:fs').rmSync('lib', { recursive: true, force: true })\" && tsc -p tsconfig.build.json && tsdown",
|
|
104
|
+
"typecheck": "tsc --noEmit && tsc -p tsconfig.test.json --noEmit",
|
|
105
|
+
"test": "pnpm run test:source && pnpm run test:built",
|
|
106
|
+
"test:built": "vitest run --config vitest.built.config.ts",
|
|
107
|
+
"test:source": "node --test tests/bundle.test.mjs ../cs-hosting/tests/fixture-start.test.mjs && vitest run"
|
|
108
|
+
}
|
|
6
109
|
}
|