@withgateway/sdk 0.2.4 → 0.2.6
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/cli.js +4304 -2381
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +4266 -2343
- package/dist/cli.mjs.map +1 -1
- package/dist/files/index.js +56 -31
- package/dist/files/index.js.map +1 -1
- package/dist/files/index.mjs +52 -27
- package/dist/files/index.mjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +280 -8
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +272 -8
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-1xnxt0Cc.d.ts → index-BO2SNSgy.d.ts} +12 -1
- package/dist/{index-B0R3IgsV.d.mts → index-BaKu5ZSU.d.mts} +124 -2
- package/dist/{index-B0R3IgsV.d.ts → index-BaKu5ZSU.d.ts} +124 -2
- package/dist/{index-C1wDEwH4.d.mts → index-Cz8Q6Keo.d.mts} +12 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1100 -438
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1079 -424
- package/dist/index.mjs.map +1 -1
- package/dist/traces/index.js +45 -20
- package/dist/traces/index.js.map +1 -1
- package/dist/traces/index.mjs +41 -16
- package/dist/traces/index.mjs.map +1 -1
- package/dist/tracing/index.d.mts +1 -1
- package/dist/tracing/index.d.ts +1 -1
- package/dist/tracing/index.js +98 -61
- package/dist/tracing/index.js.map +1 -1
- package/dist/tracing/index.mjs +98 -61
- package/dist/tracing/index.mjs.map +1 -1
- package/dist/worlds/index.d.mts +179 -25
- package/dist/worlds/index.d.ts +179 -25
- package/dist/worlds/index.js +639 -284
- package/dist/worlds/index.js.map +1 -1
- package/dist/worlds/index.mjs +631 -276
- package/dist/worlds/index.mjs.map +1 -1
- package/package.json +2 -1
- package/runtime/gatewaysdk/environment/_bundle.py +15 -25
- package/runtime/gatewaysdk/environment/_materialize.py +53 -9
- package/runtime/gatewaysdk/environment/_toml.py +13 -0
- package/runtime/gatewaysdk/environment/schema/api.py +40 -25
- package/runtime/gatewaysdk/environment/schema/batch.py +15 -11
- package/runtime/gatewaysdk/environment/schema/bundle_runtime.py +24 -0
- package/runtime/gatewaysdk/environment/schema/compiler.py +60 -28
- package/runtime/gatewaysdk/environment/schema/conform.py +1 -1
- package/runtime/gatewaysdk/environment/schema/connector.py +1 -1
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/readers/merge.ingest.toml +25 -0
- package/runtime/gatewaysdk/environment/schema/connectors/google-drive/readers/merge.toml +17 -0
- package/runtime/gatewaysdk/environment/schema/data.py +21 -19
- package/runtime/gatewaysdk/environment/schema/extract.py +1 -5
- package/runtime/gatewaysdk/environment/schema/grading.py +225 -0
- package/runtime/gatewaysdk/environment/schema/host.py +156 -546
- package/runtime/gatewaysdk/environment/schema/host_surfaces.py +1 -5
- package/runtime/gatewaysdk/environment/schema/ingest.py +3 -11
- package/runtime/gatewaysdk/environment/schema/local.py +32 -126
- package/runtime/gatewaysdk/environment/schema/mapping.py +1 -1
- package/runtime/gatewaysdk/environment/schema/platform.py +30 -26
- package/runtime/gatewaysdk/environment/schema/proof.py +237 -0
- package/runtime/gatewaysdk/environment/schema/redaction.py +1 -1
- package/runtime/gatewaysdk/environment/schema/runtime.py +686 -0
- package/runtime/gatewaysdk/environment/schema/scaffold.py +9 -2
- package/runtime/gatewaysdk/environment/schema/skill.py +1 -0
- package/runtime/gatewaysdk/environment/schema/skills/benchmarks-getting-started/SKILL.md +67 -9
- package/runtime/gatewaysdk/environment/schema/skills/hooks-getting-started/SKILL.md +67 -6
- package/runtime/gatewaysdk/environment/schema/skills/world-data-ingestion/SKILL.md +4 -1
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/SKILL.md +11 -11
- package/runtime/gatewaysdk/environment/schema/skills/worlds-getting-started/references/cli-mcp-map.md +17 -1
- package/runtime/gatewaysdk/environment/schema/snapshot.py +1 -5
- package/runtime/gatewaysdk/environment/schema/tools_world.py +71 -23
- package/runtime/gatewaysdk/environment/schema/ui.py +1 -5
- package/runtime/gatewaysdk/environment/schema/verbs.py +136 -0
- package/runtime/gatewaysdk/environment/schema/workers.py +14 -0
- package/runtime/gatewaysdk/environment/schema/world_tests.py +1 -1
- package/runtime/gatewaysdk/environment/world.py +507 -0
- package/skills/benchmarks-getting-started/SKILL.md +67 -9
- package/skills/connector-schema-authoring/connector-worlds.md +8 -1
- package/skills/connector-schema-authoring/world-schema.md +1 -1
- package/skills/hooks-getting-started/SKILL.md +67 -6
- package/skills/world-data-ingestion/SKILL.md +4 -1
- package/skills/worlds-getting-started/SKILL.md +11 -11
- package/skills/worlds-getting-started/references/cli-mcp-map.md +17 -1
|
@@ -442,6 +442,13 @@ declare function observeAnthropic<T extends object>(client: T): T;
|
|
|
442
442
|
* ├─ GENERATION (that turn's usage + text)
|
|
443
443
|
* └─ TOOL per tool call in the turn
|
|
444
444
|
*
|
|
445
|
+
* An "assistant turn" is one Anthropic API message. The SDK streams that
|
|
446
|
+
* message as several `assistant` events — one per content block (text, then
|
|
447
|
+
* each tool_use), all sharing `message.id` and all repeating the message-level
|
|
448
|
+
* `usage`. Slices of the same message are folded into ONE generation (and one
|
|
449
|
+
* turn in per-turn mode) so usage is counted once and the turn's text and tool
|
|
450
|
+
* calls land on the same span.
|
|
451
|
+
*
|
|
445
452
|
* The TS equivalent of the Python SDK's claude-agent-sdk instrumentor.
|
|
446
453
|
*
|
|
447
454
|
* @example
|
|
@@ -458,7 +465,11 @@ interface ObserveClaudeOptions {
|
|
|
458
465
|
name: string;
|
|
459
466
|
/** Recorded as input.value on the root span → trace-level input. */
|
|
460
467
|
input?: string;
|
|
461
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* Model label for the generation spans when the assistant message does not
|
|
470
|
+
* carry one (`message.message.model` wins when present so cost attribution
|
|
471
|
+
* matches the model that actually answered).
|
|
472
|
+
*/
|
|
462
473
|
model?: string;
|
|
463
474
|
/**
|
|
464
475
|
* Tracer to start spans from. Defaults to the GLOBAL tracer (set up by
|
|
@@ -871,6 +871,108 @@ declare class LiveTools {
|
|
|
871
871
|
private write;
|
|
872
872
|
}
|
|
873
873
|
|
|
874
|
+
type AuditRecord = {
|
|
875
|
+
tool?: string;
|
|
876
|
+
result?: unknown;
|
|
877
|
+
[key: string]: unknown;
|
|
878
|
+
};
|
|
879
|
+
type FieldKinds = Record<string, Record<string, string>>;
|
|
880
|
+
type LegendEntry = {
|
|
881
|
+
kind?: string;
|
|
882
|
+
role?: string;
|
|
883
|
+
real?: string;
|
|
884
|
+
alias?: string;
|
|
885
|
+
};
|
|
886
|
+
/** One real value the audit will look for. */
|
|
887
|
+
declare class Identifier {
|
|
888
|
+
readonly kind: string;
|
|
889
|
+
readonly value: string;
|
|
890
|
+
readonly source: string;
|
|
891
|
+
constructor(kind: string, value: string, source: string);
|
|
892
|
+
get key(): string;
|
|
893
|
+
get prefix(): string;
|
|
894
|
+
}
|
|
895
|
+
/** Where census identifiers come from. `name` is listed under `detectors`; `ignored`
|
|
896
|
+
* are spellings that are never a leak (public values, personas). */
|
|
897
|
+
declare abstract class IdentifierSource {
|
|
898
|
+
abstract readonly name: string;
|
|
899
|
+
abstract collect(raw: readonly AuditRecord[]): Iterable<Identifier>;
|
|
900
|
+
ignored(): Iterable<string>;
|
|
901
|
+
}
|
|
902
|
+
/** The run's legend: private real values are identifiers; public values and every
|
|
903
|
+
* persona spelling are ignored. */
|
|
904
|
+
declare class LegendSource extends IdentifierSource {
|
|
905
|
+
readonly name = "legend";
|
|
906
|
+
private readonly entries;
|
|
907
|
+
constructor(legend: readonly LegendEntry[]);
|
|
908
|
+
collect(): Identifier[];
|
|
909
|
+
ignored(): string[];
|
|
910
|
+
}
|
|
911
|
+
/** Values of fields whose kind is declared: `{tool | "*": {fieldName: kind}}`. */
|
|
912
|
+
declare class FieldSource extends IdentifierSource {
|
|
913
|
+
private readonly fieldKinds;
|
|
914
|
+
readonly name = "fields";
|
|
915
|
+
constructor(fieldKinds: FieldKinds);
|
|
916
|
+
kindsFor(tool: string): Record<string, string>;
|
|
917
|
+
collect(raw: readonly AuditRecord[]): Generator<Identifier>;
|
|
918
|
+
}
|
|
919
|
+
/** Values a pattern finds in the raw text, for the kinds a pattern is safe for. */
|
|
920
|
+
declare class FinderSource extends IdentifierSource {
|
|
921
|
+
readonly name: string;
|
|
922
|
+
private readonly kinds;
|
|
923
|
+
constructor(kinds?: readonly string[]);
|
|
924
|
+
collect(raw: readonly AuditRecord[]): Generator<Identifier>;
|
|
925
|
+
}
|
|
926
|
+
/** The identifiers of one run, from every source in order; the first source to name a
|
|
927
|
+
* value keeps it. */
|
|
928
|
+
declare class IdentifierCensus {
|
|
929
|
+
private readonly sources;
|
|
930
|
+
constructor(sources: readonly IdentifierSource[]);
|
|
931
|
+
get detectors(): string[];
|
|
932
|
+
build(raw: readonly AuditRecord[]): Identifier[];
|
|
933
|
+
}
|
|
934
|
+
type AuditFinding = {
|
|
935
|
+
record: number;
|
|
936
|
+
tool: string;
|
|
937
|
+
kind: string;
|
|
938
|
+
source: string;
|
|
939
|
+
prefix: string;
|
|
940
|
+
};
|
|
941
|
+
type CleanText = {
|
|
942
|
+
record: number;
|
|
943
|
+
tool: string;
|
|
944
|
+
text: string;
|
|
945
|
+
};
|
|
946
|
+
declare class AuditReport {
|
|
947
|
+
readonly findings: AuditFinding[];
|
|
948
|
+
readonly census: Identifier[];
|
|
949
|
+
readonly detectors: string[];
|
|
950
|
+
readonly recordsScanned: number;
|
|
951
|
+
readonly leakedIdentifiers: number;
|
|
952
|
+
private readonly cleanTexts;
|
|
953
|
+
constructor(findings: AuditFinding[], census: Identifier[], detectors: string[], recordsScanned: number, leakedIdentifiers: number, cleanTexts: CleanText[]);
|
|
954
|
+
get ok(): boolean;
|
|
955
|
+
get censusTotal(): number;
|
|
956
|
+
/** The share of census identifiers that did NOT reach the model; 1 for an empty census. */
|
|
957
|
+
get coverage(): number;
|
|
958
|
+
private count;
|
|
959
|
+
/** `size` strings the model saw that nothing flagged, for a person to read. */
|
|
960
|
+
reviewSample(size: number, seed?: number): CleanText[];
|
|
961
|
+
toDict(): Record<string, unknown>;
|
|
962
|
+
}
|
|
963
|
+
/** Compare what the tools returned with what the model was shown. */
|
|
964
|
+
declare class RedactionAudit {
|
|
965
|
+
private readonly census;
|
|
966
|
+
constructor(census: IdentifierCensus);
|
|
967
|
+
/** The standard audit: the run's legend, declared field kinds, pattern finders. */
|
|
968
|
+
static forRun(options: {
|
|
969
|
+
legend?: readonly LegendEntry[];
|
|
970
|
+
fieldKinds?: FieldKinds;
|
|
971
|
+
finderKinds?: readonly string[];
|
|
972
|
+
}): RedactionAudit;
|
|
973
|
+
run(raw: readonly AuditRecord[], shown: readonly AuditRecord[]): AuditReport;
|
|
974
|
+
}
|
|
975
|
+
|
|
874
976
|
/**
|
|
875
977
|
* One run of an agent under hooks: the rules (read once), the run key, the alias
|
|
876
978
|
* map, and the attachments — `wrapTools(tools)` for a name -> async function map
|
|
@@ -1142,6 +1244,10 @@ type index_AliasHandler = AliasHandler;
|
|
|
1142
1244
|
declare const index_AliasHandler: typeof AliasHandler;
|
|
1143
1245
|
type index_AliasMap = AliasMap;
|
|
1144
1246
|
declare const index_AliasMap: typeof AliasMap;
|
|
1247
|
+
type index_AuditFinding = AuditFinding;
|
|
1248
|
+
type index_AuditRecord = AuditRecord;
|
|
1249
|
+
type index_AuditReport = AuditReport;
|
|
1250
|
+
declare const index_AuditReport: typeof AuditReport;
|
|
1145
1251
|
type index_Bound = Bound;
|
|
1146
1252
|
declare const index_CONTEXT_KEY: typeof CONTEXT_KEY;
|
|
1147
1253
|
type index_CallableTool = CallableTool;
|
|
@@ -1155,6 +1261,11 @@ type index_DenyHandler = DenyHandler;
|
|
|
1155
1261
|
declare const index_DenyHandler: typeof DenyHandler;
|
|
1156
1262
|
declare const index_EVENTS: typeof EVENTS;
|
|
1157
1263
|
declare const index_EVENT_ALIASES: typeof EVENT_ALIASES;
|
|
1264
|
+
type index_FieldKinds = FieldKinds;
|
|
1265
|
+
type index_FieldSource = FieldSource;
|
|
1266
|
+
declare const index_FieldSource: typeof FieldSource;
|
|
1267
|
+
type index_FinderSource = FinderSource;
|
|
1268
|
+
declare const index_FinderSource: typeof FinderSource;
|
|
1158
1269
|
type index_Finding = Finding;
|
|
1159
1270
|
type index_FunctionHandler = FunctionHandler;
|
|
1160
1271
|
declare const index_FunctionHandler: typeof FunctionHandler;
|
|
@@ -1187,11 +1298,20 @@ type index_HttpTool = HttpTool;
|
|
|
1187
1298
|
declare const index_HttpTool: typeof HttpTool;
|
|
1188
1299
|
declare const index_INBOUND_KINDS: typeof INBOUND_KINDS;
|
|
1189
1300
|
declare const index_INPUT_TYPES: typeof INPUT_TYPES;
|
|
1301
|
+
type index_Identifier = Identifier;
|
|
1302
|
+
declare const index_Identifier: typeof Identifier;
|
|
1303
|
+
type index_IdentifierCensus = IdentifierCensus;
|
|
1304
|
+
declare const index_IdentifierCensus: typeof IdentifierCensus;
|
|
1305
|
+
type index_IdentifierSource = IdentifierSource;
|
|
1306
|
+
declare const index_IdentifierSource: typeof IdentifierSource;
|
|
1190
1307
|
type index_Identity = Identity;
|
|
1191
1308
|
type index_InboundKind = InboundKind;
|
|
1192
1309
|
type index_JsonSchema = JsonSchema;
|
|
1193
1310
|
declare const index_KINDS: typeof KINDS;
|
|
1311
|
+
type index_LegendEntry = LegendEntry;
|
|
1194
1312
|
type index_LegendRow = LegendRow;
|
|
1313
|
+
type index_LegendSource = LegendSource;
|
|
1314
|
+
declare const index_LegendSource: typeof LegendSource;
|
|
1195
1315
|
type index_LiveConfig = LiveConfig;
|
|
1196
1316
|
type index_LiveTool = LiveTool;
|
|
1197
1317
|
type index_LiveToolError = LiveToolError;
|
|
@@ -1209,6 +1329,8 @@ type index_Recorder = Recorder;
|
|
|
1209
1329
|
declare const index_Recorder: typeof Recorder;
|
|
1210
1330
|
type index_RedactHandler = RedactHandler;
|
|
1211
1331
|
declare const index_RedactHandler: typeof RedactHandler;
|
|
1332
|
+
type index_RedactionAudit = RedactionAudit;
|
|
1333
|
+
declare const index_RedactionAudit: typeof RedactionAudit;
|
|
1212
1334
|
type index_Replay = Replay;
|
|
1213
1335
|
declare const index_Replay: typeof Replay;
|
|
1214
1336
|
type index_RequestFn = RequestFn;
|
|
@@ -1273,7 +1395,7 @@ declare const index_vendorOf: typeof vendorOf;
|
|
|
1273
1395
|
declare const index_withContext: typeof withContext;
|
|
1274
1396
|
declare const index_withDefaults: typeof withDefaults;
|
|
1275
1397
|
declare namespace index {
|
|
1276
|
-
export { type index_Alias as Alias, index_AliasHandler as AliasHandler, index_AliasMap as AliasMap, type index_Bound as Bound, index_CONTEXT_KEY as CONTEXT_KEY, index_CallableTool as CallableTool, index_CommandHandler as CommandHandler, index_ConnectorTool as ConnectorTool, type index_Decision as Decision, index_DenyHandler as DenyHandler, index_EVENTS as EVENTS, index_EVENT_ALIASES as EVENT_ALIASES, type index_Finding as Finding, index_FunctionHandler as FunctionHandler, index_HANDLER_TYPES as HANDLER_TYPES, type index_Handler as Handler, type index_HandlerFn as HandlerFn, type index_HandlerSpec as HandlerSpec, type index_HandlerType as HandlerType, type index_HookConfig as HookConfig, index_HookConfigError as HookConfigError, index_HookDenied as HookDenied, index_HookError as HookError, type index_HookEvent as HookEvent, type index_HookEventName as HookEventName, type index_HookRequest as HookRequest, type index_HookResponse as HookResponse, type index_HookResult as HookResult, type index_HookRule as HookRule, index_HookRun as HookRun, type index_HookRunOptions as HookRunOptions, index_HookedSession as HookedSession, index_HttpHandler as HttpHandler, index_HttpTool as HttpTool, index_INBOUND_KINDS as INBOUND_KINDS, index_INPUT_TYPES as INPUT_TYPES, type index_Identity as Identity, type index_InboundKind as InboundKind, type index_JsonSchema as JsonSchema, index_KINDS as KINDS, type index_LegendRow as LegendRow, type index_LiveConfig as LiveConfig, type index_LiveTool as LiveTool, index_LiveToolError as LiveToolError, index_LiveTools as LiveTools, type index_Matcher as Matcher, index_PARSE_MODES as PARSE_MODES, type index_Pair as Pair, type index_ParseMode as ParseMode, index_RecordHandler as RecordHandler, type index_RecordSink as RecordSink, index_Recorder as Recorder, index_RedactHandler as RedactHandler, index_Replay as Replay, type index_RequestFn as RequestFn, type index_RunVerdict as RunVerdict, type index_SeedEntity as SeedEntity, type index_SeedRow as SeedRow, type index_SessionLike as SessionLike, index_TOOL_KINDS as TOOL_KINDS, type index_ToolFn as ToolFn, type index_ToolFunctions as ToolFunctions, type index_ToolKind as ToolKind, type index_ToolSpec as ToolSpec, type index_WrappedTools as WrappedTools, index_applyLimit as applyLimit, index_applyResult as applyResult, index_buildTool as buildTool, index_canonical as canonical, index_definition as definition, index_describeHandler as describeHandler, index_describeMatcher as describeMatcher, index_describeTool as describeTool, index_emailPairs as emailPairs, index_emptyConfig as emptyConfig, index_emptyLive as emptyLive, index_eventToJson as eventToJson, index_explodeIp as explodeIp, index_findKind as findKind, index_folded as folded, index_genericPairs as genericPairs, index_importCallable as importCallable, index_inputSchema as inputSchema, index_interpolateHeaders as interpolateHeaders, index_interpolatePath as interpolatePath, index_isGlobalIpv4 as isGlobalIpv4, index_jsPattern as jsPattern, index_jsonPath as jsonPath, index_loadHookConfig as loadHookConfig, index_mapFields as mapFields, index_matches as matches, index_mirrorHandle as mirrorHandle, index_namePairs as namePairs, index_newRunKey as newRunKey, index_normalizeEvent as normalizeEvent, index_pageTitle as pageTitle, index_parseHookConfig as parseHookConfig, index_parseJson as parseJson, index_parseMatcher as parseMatcher, index_parseRegex as parseRegex, index_parseStdout as parseStdout, index_parseText as parseText, index_phonePairs as phonePairs, index_pyQuote as pyQuote, index_readConnection as readConnection, index_readable as readable, index_refusalReason as refusalReason, index_render as render, index_resultFromJson as resultFromJson, index_splitTopLevel as splitTopLevel, index_stripTags as stripTags, index_unescapeHtml as unescapeHtml, index_vendorOf as vendorOf, index_withContext as withContext, index_withDefaults as withDefaults };
|
|
1398
|
+
export { type index_Alias as Alias, index_AliasHandler as AliasHandler, index_AliasMap as AliasMap, type index_AuditFinding as AuditFinding, type index_AuditRecord as AuditRecord, index_AuditReport as AuditReport, type index_Bound as Bound, index_CONTEXT_KEY as CONTEXT_KEY, index_CallableTool as CallableTool, index_CommandHandler as CommandHandler, index_ConnectorTool as ConnectorTool, type index_Decision as Decision, index_DenyHandler as DenyHandler, index_EVENTS as EVENTS, index_EVENT_ALIASES as EVENT_ALIASES, type index_FieldKinds as FieldKinds, index_FieldSource as FieldSource, index_FinderSource as FinderSource, type index_Finding as Finding, index_FunctionHandler as FunctionHandler, index_HANDLER_TYPES as HANDLER_TYPES, type index_Handler as Handler, type index_HandlerFn as HandlerFn, type index_HandlerSpec as HandlerSpec, type index_HandlerType as HandlerType, type index_HookConfig as HookConfig, index_HookConfigError as HookConfigError, index_HookDenied as HookDenied, index_HookError as HookError, type index_HookEvent as HookEvent, type index_HookEventName as HookEventName, type index_HookRequest as HookRequest, type index_HookResponse as HookResponse, type index_HookResult as HookResult, type index_HookRule as HookRule, index_HookRun as HookRun, type index_HookRunOptions as HookRunOptions, index_HookedSession as HookedSession, index_HttpHandler as HttpHandler, index_HttpTool as HttpTool, index_INBOUND_KINDS as INBOUND_KINDS, index_INPUT_TYPES as INPUT_TYPES, index_Identifier as Identifier, index_IdentifierCensus as IdentifierCensus, index_IdentifierSource as IdentifierSource, type index_Identity as Identity, type index_InboundKind as InboundKind, type index_JsonSchema as JsonSchema, index_KINDS as KINDS, type index_LegendEntry as LegendEntry, type index_LegendRow as LegendRow, index_LegendSource as LegendSource, type index_LiveConfig as LiveConfig, type index_LiveTool as LiveTool, index_LiveToolError as LiveToolError, index_LiveTools as LiveTools, type index_Matcher as Matcher, index_PARSE_MODES as PARSE_MODES, type index_Pair as Pair, type index_ParseMode as ParseMode, index_RecordHandler as RecordHandler, type index_RecordSink as RecordSink, index_Recorder as Recorder, index_RedactHandler as RedactHandler, index_RedactionAudit as RedactionAudit, index_Replay as Replay, type index_RequestFn as RequestFn, type index_RunVerdict as RunVerdict, type index_SeedEntity as SeedEntity, type index_SeedRow as SeedRow, type index_SessionLike as SessionLike, index_TOOL_KINDS as TOOL_KINDS, type index_ToolFn as ToolFn, type index_ToolFunctions as ToolFunctions, type index_ToolKind as ToolKind, type index_ToolSpec as ToolSpec, type index_WrappedTools as WrappedTools, index_applyLimit as applyLimit, index_applyResult as applyResult, index_buildTool as buildTool, index_canonical as canonical, index_definition as definition, index_describeHandler as describeHandler, index_describeMatcher as describeMatcher, index_describeTool as describeTool, index_emailPairs as emailPairs, index_emptyConfig as emptyConfig, index_emptyLive as emptyLive, index_eventToJson as eventToJson, index_explodeIp as explodeIp, index_findKind as findKind, index_folded as folded, index_genericPairs as genericPairs, index_importCallable as importCallable, index_inputSchema as inputSchema, index_interpolateHeaders as interpolateHeaders, index_interpolatePath as interpolatePath, index_isGlobalIpv4 as isGlobalIpv4, index_jsPattern as jsPattern, index_jsonPath as jsonPath, index_loadHookConfig as loadHookConfig, index_mapFields as mapFields, index_matches as matches, index_mirrorHandle as mirrorHandle, index_namePairs as namePairs, index_newRunKey as newRunKey, index_normalizeEvent as normalizeEvent, index_pageTitle as pageTitle, index_parseHookConfig as parseHookConfig, index_parseJson as parseJson, index_parseMatcher as parseMatcher, index_parseRegex as parseRegex, index_parseStdout as parseStdout, index_parseText as parseText, index_phonePairs as phonePairs, index_pyQuote as pyQuote, index_readConnection as readConnection, index_readable as readable, index_refusalReason as refusalReason, index_render as render, index_resultFromJson as resultFromJson, index_splitTopLevel as splitTopLevel, index_stripTags as stripTags, index_unescapeHtml as unescapeHtml, index_vendorOf as vendorOf, index_withContext as withContext, index_withDefaults as withDefaults };
|
|
1277
1399
|
}
|
|
1278
1400
|
|
|
1279
|
-
export {
|
|
1401
|
+
export { type LiveConfig as $, type Alias as A, type Bound as B, CONTEXT_KEY as C, type Decision as D, EVENTS as E, type FieldKinds as F, type HookResponse as G, HANDLER_TYPES as H, type HookResult as I, type HookRule as J, HookRun as K, type HookRunOptions as L, HookedSession as M, HttpHandler as N, HttpTool as O, INBOUND_KINDS as P, INPUT_TYPES as Q, Identifier as R, IdentifierCensus as S, IdentifierSource as T, type Identity as U, type InboundKind as V, type JsonSchema as W, KINDS as X, type LegendEntry as Y, type LegendRow as Z, LegendSource as _, AliasHandler as a, readConnection as a$, type LiveTool as a0, LiveToolError as a1, LiveTools as a2, type Matcher as a3, PARSE_MODES as a4, type Pair as a5, type ParseMode as a6, RecordHandler as a7, type RecordSink as a8, Recorder as a9, explodeIp as aA, findKind as aB, folded as aC, genericPairs as aD, importCallable as aE, inputSchema as aF, interpolateHeaders as aG, interpolatePath as aH, isGlobalIpv4 as aI, jsPattern as aJ, jsonPath as aK, loadHookConfig as aL, mapFields as aM, matches as aN, mirrorHandle as aO, namePairs as aP, newRunKey as aQ, normalizeEvent as aR, pageTitle as aS, parseHookConfig as aT, parseJson as aU, parseMatcher as aV, parseRegex as aW, parseStdout as aX, parseText as aY, phonePairs as aZ, pyQuote as a_, RedactHandler as aa, RedactionAudit as ab, Replay as ac, type RequestFn as ad, type RunVerdict as ae, type SeedEntity as af, type SeedRow as ag, type SessionLike as ah, TOOL_KINDS as ai, type ToolFn as aj, type ToolFunctions as ak, type ToolKind as al, type ToolSpec as am, type WrappedTools as an, applyLimit as ao, applyResult as ap, buildTool as aq, canonical as ar, definition as as, describeHandler as at, describeMatcher as au, describeTool as av, emailPairs as aw, emptyConfig as ax, emptyLive as ay, eventToJson as az, AliasMap as b, readable as b0, refusalReason as b1, render as b2, resultFromJson as b3, splitTopLevel as b4, stripTags as b5, unescapeHtml as b6, vendorOf as b7, withContext as b8, withDefaults as b9, type AuditFinding as c, type AuditRecord as d, AuditReport as e, CallableTool as f, CommandHandler as g, ConnectorTool as h, index as i, DenyHandler as j, EVENT_ALIASES as k, FieldSource as l, FinderSource as m, type Finding as n, FunctionHandler as o, type Handler as p, type HandlerFn as q, type HandlerSpec as r, type HandlerType as s, type HookConfig as t, HookConfigError as u, HookDenied as v, HookError as w, type HookEvent as x, type HookEventName as y, type HookRequest as z };
|
|
@@ -871,6 +871,108 @@ declare class LiveTools {
|
|
|
871
871
|
private write;
|
|
872
872
|
}
|
|
873
873
|
|
|
874
|
+
type AuditRecord = {
|
|
875
|
+
tool?: string;
|
|
876
|
+
result?: unknown;
|
|
877
|
+
[key: string]: unknown;
|
|
878
|
+
};
|
|
879
|
+
type FieldKinds = Record<string, Record<string, string>>;
|
|
880
|
+
type LegendEntry = {
|
|
881
|
+
kind?: string;
|
|
882
|
+
role?: string;
|
|
883
|
+
real?: string;
|
|
884
|
+
alias?: string;
|
|
885
|
+
};
|
|
886
|
+
/** One real value the audit will look for. */
|
|
887
|
+
declare class Identifier {
|
|
888
|
+
readonly kind: string;
|
|
889
|
+
readonly value: string;
|
|
890
|
+
readonly source: string;
|
|
891
|
+
constructor(kind: string, value: string, source: string);
|
|
892
|
+
get key(): string;
|
|
893
|
+
get prefix(): string;
|
|
894
|
+
}
|
|
895
|
+
/** Where census identifiers come from. `name` is listed under `detectors`; `ignored`
|
|
896
|
+
* are spellings that are never a leak (public values, personas). */
|
|
897
|
+
declare abstract class IdentifierSource {
|
|
898
|
+
abstract readonly name: string;
|
|
899
|
+
abstract collect(raw: readonly AuditRecord[]): Iterable<Identifier>;
|
|
900
|
+
ignored(): Iterable<string>;
|
|
901
|
+
}
|
|
902
|
+
/** The run's legend: private real values are identifiers; public values and every
|
|
903
|
+
* persona spelling are ignored. */
|
|
904
|
+
declare class LegendSource extends IdentifierSource {
|
|
905
|
+
readonly name = "legend";
|
|
906
|
+
private readonly entries;
|
|
907
|
+
constructor(legend: readonly LegendEntry[]);
|
|
908
|
+
collect(): Identifier[];
|
|
909
|
+
ignored(): string[];
|
|
910
|
+
}
|
|
911
|
+
/** Values of fields whose kind is declared: `{tool | "*": {fieldName: kind}}`. */
|
|
912
|
+
declare class FieldSource extends IdentifierSource {
|
|
913
|
+
private readonly fieldKinds;
|
|
914
|
+
readonly name = "fields";
|
|
915
|
+
constructor(fieldKinds: FieldKinds);
|
|
916
|
+
kindsFor(tool: string): Record<string, string>;
|
|
917
|
+
collect(raw: readonly AuditRecord[]): Generator<Identifier>;
|
|
918
|
+
}
|
|
919
|
+
/** Values a pattern finds in the raw text, for the kinds a pattern is safe for. */
|
|
920
|
+
declare class FinderSource extends IdentifierSource {
|
|
921
|
+
readonly name: string;
|
|
922
|
+
private readonly kinds;
|
|
923
|
+
constructor(kinds?: readonly string[]);
|
|
924
|
+
collect(raw: readonly AuditRecord[]): Generator<Identifier>;
|
|
925
|
+
}
|
|
926
|
+
/** The identifiers of one run, from every source in order; the first source to name a
|
|
927
|
+
* value keeps it. */
|
|
928
|
+
declare class IdentifierCensus {
|
|
929
|
+
private readonly sources;
|
|
930
|
+
constructor(sources: readonly IdentifierSource[]);
|
|
931
|
+
get detectors(): string[];
|
|
932
|
+
build(raw: readonly AuditRecord[]): Identifier[];
|
|
933
|
+
}
|
|
934
|
+
type AuditFinding = {
|
|
935
|
+
record: number;
|
|
936
|
+
tool: string;
|
|
937
|
+
kind: string;
|
|
938
|
+
source: string;
|
|
939
|
+
prefix: string;
|
|
940
|
+
};
|
|
941
|
+
type CleanText = {
|
|
942
|
+
record: number;
|
|
943
|
+
tool: string;
|
|
944
|
+
text: string;
|
|
945
|
+
};
|
|
946
|
+
declare class AuditReport {
|
|
947
|
+
readonly findings: AuditFinding[];
|
|
948
|
+
readonly census: Identifier[];
|
|
949
|
+
readonly detectors: string[];
|
|
950
|
+
readonly recordsScanned: number;
|
|
951
|
+
readonly leakedIdentifiers: number;
|
|
952
|
+
private readonly cleanTexts;
|
|
953
|
+
constructor(findings: AuditFinding[], census: Identifier[], detectors: string[], recordsScanned: number, leakedIdentifiers: number, cleanTexts: CleanText[]);
|
|
954
|
+
get ok(): boolean;
|
|
955
|
+
get censusTotal(): number;
|
|
956
|
+
/** The share of census identifiers that did NOT reach the model; 1 for an empty census. */
|
|
957
|
+
get coverage(): number;
|
|
958
|
+
private count;
|
|
959
|
+
/** `size` strings the model saw that nothing flagged, for a person to read. */
|
|
960
|
+
reviewSample(size: number, seed?: number): CleanText[];
|
|
961
|
+
toDict(): Record<string, unknown>;
|
|
962
|
+
}
|
|
963
|
+
/** Compare what the tools returned with what the model was shown. */
|
|
964
|
+
declare class RedactionAudit {
|
|
965
|
+
private readonly census;
|
|
966
|
+
constructor(census: IdentifierCensus);
|
|
967
|
+
/** The standard audit: the run's legend, declared field kinds, pattern finders. */
|
|
968
|
+
static forRun(options: {
|
|
969
|
+
legend?: readonly LegendEntry[];
|
|
970
|
+
fieldKinds?: FieldKinds;
|
|
971
|
+
finderKinds?: readonly string[];
|
|
972
|
+
}): RedactionAudit;
|
|
973
|
+
run(raw: readonly AuditRecord[], shown: readonly AuditRecord[]): AuditReport;
|
|
974
|
+
}
|
|
975
|
+
|
|
874
976
|
/**
|
|
875
977
|
* One run of an agent under hooks: the rules (read once), the run key, the alias
|
|
876
978
|
* map, and the attachments — `wrapTools(tools)` for a name -> async function map
|
|
@@ -1142,6 +1244,10 @@ type index_AliasHandler = AliasHandler;
|
|
|
1142
1244
|
declare const index_AliasHandler: typeof AliasHandler;
|
|
1143
1245
|
type index_AliasMap = AliasMap;
|
|
1144
1246
|
declare const index_AliasMap: typeof AliasMap;
|
|
1247
|
+
type index_AuditFinding = AuditFinding;
|
|
1248
|
+
type index_AuditRecord = AuditRecord;
|
|
1249
|
+
type index_AuditReport = AuditReport;
|
|
1250
|
+
declare const index_AuditReport: typeof AuditReport;
|
|
1145
1251
|
type index_Bound = Bound;
|
|
1146
1252
|
declare const index_CONTEXT_KEY: typeof CONTEXT_KEY;
|
|
1147
1253
|
type index_CallableTool = CallableTool;
|
|
@@ -1155,6 +1261,11 @@ type index_DenyHandler = DenyHandler;
|
|
|
1155
1261
|
declare const index_DenyHandler: typeof DenyHandler;
|
|
1156
1262
|
declare const index_EVENTS: typeof EVENTS;
|
|
1157
1263
|
declare const index_EVENT_ALIASES: typeof EVENT_ALIASES;
|
|
1264
|
+
type index_FieldKinds = FieldKinds;
|
|
1265
|
+
type index_FieldSource = FieldSource;
|
|
1266
|
+
declare const index_FieldSource: typeof FieldSource;
|
|
1267
|
+
type index_FinderSource = FinderSource;
|
|
1268
|
+
declare const index_FinderSource: typeof FinderSource;
|
|
1158
1269
|
type index_Finding = Finding;
|
|
1159
1270
|
type index_FunctionHandler = FunctionHandler;
|
|
1160
1271
|
declare const index_FunctionHandler: typeof FunctionHandler;
|
|
@@ -1187,11 +1298,20 @@ type index_HttpTool = HttpTool;
|
|
|
1187
1298
|
declare const index_HttpTool: typeof HttpTool;
|
|
1188
1299
|
declare const index_INBOUND_KINDS: typeof INBOUND_KINDS;
|
|
1189
1300
|
declare const index_INPUT_TYPES: typeof INPUT_TYPES;
|
|
1301
|
+
type index_Identifier = Identifier;
|
|
1302
|
+
declare const index_Identifier: typeof Identifier;
|
|
1303
|
+
type index_IdentifierCensus = IdentifierCensus;
|
|
1304
|
+
declare const index_IdentifierCensus: typeof IdentifierCensus;
|
|
1305
|
+
type index_IdentifierSource = IdentifierSource;
|
|
1306
|
+
declare const index_IdentifierSource: typeof IdentifierSource;
|
|
1190
1307
|
type index_Identity = Identity;
|
|
1191
1308
|
type index_InboundKind = InboundKind;
|
|
1192
1309
|
type index_JsonSchema = JsonSchema;
|
|
1193
1310
|
declare const index_KINDS: typeof KINDS;
|
|
1311
|
+
type index_LegendEntry = LegendEntry;
|
|
1194
1312
|
type index_LegendRow = LegendRow;
|
|
1313
|
+
type index_LegendSource = LegendSource;
|
|
1314
|
+
declare const index_LegendSource: typeof LegendSource;
|
|
1195
1315
|
type index_LiveConfig = LiveConfig;
|
|
1196
1316
|
type index_LiveTool = LiveTool;
|
|
1197
1317
|
type index_LiveToolError = LiveToolError;
|
|
@@ -1209,6 +1329,8 @@ type index_Recorder = Recorder;
|
|
|
1209
1329
|
declare const index_Recorder: typeof Recorder;
|
|
1210
1330
|
type index_RedactHandler = RedactHandler;
|
|
1211
1331
|
declare const index_RedactHandler: typeof RedactHandler;
|
|
1332
|
+
type index_RedactionAudit = RedactionAudit;
|
|
1333
|
+
declare const index_RedactionAudit: typeof RedactionAudit;
|
|
1212
1334
|
type index_Replay = Replay;
|
|
1213
1335
|
declare const index_Replay: typeof Replay;
|
|
1214
1336
|
type index_RequestFn = RequestFn;
|
|
@@ -1273,7 +1395,7 @@ declare const index_vendorOf: typeof vendorOf;
|
|
|
1273
1395
|
declare const index_withContext: typeof withContext;
|
|
1274
1396
|
declare const index_withDefaults: typeof withDefaults;
|
|
1275
1397
|
declare namespace index {
|
|
1276
|
-
export { type index_Alias as Alias, index_AliasHandler as AliasHandler, index_AliasMap as AliasMap, type index_Bound as Bound, index_CONTEXT_KEY as CONTEXT_KEY, index_CallableTool as CallableTool, index_CommandHandler as CommandHandler, index_ConnectorTool as ConnectorTool, type index_Decision as Decision, index_DenyHandler as DenyHandler, index_EVENTS as EVENTS, index_EVENT_ALIASES as EVENT_ALIASES, type index_Finding as Finding, index_FunctionHandler as FunctionHandler, index_HANDLER_TYPES as HANDLER_TYPES, type index_Handler as Handler, type index_HandlerFn as HandlerFn, type index_HandlerSpec as HandlerSpec, type index_HandlerType as HandlerType, type index_HookConfig as HookConfig, index_HookConfigError as HookConfigError, index_HookDenied as HookDenied, index_HookError as HookError, type index_HookEvent as HookEvent, type index_HookEventName as HookEventName, type index_HookRequest as HookRequest, type index_HookResponse as HookResponse, type index_HookResult as HookResult, type index_HookRule as HookRule, index_HookRun as HookRun, type index_HookRunOptions as HookRunOptions, index_HookedSession as HookedSession, index_HttpHandler as HttpHandler, index_HttpTool as HttpTool, index_INBOUND_KINDS as INBOUND_KINDS, index_INPUT_TYPES as INPUT_TYPES, type index_Identity as Identity, type index_InboundKind as InboundKind, type index_JsonSchema as JsonSchema, index_KINDS as KINDS, type index_LegendRow as LegendRow, type index_LiveConfig as LiveConfig, type index_LiveTool as LiveTool, index_LiveToolError as LiveToolError, index_LiveTools as LiveTools, type index_Matcher as Matcher, index_PARSE_MODES as PARSE_MODES, type index_Pair as Pair, type index_ParseMode as ParseMode, index_RecordHandler as RecordHandler, type index_RecordSink as RecordSink, index_Recorder as Recorder, index_RedactHandler as RedactHandler, index_Replay as Replay, type index_RequestFn as RequestFn, type index_RunVerdict as RunVerdict, type index_SeedEntity as SeedEntity, type index_SeedRow as SeedRow, type index_SessionLike as SessionLike, index_TOOL_KINDS as TOOL_KINDS, type index_ToolFn as ToolFn, type index_ToolFunctions as ToolFunctions, type index_ToolKind as ToolKind, type index_ToolSpec as ToolSpec, type index_WrappedTools as WrappedTools, index_applyLimit as applyLimit, index_applyResult as applyResult, index_buildTool as buildTool, index_canonical as canonical, index_definition as definition, index_describeHandler as describeHandler, index_describeMatcher as describeMatcher, index_describeTool as describeTool, index_emailPairs as emailPairs, index_emptyConfig as emptyConfig, index_emptyLive as emptyLive, index_eventToJson as eventToJson, index_explodeIp as explodeIp, index_findKind as findKind, index_folded as folded, index_genericPairs as genericPairs, index_importCallable as importCallable, index_inputSchema as inputSchema, index_interpolateHeaders as interpolateHeaders, index_interpolatePath as interpolatePath, index_isGlobalIpv4 as isGlobalIpv4, index_jsPattern as jsPattern, index_jsonPath as jsonPath, index_loadHookConfig as loadHookConfig, index_mapFields as mapFields, index_matches as matches, index_mirrorHandle as mirrorHandle, index_namePairs as namePairs, index_newRunKey as newRunKey, index_normalizeEvent as normalizeEvent, index_pageTitle as pageTitle, index_parseHookConfig as parseHookConfig, index_parseJson as parseJson, index_parseMatcher as parseMatcher, index_parseRegex as parseRegex, index_parseStdout as parseStdout, index_parseText as parseText, index_phonePairs as phonePairs, index_pyQuote as pyQuote, index_readConnection as readConnection, index_readable as readable, index_refusalReason as refusalReason, index_render as render, index_resultFromJson as resultFromJson, index_splitTopLevel as splitTopLevel, index_stripTags as stripTags, index_unescapeHtml as unescapeHtml, index_vendorOf as vendorOf, index_withContext as withContext, index_withDefaults as withDefaults };
|
|
1398
|
+
export { type index_Alias as Alias, index_AliasHandler as AliasHandler, index_AliasMap as AliasMap, type index_AuditFinding as AuditFinding, type index_AuditRecord as AuditRecord, index_AuditReport as AuditReport, type index_Bound as Bound, index_CONTEXT_KEY as CONTEXT_KEY, index_CallableTool as CallableTool, index_CommandHandler as CommandHandler, index_ConnectorTool as ConnectorTool, type index_Decision as Decision, index_DenyHandler as DenyHandler, index_EVENTS as EVENTS, index_EVENT_ALIASES as EVENT_ALIASES, type index_FieldKinds as FieldKinds, index_FieldSource as FieldSource, index_FinderSource as FinderSource, type index_Finding as Finding, index_FunctionHandler as FunctionHandler, index_HANDLER_TYPES as HANDLER_TYPES, type index_Handler as Handler, type index_HandlerFn as HandlerFn, type index_HandlerSpec as HandlerSpec, type index_HandlerType as HandlerType, type index_HookConfig as HookConfig, index_HookConfigError as HookConfigError, index_HookDenied as HookDenied, index_HookError as HookError, type index_HookEvent as HookEvent, type index_HookEventName as HookEventName, type index_HookRequest as HookRequest, type index_HookResponse as HookResponse, type index_HookResult as HookResult, type index_HookRule as HookRule, index_HookRun as HookRun, type index_HookRunOptions as HookRunOptions, index_HookedSession as HookedSession, index_HttpHandler as HttpHandler, index_HttpTool as HttpTool, index_INBOUND_KINDS as INBOUND_KINDS, index_INPUT_TYPES as INPUT_TYPES, index_Identifier as Identifier, index_IdentifierCensus as IdentifierCensus, index_IdentifierSource as IdentifierSource, type index_Identity as Identity, type index_InboundKind as InboundKind, type index_JsonSchema as JsonSchema, index_KINDS as KINDS, type index_LegendEntry as LegendEntry, type index_LegendRow as LegendRow, index_LegendSource as LegendSource, type index_LiveConfig as LiveConfig, type index_LiveTool as LiveTool, index_LiveToolError as LiveToolError, index_LiveTools as LiveTools, type index_Matcher as Matcher, index_PARSE_MODES as PARSE_MODES, type index_Pair as Pair, type index_ParseMode as ParseMode, index_RecordHandler as RecordHandler, type index_RecordSink as RecordSink, index_Recorder as Recorder, index_RedactHandler as RedactHandler, index_RedactionAudit as RedactionAudit, index_Replay as Replay, type index_RequestFn as RequestFn, type index_RunVerdict as RunVerdict, type index_SeedEntity as SeedEntity, type index_SeedRow as SeedRow, type index_SessionLike as SessionLike, index_TOOL_KINDS as TOOL_KINDS, type index_ToolFn as ToolFn, type index_ToolFunctions as ToolFunctions, type index_ToolKind as ToolKind, type index_ToolSpec as ToolSpec, type index_WrappedTools as WrappedTools, index_applyLimit as applyLimit, index_applyResult as applyResult, index_buildTool as buildTool, index_canonical as canonical, index_definition as definition, index_describeHandler as describeHandler, index_describeMatcher as describeMatcher, index_describeTool as describeTool, index_emailPairs as emailPairs, index_emptyConfig as emptyConfig, index_emptyLive as emptyLive, index_eventToJson as eventToJson, index_explodeIp as explodeIp, index_findKind as findKind, index_folded as folded, index_genericPairs as genericPairs, index_importCallable as importCallable, index_inputSchema as inputSchema, index_interpolateHeaders as interpolateHeaders, index_interpolatePath as interpolatePath, index_isGlobalIpv4 as isGlobalIpv4, index_jsPattern as jsPattern, index_jsonPath as jsonPath, index_loadHookConfig as loadHookConfig, index_mapFields as mapFields, index_matches as matches, index_mirrorHandle as mirrorHandle, index_namePairs as namePairs, index_newRunKey as newRunKey, index_normalizeEvent as normalizeEvent, index_pageTitle as pageTitle, index_parseHookConfig as parseHookConfig, index_parseJson as parseJson, index_parseMatcher as parseMatcher, index_parseRegex as parseRegex, index_parseStdout as parseStdout, index_parseText as parseText, index_phonePairs as phonePairs, index_pyQuote as pyQuote, index_readConnection as readConnection, index_readable as readable, index_refusalReason as refusalReason, index_render as render, index_resultFromJson as resultFromJson, index_splitTopLevel as splitTopLevel, index_stripTags as stripTags, index_unescapeHtml as unescapeHtml, index_vendorOf as vendorOf, index_withContext as withContext, index_withDefaults as withDefaults };
|
|
1277
1399
|
}
|
|
1278
1400
|
|
|
1279
|
-
export {
|
|
1401
|
+
export { type LiveConfig as $, type Alias as A, type Bound as B, CONTEXT_KEY as C, type Decision as D, EVENTS as E, type FieldKinds as F, type HookResponse as G, HANDLER_TYPES as H, type HookResult as I, type HookRule as J, HookRun as K, type HookRunOptions as L, HookedSession as M, HttpHandler as N, HttpTool as O, INBOUND_KINDS as P, INPUT_TYPES as Q, Identifier as R, IdentifierCensus as S, IdentifierSource as T, type Identity as U, type InboundKind as V, type JsonSchema as W, KINDS as X, type LegendEntry as Y, type LegendRow as Z, LegendSource as _, AliasHandler as a, readConnection as a$, type LiveTool as a0, LiveToolError as a1, LiveTools as a2, type Matcher as a3, PARSE_MODES as a4, type Pair as a5, type ParseMode as a6, RecordHandler as a7, type RecordSink as a8, Recorder as a9, explodeIp as aA, findKind as aB, folded as aC, genericPairs as aD, importCallable as aE, inputSchema as aF, interpolateHeaders as aG, interpolatePath as aH, isGlobalIpv4 as aI, jsPattern as aJ, jsonPath as aK, loadHookConfig as aL, mapFields as aM, matches as aN, mirrorHandle as aO, namePairs as aP, newRunKey as aQ, normalizeEvent as aR, pageTitle as aS, parseHookConfig as aT, parseJson as aU, parseMatcher as aV, parseRegex as aW, parseStdout as aX, parseText as aY, phonePairs as aZ, pyQuote as a_, RedactHandler as aa, RedactionAudit as ab, Replay as ac, type RequestFn as ad, type RunVerdict as ae, type SeedEntity as af, type SeedRow as ag, type SessionLike as ah, TOOL_KINDS as ai, type ToolFn as aj, type ToolFunctions as ak, type ToolKind as al, type ToolSpec as am, type WrappedTools as an, applyLimit as ao, applyResult as ap, buildTool as aq, canonical as ar, definition as as, describeHandler as at, describeMatcher as au, describeTool as av, emailPairs as aw, emptyConfig as ax, emptyLive as ay, eventToJson as az, AliasMap as b, readable as b0, refusalReason as b1, render as b2, resultFromJson as b3, splitTopLevel as b4, stripTags as b5, unescapeHtml as b6, vendorOf as b7, withContext as b8, withDefaults as b9, type AuditFinding as c, type AuditRecord as d, AuditReport as e, CallableTool as f, CommandHandler as g, ConnectorTool as h, index as i, DenyHandler as j, EVENT_ALIASES as k, FieldSource as l, FinderSource as m, type Finding as n, FunctionHandler as o, type Handler as p, type HandlerFn as q, type HandlerSpec as r, type HandlerType as s, type HookConfig as t, HookConfigError as u, HookDenied as v, HookError as w, type HookEvent as x, type HookEventName as y, type HookRequest as z };
|
|
@@ -442,6 +442,13 @@ declare function observeAnthropic<T extends object>(client: T): T;
|
|
|
442
442
|
* ├─ GENERATION (that turn's usage + text)
|
|
443
443
|
* └─ TOOL per tool call in the turn
|
|
444
444
|
*
|
|
445
|
+
* An "assistant turn" is one Anthropic API message. The SDK streams that
|
|
446
|
+
* message as several `assistant` events — one per content block (text, then
|
|
447
|
+
* each tool_use), all sharing `message.id` and all repeating the message-level
|
|
448
|
+
* `usage`. Slices of the same message are folded into ONE generation (and one
|
|
449
|
+
* turn in per-turn mode) so usage is counted once and the turn's text and tool
|
|
450
|
+
* calls land on the same span.
|
|
451
|
+
*
|
|
445
452
|
* The TS equivalent of the Python SDK's claude-agent-sdk instrumentor.
|
|
446
453
|
*
|
|
447
454
|
* @example
|
|
@@ -458,7 +465,11 @@ interface ObserveClaudeOptions {
|
|
|
458
465
|
name: string;
|
|
459
466
|
/** Recorded as input.value on the root span → trace-level input. */
|
|
460
467
|
input?: string;
|
|
461
|
-
/**
|
|
468
|
+
/**
|
|
469
|
+
* Model label for the generation spans when the assistant message does not
|
|
470
|
+
* carry one (`message.message.model` wins when present so cost attribution
|
|
471
|
+
* matches the model that actually answered).
|
|
472
|
+
*/
|
|
462
473
|
model?: string;
|
|
463
474
|
/**
|
|
464
475
|
* Tracer to start spans from. Defaults to the GLOBAL tracer (set up by
|
package/dist/index.d.mts
CHANGED
|
@@ -7,12 +7,12 @@ export { GatewayAgentDescriptor, GatewaySecurity, GatewaySecurityConfig, Gateway
|
|
|
7
7
|
export { DEFAULT_TIMEOUT_SECONDS, ENV_GATEWAY_HOST, ENV_GATEWAY_PUBLIC_KEY, ENV_GATEWAY_SECRET_KEY, LoadSessionOptions, SessionLoadError, SessionObservation, SessionRecording, SessionTrace, basicAuthHeader, loadSession, sessionObservationFromApi, sessions } from './sessions/index.mjs';
|
|
8
8
|
export { UserEvent, UserEventOptions, UserProfile, UserProfileError, UserProfileUpdate, UsersClient, UsersClientConfig, UsersClientFromEnvConfig, users } from './users/index.mjs';
|
|
9
9
|
export { AGENT_ID_KEY, SUCCESS_METRIC_NAME_KEY, SUCCESS_SIGNAL_KEY, ScoreDataType, ScoreError, ScoreOptions, ScoresClient, ScoresClientConfig, ScoresClientFromEnvConfig, SuccessOptions, currentTraceId, scores, success } from './scores/index.mjs';
|
|
10
|
-
export { ApiError, BrowserActionEvent, BrowserActionRecorder, BrowserMode, BrowserPage, COMPUTER_USE_SPECS, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, LiveTaskSession, LocalMeta, MigrateWorldOptions, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, RedactMode, RedactPolicy, Redaction, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunTaskOptions, RunTaskSummary, STRIP_PREFIX, SURFACE_KINDS, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, ValidateReport, ValidatedRun, WHITESPACE, WorldBrowser, WorldDependency, WorldDeprecation, WorldDescription, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, attachManifest, attachSession, attachTask, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls,
|
|
10
|
+
export { ApiError, BrowserActionEvent, BrowserActionRecorder, BrowserMode, BrowserPage, COMPUTER_USE_SPECS, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, LiveTaskSession, LocalMeta, MigrateWorldOptions, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RedactMode, RedactPolicy, Redaction, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunTaskOptions, RunTaskSummary, STRIP_PREFIX, SURFACE_KINDS, SandboxChanges, SandboxCheckResult, SandboxCommitResult, SandboxExecResult, SandboxOpened, SandboxSummary, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SlugDeclaration, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, ValidateReport, ValidatedRun, WHITESPACE, WorldBrowser, WorldDependency, WorldDeprecation, WorldDescription, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, ingest, ingestToolCalls, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pushSlug, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runTask, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.mjs';
|
|
11
11
|
export { i as files } from './index-CdbmO4aX.mjs';
|
|
12
12
|
export { i as traces } from './index-CiKWoroJ.mjs';
|
|
13
|
-
export { i as hooks } from './index-
|
|
14
|
-
import { _ as _tracingModule } from './index-
|
|
15
|
-
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-
|
|
13
|
+
export { i as hooks } from './index-BaKu5ZSU.mjs';
|
|
14
|
+
import { _ as _tracingModule } from './index-Cz8Q6Keo.mjs';
|
|
15
|
+
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-Cz8Q6Keo.mjs';
|
|
16
16
|
import 'async_hooks';
|
|
17
17
|
import '@opentelemetry/api';
|
|
18
18
|
import '@opentelemetry/sdk-trace-base';
|
package/dist/index.d.ts
CHANGED
|
@@ -7,12 +7,12 @@ export { GatewayAgentDescriptor, GatewaySecurity, GatewaySecurityConfig, Gateway
|
|
|
7
7
|
export { DEFAULT_TIMEOUT_SECONDS, ENV_GATEWAY_HOST, ENV_GATEWAY_PUBLIC_KEY, ENV_GATEWAY_SECRET_KEY, LoadSessionOptions, SessionLoadError, SessionObservation, SessionRecording, SessionTrace, basicAuthHeader, loadSession, sessionObservationFromApi, sessions } from './sessions/index.js';
|
|
8
8
|
export { UserEvent, UserEventOptions, UserProfile, UserProfileError, UserProfileUpdate, UsersClient, UsersClientConfig, UsersClientFromEnvConfig, users } from './users/index.js';
|
|
9
9
|
export { AGENT_ID_KEY, SUCCESS_METRIC_NAME_KEY, SUCCESS_SIGNAL_KEY, ScoreDataType, ScoreError, ScoreOptions, ScoresClient, ScoresClientConfig, ScoresClientFromEnvConfig, SuccessOptions, currentTraceId, scores, success } from './scores/index.js';
|
|
10
|
-
export { ApiError, BrowserActionEvent, BrowserActionRecorder, BrowserMode, BrowserPage, COMPUTER_USE_SPECS, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, LiveTaskSession, LocalMeta, MigrateWorldOptions, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, RedactMode, RedactPolicy, Redaction, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunTaskOptions, RunTaskSummary, STRIP_PREFIX, SURFACE_KINDS, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, ValidateReport, ValidatedRun, WHITESPACE, WorldBrowser, WorldDependency, WorldDeprecation, WorldDescription, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, attachManifest, attachSession, attachTask, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, getRun, getTask, hashForm, ingest, ingestToolCalls,
|
|
10
|
+
export { ApiError, BrowserActionEvent, BrowserActionRecorder, BrowserMode, BrowserPage, COMPUTER_USE_SPECS, CreateEvaluationOptions, DEFAULT_BRANCH, DEFAULT_VIEWPORT, DispatchedRun, EVENT_BATCH_SIZE, EVENT_FLUSH_INTERVAL_MS, EVENT_MAX_RETRIES, EvalSample, FinalizeEvaluationOptions, GatewayEvalsClient, GradeResult, IngestExplode, IngestFieldSpec, IngestMapping, IngestMode, IngestOptions, IngestRefusal, IngestReport, IngestSource, IngestSourceReport, IngestToolCallsOptions, IngestToolCallsReport, LiveTaskSession, LocalMeta, MigrateWorldOptions, ObservationConversion, ObservationLike, OpenSessionOptions, OpenTaskOptions, ParsedToolCall, Plaintext, PlaywrightBrowserLike, PlaywrightLike, PushSlugConflict, PushSlugResolution, RedactMode, RedactPolicy, Redaction, ResolvedWorldVersion, RunConfigInput, RunConfigSummary, RunProvenance, RunReport, RunTaskOptions, RunTaskSummary, STRIP_PREFIX, SURFACE_KINDS, SandboxChanges, SandboxCheckResult, SandboxCommitResult, SandboxExecResult, SandboxOpened, SandboxSummary, SeedResult, SessionRunReport, SessionRunResult, SessionSurfaces, SlugDeclaration, TRANSFORMS, TaskExport, TaskGrade, TaskManifest, TaskManifestSession, TaskRun, TaskRunResult, TaskSessions, TaskSessionsResponse, TaskWorldSessionState, ToolCallRecord, ToolCallSink, ToolFunctions, Transform, ValidateReport, ValidatedRun, WHITESPACE, WorldBrowser, WorldDependency, WorldDeprecation, WorldDescription, WorldEntity, WorldEntityMapping, WorldField, WorldMigrationRefusal, WorldMigrationReport, WorldQueryAcrossOptions, WorldQueryAcrossResult, WorldQueryCompare, WorldQueryCompareStatus, WorldQueryGroup, WorldQueryOptions, WorldQueryResult, WorldQuerySnapshot, WorldQueryWhere, WorldRelationship, WorldSandboxClient, WorldSession, WorldSessionCall, WorldSessionCallError, WorldSessionState, WorldSessionTask, WorldSessionTimeout, WorldSet, WorldSurfaceKind, WorldSurfaceUnavailable, WorldTask, WorldTaskCheck, WorldTaskDetail, WorldTaskFieldOp, WorldTaskGrader, WorldTaskIdRef, WorldTaskInfo, WorldTaskPage, WorldTaskRef, WorldTaskRubricCriterion, WorldTaskRubricGrader, WorldTaskScalar, WorldTaskSeed, WorldTaskSpec, WorldTaskSummary, WorldTaskValidation, WorldTaskVersionSummary, WorldTaskWorld, WorldTaskWorldValidation, WorldToolSpec, WorldToolkit, WorldsClientOptions, aggregateTaskGrade, apiRequest, applyTransforms, archiveMode, attachManifest, attachSession, attachTask, buildFileManifest, buildSourceTarball, captureToolCalls, collectArchiveRelPaths, computeContentHash, computerUseToolkit, createRef, createTask, deleteEnvSecret, deleteTask, describeWorld, detectProvenance, extractBundle, getRun, getTask, hashForm, ingest, ingestToolCalls, isTaskIdRef, isTaskManifest, isTaskSpec, listEnvSecretKeys, listRunConfigs, listTaskSessions, listTasks, localTreeState, migrateProjectWorlds, migrateWorld, modelToolName, openBrowser, openSession, openTask, openWorld, openWorldVersion, parseSlugRef, parseToolCallRecord, parseTransform, parseWorldTaskRefs, preserveForm, propose, pull, push, pushSlug, pyText, queryRows, queryRowsSearch, readLocalMeta, readToolCallRecords, redactActionArgs, redactionOf, resolveBrowserMode, resolvePushSlug, roundForm, runSessions, runTask, schemaFromSignature, sessionToolObservations, setEnvSecret, shapeText, snapshotTreeHashes, storedForms, surfaceKinds, taskLabel, toolCallRecordsIn, toolCallsFromObservations, uiEntryUrl, uiUrl, updateTask, upsertRunConfig, validateTask, validateWorld, waitForRun, withoutUiToken, writeLocalMeta } from './worlds/index.js';
|
|
11
11
|
export { i as files } from './index-CLkMr6VG.js';
|
|
12
12
|
export { i as traces } from './index-BgvvQ3BC.js';
|
|
13
|
-
export { i as hooks } from './index-
|
|
14
|
-
import { _ as _tracingModule } from './index-
|
|
15
|
-
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-
|
|
13
|
+
export { i as hooks } from './index-BaKu5ZSU.js';
|
|
14
|
+
import { _ as _tracingModule } from './index-BO2SNSgy.js';
|
|
15
|
+
export { I as IdentifyOptions, i as identify, r as resolveUserId } from './index-BO2SNSgy.js';
|
|
16
16
|
import 'async_hooks';
|
|
17
17
|
import '@opentelemetry/api';
|
|
18
18
|
import '@opentelemetry/sdk-trace-base';
|