@constal/sdk 6.1.0 → 6.3.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/README.md +4 -1
- package/package.json +1 -1
- package/publish/api.json +12 -1
- package/publish/index.d.ts +127 -14
- package/publish/index.js +131 -22
package/README.md
CHANGED
|
@@ -197,7 +197,10 @@ or dropped start of one whose event did not come from the owner's Session
|
|
|
197
197
|
its Session, or failing there for good, is reported to its sender as a
|
|
198
198
|
`RunReport` with status `refused`. `ctx.await(label, { afterRun: "delivery" })`
|
|
199
199
|
settles when a delivery steers the waiting Run and resolves to `{ seq, eventId }`
|
|
200
|
-
of the steer that woke it; the delivery itself stays in the ledger.
|
|
200
|
+
of the steer that woke it; the delivery itself stays in the ledger. A Run that a
|
|
201
|
+
delivery or a report starts belongs to its sender's end-to-end run, as does a
|
|
202
|
+
Run started through the Constal API from a Run: performance reads a Channel's,
|
|
203
|
+
a schedule's or an API call's Run and every Run it leads to together.
|
|
201
204
|
|
|
202
205
|
Policy decides a view of another Session (`ledger:read`; the pages its cursor
|
|
203
206
|
then reads need no further check) and a delivery to another Session at its
|
package/package.json
CHANGED
package/publish/api.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@constal/sdk",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"exports": [
|
|
5
5
|
"AGENT_UI_DEFAULTS",
|
|
6
6
|
"Action",
|
|
@@ -134,6 +134,7 @@
|
|
|
134
134
|
"CredentialMintRequest",
|
|
135
135
|
"CredentialMintResult",
|
|
136
136
|
"CredentialProviderCRN",
|
|
137
|
+
"CredentialProviderConfigEgressBinding",
|
|
137
138
|
"CredentialProviderContext",
|
|
138
139
|
"CredentialProviderCredentialSlotSetup",
|
|
139
140
|
"CredentialProviderDefinition",
|
|
@@ -170,6 +171,11 @@
|
|
|
170
171
|
"EvalMode",
|
|
171
172
|
"EvalSubject",
|
|
172
173
|
"EvalSubjectSource",
|
|
174
|
+
"EvalSuiteCase",
|
|
175
|
+
"EvalSuiteCasePage",
|
|
176
|
+
"EvalSuiteCaseScore",
|
|
177
|
+
"EvalSuiteCaseState",
|
|
178
|
+
"EvalSuiteScoreState",
|
|
173
179
|
"EvaluationAnswer",
|
|
174
180
|
"EvaluationAnswerFor",
|
|
175
181
|
"EvaluationAnswers",
|
|
@@ -188,6 +194,7 @@
|
|
|
188
194
|
"FixedMemoryStoreRef",
|
|
189
195
|
"FixedModelGatewayRef",
|
|
190
196
|
"FoldFn",
|
|
197
|
+
"GENERAL_QUALITY_JUDGE",
|
|
191
198
|
"GateEvidence",
|
|
192
199
|
"GateExhausted",
|
|
193
200
|
"GateResult",
|
|
@@ -235,6 +242,7 @@
|
|
|
235
242
|
"JoinOutcome",
|
|
236
243
|
"JsonScalar",
|
|
237
244
|
"JsonValue",
|
|
245
|
+
"JudgeRubric",
|
|
238
246
|
"LabelRequest",
|
|
239
247
|
"LabelSelector",
|
|
240
248
|
"LabelSelectorOperator",
|
|
@@ -389,6 +397,7 @@
|
|
|
389
397
|
"ScorerApplies",
|
|
390
398
|
"ScorerCRN",
|
|
391
399
|
"ScorerDef",
|
|
400
|
+
"ScorerDraft",
|
|
392
401
|
"ScorerEvaluation",
|
|
393
402
|
"ScorerKind",
|
|
394
403
|
"ScorerRef",
|
|
@@ -576,6 +585,7 @@
|
|
|
576
585
|
"immutableContainerImageReference",
|
|
577
586
|
"integrationEgressPolicy",
|
|
578
587
|
"invocationCredentialUses",
|
|
588
|
+
"judgeAgent",
|
|
579
589
|
"labelSelector",
|
|
580
590
|
"matchesAction",
|
|
581
591
|
"matchesLabelSelector",
|
|
@@ -630,6 +640,7 @@
|
|
|
630
640
|
"scopedCredentialRef",
|
|
631
641
|
"scopedResourceRef",
|
|
632
642
|
"scoreLevel",
|
|
643
|
+
"scorerDraftHash",
|
|
633
644
|
"scorerName",
|
|
634
645
|
"select",
|
|
635
646
|
"selectableResourceLabels",
|
package/publish/index.d.ts
CHANGED
|
@@ -405,7 +405,8 @@ declare function integrationEgressPolicy(value: unknown): IntegrationEgressPolic
|
|
|
405
405
|
|
|
406
406
|
type ScorerKind = "code" | "judge" | "human";
|
|
407
407
|
type ScorerApplies = "turn" | "reply" | "fact" | "trajectory" | "case";
|
|
408
|
-
|
|
408
|
+
/** `recorded` judges each case's captured Run as it ran, without running the Agent. */
|
|
409
|
+
type EvalMode = "fresh" | "replay" | "shadow" | "recorded";
|
|
409
410
|
type VerdictSamplingMode = "gate" | "sample" | "suite" | "label";
|
|
410
411
|
interface ScorerRef {
|
|
411
412
|
crn: ScorerCRN;
|
|
@@ -473,9 +474,10 @@ interface JudgeScorerDefinition {
|
|
|
473
474
|
}
|
|
474
475
|
interface HumanScorerDefinition {
|
|
475
476
|
kind: "human";
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
477
|
+
/** The Channel that also sends each labeling request; null for a Scorer labeled only in the Console Inbox. */
|
|
478
|
+
channel: CRN | null;
|
|
479
|
+
/** Immutable Channel Resource version used to route the labeling wait; null exactly when `channel` is. */
|
|
480
|
+
channelResourceHash: Hash | null;
|
|
479
481
|
schema: object;
|
|
480
482
|
instructionsRef: Ref;
|
|
481
483
|
}
|
|
@@ -488,6 +490,21 @@ interface ScorerDef {
|
|
|
488
490
|
judge?: Omit<JudgeScorerDefinition, "kind">;
|
|
489
491
|
human?: Omit<HumanScorerDefinition, "kind">;
|
|
490
492
|
}
|
|
493
|
+
/** An unsaved code or Judge Scorer: a Scorer definition without its id and version, tested by a recorded Suite. */
|
|
494
|
+
type ScorerDraft = {
|
|
495
|
+
kind: "code";
|
|
496
|
+
applies: ScorerApplies;
|
|
497
|
+
code: Omit<CodeScorerDefinition, "kind">;
|
|
498
|
+
} | {
|
|
499
|
+
kind: "judge";
|
|
500
|
+
applies: ScorerApplies;
|
|
501
|
+
judge: Omit<JudgeScorerDefinition, "kind">;
|
|
502
|
+
};
|
|
503
|
+
/**
|
|
504
|
+
* The hash of what a Scorer judges with: its definition without its id and version. A draft's hash equals the hash of the
|
|
505
|
+
* Scorer saved from it, so a saved Scorer can be shown to be the draft that was tested.
|
|
506
|
+
*/
|
|
507
|
+
declare function scorerDraftHash(definition: ScorerDraft | ScorerDef): Promise<Hash>;
|
|
491
508
|
interface CaseRow {
|
|
492
509
|
caseId: string;
|
|
493
510
|
input: unknown;
|
|
@@ -565,6 +582,8 @@ interface LabelRequest {
|
|
|
565
582
|
subject: EvalSubject;
|
|
566
583
|
scorer: ScorerRef;
|
|
567
584
|
value: unknown;
|
|
585
|
+
/** The answer the labeling form started from, recorded with the label: its evidence is then `{ answer, suggested }`. */
|
|
586
|
+
suggested?: unknown;
|
|
568
587
|
}
|
|
569
588
|
interface RequestLabelRequest {
|
|
570
589
|
/** Caller-stable identity used for the durable wait and idempotent verdict. */
|
|
@@ -572,6 +591,8 @@ interface RequestLabelRequest {
|
|
|
572
591
|
source: EvalSubjectSource;
|
|
573
592
|
subject: EvalSubject;
|
|
574
593
|
scorer: ScorerRef;
|
|
594
|
+
/** A schema-valid answer the labeling form starts from, for example a Judge's `{ score, pass }`. */
|
|
595
|
+
suggested?: unknown;
|
|
575
596
|
timeoutMs?: number;
|
|
576
597
|
}
|
|
577
598
|
interface SuiteFact {
|
|
@@ -649,6 +670,43 @@ interface RunSuiteRequest {
|
|
|
649
670
|
judge: ScorerRef;
|
|
650
671
|
tolerance: number;
|
|
651
672
|
};
|
|
673
|
+
/** Recorded-only: an unsaved Scorer judged with the Suite's Scorers and never recorded; not combined with `calibration`. */
|
|
674
|
+
draft?: ScorerDraft;
|
|
675
|
+
}
|
|
676
|
+
type EvalSuiteCaseState = "pending" | "running" | "scoring" | "completed" | "failed";
|
|
677
|
+
type EvalSuiteScoreState = "pending" | "running" | "completed" | "failed";
|
|
678
|
+
/** One Scorer's result on one judged subject of a Suite. */
|
|
679
|
+
interface EvalSuiteCaseScore {
|
|
680
|
+
/** The saved Scorer's CRN, or `draft:<scorerDraftHash>` for the Suite's draft. */
|
|
681
|
+
scorer: ScorerCRN | `draft:${Hash}`;
|
|
682
|
+
status: EvalSuiteScoreState;
|
|
683
|
+
evaluation: ScorerEvaluation | null;
|
|
684
|
+
error: {
|
|
685
|
+
code: string;
|
|
686
|
+
message: string;
|
|
687
|
+
} | null;
|
|
688
|
+
}
|
|
689
|
+
/** One judged subject of a Suite: a case, or one turn of a recorded Suite's case, and each Scorer's result on it. */
|
|
690
|
+
interface EvalSuiteCase {
|
|
691
|
+
/** The case id, or `<caseId>/<turnPos>` for one turn of a recorded case. */
|
|
692
|
+
case: string;
|
|
693
|
+
/** The Run judged: the Suite's own Run of the case, or the captured Run of a recorded case; null before one exists. */
|
|
694
|
+
source: {
|
|
695
|
+
session: string;
|
|
696
|
+
run: string;
|
|
697
|
+
turn: Hash | null;
|
|
698
|
+
} | null;
|
|
699
|
+
status: EvalSuiteCaseState;
|
|
700
|
+
error: {
|
|
701
|
+
code: string;
|
|
702
|
+
message: string;
|
|
703
|
+
} | null;
|
|
704
|
+
scores: EvalSuiteCaseScore[];
|
|
705
|
+
}
|
|
706
|
+
/** A page of a Suite's judged subjects in case order; `next` continues it. */
|
|
707
|
+
interface EvalSuiteCasePage {
|
|
708
|
+
data: EvalSuiteCase[];
|
|
709
|
+
next: string | null;
|
|
652
710
|
}
|
|
653
711
|
interface JudgeCalibration {
|
|
654
712
|
judge: ScorerRef;
|
|
@@ -1098,7 +1156,7 @@ declare function runLabels(input: {
|
|
|
1098
1156
|
tags?: Record<string, string>;
|
|
1099
1157
|
}): Record<string, string>;
|
|
1100
1158
|
|
|
1101
|
-
declare const RESOURCE_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault"];
|
|
1159
|
+
declare const RESOURCE_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system"];
|
|
1102
1160
|
declare const PLATFORM_ADDRESS_KINDS: readonly ["analytics", "role", "principal", "customer", "binding", "session", "run", "ledger", "table", "artifact", "deployment"];
|
|
1103
1161
|
declare const INVOKABLE_KINDS: readonly ["model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault"];
|
|
1104
1162
|
type ResourceKind = typeof RESOURCE_KINDS[number];
|
|
@@ -3935,8 +3993,8 @@ interface ConstalApiError {
|
|
|
3935
3993
|
* management Resource. Keep authorization-only CRN families such as ledger,
|
|
3936
3994
|
* table, and artifact out of this model-facing inventory contract.
|
|
3937
3995
|
*/
|
|
3938
|
-
declare const CONSTAL_API_QUERY_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
3939
|
-
declare const CONSTAL_API_GET_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
3996
|
+
declare const CONSTAL_API_QUERY_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "failure-group", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
3997
|
+
declare const CONSTAL_API_GET_KINDS: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "failure-group", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
3940
3998
|
declare const CONSTAL_API_MODEL_TOOL_DESCRIPTIONS: {
|
|
3941
3999
|
readonly query: "Query authorized Constal objects with bounded pagination and evidence. Select the exact lower-case singular kind from the schema enum; never pluralize, recase, or substitute an abstract kind. If context supplies platformToolContract.queryScope, copy it unchanged. Otherwise use only an exact namespace allowed by the delegated Run authority, and tenant scope only for an explicitly tenant-wide request. Use catalog-advertised fields and filters; constrained kinds require their advertised filter. Preserve next and evidence completeness.";
|
|
3942
4000
|
readonly get: "Retrieve one exact authorized Constal object or immutable revision. Pass a complete ref unchanged from query, relations, runtime inspection, or a governed receipt; never construct a kind, id, namespace, CRN, hash, or cursor from display text. The schema enum contains every supported addressable kind. For a Run, omit fields for complete diagnosis or request only documented top-level fields, and follow only the returned page cursor.";
|
|
@@ -3992,7 +4050,7 @@ declare const CONSTAL_API_OPERATION_SCHEMAS: {
|
|
|
3992
4050
|
readonly description: "Query one exact catalog kind. Kind ids are lower-case, singular, and must be selected from the enum; abstract names and pluralizations are invalid.";
|
|
3993
4051
|
readonly properties: {
|
|
3994
4052
|
readonly kind: {
|
|
3995
|
-
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
4053
|
+
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "failure-group", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
3996
4054
|
readonly description: "Exact queryable kind. Never guess a kind or change its casing.";
|
|
3997
4055
|
};
|
|
3998
4056
|
readonly scope: {
|
|
@@ -4097,7 +4155,7 @@ declare const CONSTAL_API_OPERATION_SCHEMAS: {
|
|
|
4097
4155
|
readonly additionalProperties: false;
|
|
4098
4156
|
readonly properties: {
|
|
4099
4157
|
readonly kind: {
|
|
4100
|
-
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
4158
|
+
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "failure-group", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
4101
4159
|
readonly description: "Exact lower-case object kind returned by a governed platform result.";
|
|
4102
4160
|
};
|
|
4103
4161
|
readonly id: {
|
|
@@ -4181,7 +4239,7 @@ declare const CONSTAL_API_OPERATION_SCHEMAS: {
|
|
|
4181
4239
|
readonly additionalProperties: false;
|
|
4182
4240
|
readonly properties: {
|
|
4183
4241
|
readonly kind: {
|
|
4184
|
-
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
4242
|
+
readonly enum: readonly ["agent", "channel", "ui", "auth-provider", "policy", "credential-provider", "credential", "tool", "scorer", "dataset", "model", "memory", "cas", "web", "service", "mcp", "db", "browser", "sandbox-pool", "vault", "system", "analytics", "customer", "binding", "session", "run", "deployment", "documentation", "analytics-event", "namespace", "team-member", "team-invite", "api-key", "billing-account", "invoice", "subscription", "resource-contract", "dataset-draft", "dataset-case", "eval-score", "eval-sample", "eval-policy", "eval-suite", "eval-baseline", "eval-schedule", "failure-group", "training-job", "checkpoint", "training-provider", "training-model", "checkpoint-gateway", "credential-provider-package", "credential-consumer", "credential-use", "credential-event", "gateway-package", "rollout", "wait", "run-queue-item"];
|
|
4185
4243
|
readonly description: "Exact lower-case object kind returned by a governed platform result.";
|
|
4186
4244
|
};
|
|
4187
4245
|
readonly id: {
|
|
@@ -5050,6 +5108,12 @@ interface CredentialProviderSetupMetadata {
|
|
|
5050
5108
|
/** Presentation metadata keyed by the provider's declared bootstrap Credential slots. */
|
|
5051
5109
|
credentialSlots?: Record<string, CredentialProviderCredentialSlotSetup>;
|
|
5052
5110
|
}
|
|
5111
|
+
/** An egress rule each install compiles from its config: the exact HTTPS endpoint a top-level config property holds. */
|
|
5112
|
+
interface CredentialProviderConfigEgressBinding {
|
|
5113
|
+
urlProperty: string;
|
|
5114
|
+
operations: string[];
|
|
5115
|
+
methods: string[];
|
|
5116
|
+
}
|
|
5053
5117
|
interface CredentialProviderPackageMetadata {
|
|
5054
5118
|
lifecycleVersion: 3;
|
|
5055
5119
|
displayName: string;
|
|
@@ -5062,20 +5126,30 @@ interface CredentialProviderPackageMetadata {
|
|
|
5062
5126
|
credentialSlots: string[];
|
|
5063
5127
|
/** Non-secret configuration collected separately for each Credential created from this provider. */
|
|
5064
5128
|
credentialConfigSchema: object;
|
|
5065
|
-
/**
|
|
5129
|
+
/**
|
|
5130
|
+
* Interactive acquisition metadata. Null for non-interactive providers. `origins` are fixed when the package is published;
|
|
5131
|
+
* `urlProperty` names the top-level config property whose HTTPS URL's origin each install may send a browser to.
|
|
5132
|
+
*/
|
|
5066
5133
|
interaction: {
|
|
5067
5134
|
origins: string[];
|
|
5135
|
+
} | {
|
|
5136
|
+
urlProperty: string;
|
|
5068
5137
|
} | null;
|
|
5069
5138
|
rotation: CredentialRotationDefaults;
|
|
5070
5139
|
egress: IntegrationEgressPolicy;
|
|
5140
|
+
/** Install-time templates compiled to exact Resource egress rules. */
|
|
5141
|
+
configEgress?: CredentialProviderConfigEgressBinding[];
|
|
5071
5142
|
}
|
|
5072
5143
|
interface CredentialProviderDefinition<C = unknown> extends Omit<CredentialProviderPackageMetadata, "interaction" | "credentialConfigSchema" | "lifecycleVersion"> {
|
|
5073
5144
|
id: string;
|
|
5074
5145
|
version: string;
|
|
5075
5146
|
configSchema: object;
|
|
5076
5147
|
credentialConfigSchema: object;
|
|
5077
|
-
interaction?: {
|
|
5148
|
+
interaction?: ({
|
|
5078
5149
|
origins: string[];
|
|
5150
|
+
} | {
|
|
5151
|
+
urlProperty: string;
|
|
5152
|
+
}) & {
|
|
5079
5153
|
start(request: CredentialInteractionStartRequest, context: IntegrationContext): Promise<CredentialInteractionResult>;
|
|
5080
5154
|
advance(request: CredentialInteractionAdvanceRequest, context: IntegrationContext): Promise<CredentialInteractionResult>;
|
|
5081
5155
|
};
|
|
@@ -5211,6 +5285,45 @@ interface CodeScoreResult {
|
|
|
5211
5285
|
declare function codeScorerIR(value: unknown): CodeScorerIR;
|
|
5212
5286
|
declare function evaluateCodeScorer(raw: CodeScorerIR | unknown, subject: unknown): CodeScoreResult;
|
|
5213
5287
|
|
|
5288
|
+
/**
|
|
5289
|
+
* How a Judge judges a value. `instructions` says what a good value is. With `levels`, at least two and ordered from worst to
|
|
5290
|
+
* best, the Judge places the value on them; without levels it answers how likely the value meets the instructions. Each
|
|
5291
|
+
* dimension is judged the same way, on its own.
|
|
5292
|
+
*/
|
|
5293
|
+
interface JudgeRubric {
|
|
5294
|
+
instructions: EvaluationEntry;
|
|
5295
|
+
levels?: EvaluationEntry[];
|
|
5296
|
+
dimensions?: Record<string, {
|
|
5297
|
+
instructions: EvaluationEntry;
|
|
5298
|
+
levels?: EvaluationEntry[];
|
|
5299
|
+
}>;
|
|
5300
|
+
}
|
|
5301
|
+
/**
|
|
5302
|
+
* The default quality Judge: what a Judge Scorer judges with to measure any Agent's production quality, without knowing the
|
|
5303
|
+
* Agent. It judges a whole Run (its trajectory) on the outcome a person who asked would care about, on a 0 to 1 scale where a
|
|
5304
|
+
* Run passes at 0.5; each dimension's name is the reason a failing Run fails. The platform recognizes a Judge Scorer as the
|
|
5305
|
+
* default quality Judge by its rubric, so create the Scorer with exactly this rubric and pin a `judgeAgent` Agent as its Judge.
|
|
5306
|
+
*/
|
|
5307
|
+
declare const GENERAL_QUALITY_JUDGE: {
|
|
5308
|
+
applies: "trajectory";
|
|
5309
|
+
scale: {
|
|
5310
|
+
min: number;
|
|
5311
|
+
max: number;
|
|
5312
|
+
};
|
|
5313
|
+
threshold: number;
|
|
5314
|
+
rubric: JudgeRubric;
|
|
5315
|
+
};
|
|
5316
|
+
/**
|
|
5317
|
+
* An Agent that judges with an evaluation Model, for a Judge Scorer whose rubric is a JudgeRubric. Bind its `model` to an
|
|
5318
|
+
* evaluation Model, such as `crn:constal:production:platform:default:model/jev`. Each Run evaluates the judged value against
|
|
5319
|
+
* the rubric and returns `{ score, dimensions, evidence }`: the score and each dimension on the Scorer's scale, and the
|
|
5320
|
+
* evaluation's answers as evidence. The Scorer's threshold decides its pass.
|
|
5321
|
+
*/
|
|
5322
|
+
declare function judgeAgent(input: {
|
|
5323
|
+
id: string;
|
|
5324
|
+
version: string;
|
|
5325
|
+
}): AgentDef;
|
|
5326
|
+
|
|
5214
5327
|
declare function validateJsonSchemaDefinition(schema: unknown, path?: string, depth?: number): string | null;
|
|
5215
5328
|
declare function validateJsonSchema(value: unknown, schema: unknown, path?: string): string | null;
|
|
5216
5329
|
|
|
@@ -5347,5 +5460,5 @@ declare function parseLedgerAddress(value: unknown): LedgerAddressParts | null;
|
|
|
5347
5460
|
/** Formats ledger address parts; throws when a part breaks its id rule. */
|
|
5348
5461
|
declare function formatLedgerAddress(parts: LedgerAddressParts): LedgerAddress;
|
|
5349
5462
|
|
|
5350
|
-
export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_EGRESS_LIMITS, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxEgressCredentialRules, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
5351
|
-
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxEgressCredentialRule, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWriteFileResult, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
|
5463
|
+
export { AGENT_UI_DEFAULTS, AfterYield, ApiError, CHAT_FORMAT_CAPABILITY, CONSTAL_API_CAPABILITY, CONSTAL_API_GET_KINDS, CONSTAL_API_MODEL_TOOL_DESCRIPTIONS, CONSTAL_API_OPERATIONS, CONSTAL_API_OPERATION_SCHEMAS, CONSTAL_API_QUERY_KINDS, CONSTAL_API_VERSION, CommitConflict, CommitGateRejected, CredentialRevoked, CredentialUnavailable, DATA_SHARE_FEE_BPS, DirectNetworkDenied, EVALUATION_LIMITS, EffectCeilingExceeded, EmptyJoin, GENERAL_QUALITY_JUDGE, GateExhausted, IntegrationRequestNotSent, LeaseLost, MCP_CLIENT_CAPABILITY, MCP_PROTOCOL_VERSION, MEMORY_OPERATION_DECLARATIONS, MODEL_CHECKPOINT_IMPORT_CAPABILITY, MODEL_COMPLETION_CAPABILITY, MODEL_EVALUATION_CAPABILITY, McpClient, NondeterministicReplay, NotAppendOnly, OutcomeUnknown, PolicyConstraintFailed, PolicyDecisionFailed, RESOURCE_CREDENTIAL_BINDING_SCHEMA, RESOURCE_KINDS, ResourceDisabled, ResourceInvalid, ResourceUnbound, RollbackTargetInvalid, SANDBOX_EGRESS_LIMITS, SessionDeleted, SpawnCardinality, SwallowedYield, TRAINING_PROVIDER_CAPABILITY, TRAINING_RECIPE_DEFAULTS, TerminalIntegrationFailure, ToolUnavailable, UI_ASSET_CONTENT_TYPES, UI_BUNDLE_BOUNDS, UnknownTool, WEB_FETCH_ARGUMENT_SCHEMA, WEB_SEARCH_ARGUMENT_SCHEMA, action, actionPattern, agent, agentLimit, agentResourceBinding, agentSetupMetadata, agentSetupRequirements, agentUiBundleManifest, agentUiDeclaration, all, analyticsEvent, approximateTokens, authProvider, authProviderName, bindingName, bucketFor, canonicalJson, capabilityContractRef, casTool, channel, channelIngressRequest, channelIngressSource, channelSourceEvidence, channelSubscriptionRequest, channelTarget, chatFormat, chatFormatMetadata, chatFormatPin, chatParseInput, chatParsed, chatRenderInput, chatRenderRequest, chatRendering, checkpointArtifactRef, checkpointDeploymentRequest, checkpointImportMetadata, checkpointImportRequest, codeScorerIR, containerImageReference, containerImageSelection, containerImageSource, credentialEvidence, credentialInteractionAction, credentialInteractionEvent, credentialInteractionResult, credentialName, credentialProvider, credentialProviderConfigSchema, credentialProviderName, credentialProviderSetupMetadata, credentialRotationDefaults, credentialSetupState, customerTenantName, cutBatches, cutPartitions, dataShareEarningMicroUsd, datasetName, evaluateCodeScorer, evaluatePolicyDefinition, evaluationArguments, evaluationProtocolRequest, evaluationProtocolResult, formatLedgerAddress, gateway, gatewayModelOffer, gatewayPackageMetadata, hash, hashValue, immutableContainerImageReference, integrationEgressPolicy, invocationCredentialUses, judgeAgent, labelSelector, matchesAction, matchesLabelSelector, matchesResource, mcpToolDescription, mcpToolResult, memoryStoreBinding, modelAdvertisedPricing, modelControls, modelGatewayBinding, modelGatewayEndpoint, modelGenerationOptions, modelLimit, modelMessages, modelPrompt, modelProtocolRequest, modelProtocolResult, murmur3_32, normalizeModelGatewayConfig, normalizeSandboxEgressCredentialRules, normalizeSandboxEgressPolicy, normalizeSandboxLabels, normalizeSandboxNetworkPolicy, normalizeSandboxWorkspacePath, noulDecision, opTool, opTools, parseLedgerAddress, parseResourceName, policy, policyName, race, resolveBindingOwner, resolveContainerImageSource, resolveGatewayEgress, resolveResourceDependencyRef, resourceContractRef, resourceCredentialBinding, resourceDependencyRef, resourceLabelMap, resourceName, resourceNeed, resourcePattern, resourceSelector, resourceTools, runLabels, sandboxControls, sandboxEgressDecision, sandboxEgressHostMatches, sandboxLimit, scopedBindingKey, scopedCredentialRef, scopedResourceRef, scoreLevel, scorerDraftHash, scorerName, select, selectableResourceLabels, setupAwait, setupCredentialReceipt, setupPanelProviderIsCrn, setupScreen, setupScreenView, setupSubmission, sha256Hex, shareContributionRequest, shareContributionReview, shareEvaluation, sharePrices, shareRequest, skills, stageOutput, startTrainingRequest, subtask, tableDescribe, tableQuery, trainingCorrection, trainingProvider, trainingProviderMetadata, trainingRecipe, uiAssetContentType, uiBundle, uiBundleManifest, uiLimit, uiName, validateBatchSpec, validateFoldFn, validateJsonSchema, validateJsonSchemaDefinition, validatePartitionFn, validatePartitionSpec, validateStageOutputSpec, validateTool, validateView, webFetch, webSearch };
|
|
5464
|
+
export type { Action, ActionPattern, Actor, AdmissionLimitConstraint, AdmissionLimitInput, AdmissionLimitScope, AdmissionLimitWindow, Agent, AgentCredentialSetupRequirement, AgentDef, AgentDeployPolicy, AgentGovernanceMeter, AgentSetupMetadata, AgentSetupRequirement, AgentSetupWorkflow, AgentUiDeclaration, AnalyticsClient, AnalyticsDimensionValue, AnalyticsEventDefinition, AnalyticsIntent, AnalyticsValues, AuthProvider, AuthProviderCRN, AuthProviderContext, AuthProviderRequest, AuthProviderResult, AwaitOpts, AwaitPresentation, BatchSpec, BindingCRN, BindingOwnerContext, BindingOwnerScope, BoundOperation, BoundResourceCapabilities, BranchRef, CRN, CRNKind, CanonicalEvent, CanonicalEventDraft, CapabilityContractRef, CapabilityGrant, CapabilityRef, CaptureCaseRequest, CaseRow, CatalogTool, Channel, ChannelContext, ChannelDeliveryError, ChannelDeliveryEvent, ChannelDeliveryOutcome, ChannelDeliveryReport, ChannelFailure, ChannelIngressEvent, ChannelIngressSource, ChannelMessage, ChannelProtocol, ChannelReceiveResult, ChannelRequest, ChannelResponse, ChannelSourceEvidence, ChannelSubscriptionRequest, ChannelTarget, ChatFormatDefinition, ChatFormatMetadata, ChatFormatPin, ChatMessage, ChatParseRequest, ChatParsed, ChatRenderRequest, ChatRendering, ChatSpan, ChatTool, CheckpointDeploymentRequest, CheckpointImportMetadata, CheckpointImportRequest, ChoiceAnswer, ChoiceQuestion, CodeScoreResult, CodeScorerIR, CodeScorerRule, CommitOpts, CompareSuitesRequest, Compensation, ConnectionCancelRequest, ConnectionIdentity, ConnectionOperation, ConnectionRecoveryRequest, ConnectionRecoveryResult, ConnectionRequest, ConnectionUsageReport, ConstalApiApplyRequest, ConstalApiChangePlan, ConstalApiChangePlanRef, ConstalApiChangePlanRequest, ConstalApiChangeReceipt, ConstalApiOperationReceipt, ContainerImageReference, ContainerImageSelection, ContainerImageSource, ContainerRegistryRequest, ContainerRegistryResponse, ControlEvent, Cost, CreateSandboxImageOptions, CreateSandboxOptions, CredentialCRN, CredentialDestroyResult, CredentialEvidence, CredentialInteractionAction, CredentialInteractionAdvanceRequest, CredentialInteractionEvent, CredentialInteractionPrimaryAction, CredentialInteractionProof, CredentialInteractionResult, CredentialInteractionStartRequest, CredentialMaterialRequest, CredentialMintRequest, CredentialMintResult, CredentialProviderCRN, CredentialProviderConfigEgressBinding, CredentialProviderContext, CredentialProviderCredentialSlotSetup, CredentialProviderDefinition, CredentialProviderPackage, CredentialProviderPackageMetadata, CredentialProviderSecretInput, CredentialProviderSetupMetadata, CredentialSetupState, CredentialUninstallRequest, CredentialUninstallResult, CredentialVerifyResult, Ctx, CustomerTenantCRN, DataManifest, DataSharingScope, DatasetCRN, DatasetDraft, DatasetRef, DelegatedGrant, DelegationCeiling, DeliveryMode, DeliveryReceipt, DispatchResult, EffectClass, EvalComparison, EvalDivergence, EvalMode, EvalSubject, EvalSubjectSource, EvalSuiteCase, EvalSuiteCasePage, EvalSuiteCaseScore, EvalSuiteCaseState, EvalSuiteScoreState, EvaluationAnswer, EvaluationAnswerFor, EvaluationAnswers, EvaluationEntry, EvaluationInvocationArgs, EvaluationInvocationResult, EvaluationProtocol, EvaluationQuestion, EvaluationQuestions, EvaluationRecord, EvaluationSpec, EventBase, Fact, FactRef, FileEntry, FixedMemoryStoreRef, FixedModelGatewayRef, FoldFn, GateEvidence, GateResult, GateVerdict, GatewayCancelRequest, GatewayConfigEgressBinding, GatewayContext, GatewayCredentialSlotSetup, GatewayDefinition, GatewayDiscoverySetup, GatewayModelOffer, GatewayOperation, GatewayPackage, GatewayPackageMetadata, GatewayRecoveryRequest, GatewayRecoveryResult, GatewayRequest, GovernanceContractRef, Handle, HandleOutcome, Hash, HistoryPage, HistoryView, HmacVerification, IgnoredChannelEvent, IngressRequest, IngressTarget, IntegrationArtifactEgressRequest, IntegrationArtifactEgressResponse, IntegrationAttachment, IntegrationContext, IntegrationEgressPolicy, IntegrationEgressRequest, IntegrationEgressResponse, IntegrationEgressRule, IntegrationLifecycle, IntegrationReleaseContext, IntegrationSecret, IntegrationState, InvocationCredentialUse, InvocationHandle, InvokableKind, InvokeOpts, JoinOutcome, JsonScalar, JsonValue, JudgeRubric, LabelRequest, LabelSelector, LabelSelectorOperator, LabelSelectorRequirement, LedgerAddress, LedgerAddressParts, LedgerEvent, ListSchedulesOptions, LoadedSkill, LocalResourceRef, ManifestIndexPage, MapFact, MapOpts, McpClientOptions, McpClientState, McpMessageTransport, MemoryDeleteArgs, MemoryGetArgs, MemoryRecord, MemoryRememberArgs, MemorySearchArgs, MemorySearchHit, MemoryStoreBinding, Mode, ModelAdvertisedPricing, ModelCacheHint, ModelCompletion, ModelCredentialHeader, ModelGatewayBinding, ModelGatewayConfig, ModelGatewayProtocol, ModelGenerationOptions, ModelGovernanceControls, ModelGovernanceMeter, ModelHistoryMessage, ModelHistoryToolCall, ModelInvocationArgs, ModelInvocationResult, ModelProtocolRequestOptions, ModelTechnicalCapabilities, ModelTool, NormalizedModelGatewayConfig, NoulAnswer, NoulQuestion, Out, Over, PartitionFn, PartitionSpec, Partitioning, PolicyCRN, PolicyConstraint, PolicyContextValue, PolicyDefinition, PolicyInput, PolicyInvocationOrigin, PolicyOutcome, Principal, PrincipalKind, Provenance, RawModelProtocol, Recovery, ReduceFact, ReduceOpts, Ref, RequestLabelRequest, ResourceContractRef, ResourceControlsConstraint, ResourceCredentialBinding, ResourceDependencyRef, ResourceKind, ResourceName, ResourceNameParts, ResourceNeed, ResourcePattern, ResourceSelector, RollbackReport, RunIdentityView, RunInfo, RunReport, RunStatusDetail, RunSuiteRequest, Sandbox, SandboxCommandCollectionError, SandboxCommandExecution, SandboxCommandResult, SandboxEgressCredentialRule, SandboxEgressPolicy, SandboxEgressRule, SandboxExecInput, SandboxFileResult, SandboxGovernanceControls, SandboxGovernanceMeter, SandboxImage, SandboxLabels, SandboxMutationResult, SandboxNetworkMode, SandboxNetworkPolicy, SandboxPool, SandboxProcess, SandboxProcessCredentials, SandboxProcessIoOperation, SandboxProcessOperation, SandboxProcessReadInput, SandboxProcessReadResult, SandboxProcessStatus, SandboxProcessWriteResult, SandboxReadFileOptions, SandboxReadFileResult, SandboxWorkspace, SandboxWriteFileResult, Schedule, ScheduleCancellation, ScheduleDuration, ScheduleMissed, ScheduleOccurrence, ScheduleOccurrencePage, ScheduleOptions, SchedulePage, ScheduleState, ScheduleTarget, ScheduleTiming, ScheduleTrigger, ScheduleWhen, ScopedBindingKey, ScopedCredentialRef, ScopedMemoryStoreRef, ScopedModelGatewayRef, ScopedResourceRef, ScoreAnswer, ScoreQuestion, ScoreRequest, ScorerApplies, ScorerCRN, ScorerDef, ScorerDraft, ScorerEvaluation, ScorerKind, ScorerRef, ScorerVerdictIntent, SetEvalBaselineRequest, SetupAction, SetupCredentialCandidate, SetupCredentialInteractionPanel, SetupCredentialReceipt, SetupFormPanel, SetupPanel, SetupProgressPanel, SetupReviewPanel, SetupScreen, SetupStepStatus, SetupStepSummary, SetupSubmission, SetupTerminalPanel, SetupWorkflowStatus, Share, ShareAction, ShareContribution, ShareContributionImport, ShareContributionRequest, ShareContributionReview, ShareContributionReviewRequest, ShareContributionStatus, ShareEvaluation, ShareEvaluationPin, ShareEvaluationRequest, ShareEvaluationVerdict, ShareEvaluationView, ShareHistory, SharePrice, ShareRequest, ShareReviewDecision, Skill, SkillDescription, SkillLibrary, SkillSource, SortField, SpawnAttenuation, SpawnBudget, SpawnHandle, SpawnOpts, SqlFold, StageInfo, StageOutputSpec, StartTrainingRequest, SteerEvent, StepJournal, SuiteFact, TableAggregate, TableDescribeArgs, TableFilter, TableFilterOperation, TableOrder, TableQueryArgs, TableQueryPlan, TableQueryResult, TableScalar, TableSnapshotDescription, Task, Tier, Tool, ToolCallRecord, TrainingCorrection, TrainingJobFact, TrainingJobReference, TrainingJobState, TrainingJobStatus, TrainingMethod, TrainingModelOffer, TrainingPreparation, TrainingProviderDefinition, TrainingProviderMetadata, TrainingProviderPin, TrainingRecipe, TrainingResumePoint, TrainingStep, TrainingUsageUnits, TurnDraft, TurnGate, TurnHistoryMessage, TurnRecord, TurnSpec, UiAccess, UiBundle, UiBundleManifest, UiCRN, UiCapability, UiExecution, UiGovernanceMeter, UiHandler, UiResource, UiRuntimeContext, UiSource, UiSqlResult, UiState, UpstreamPayer, Verdict, VerdictSamplingMode, ViewDef, WaitResolvedEvent };
|
package/publish/index.js
CHANGED
|
@@ -81,8 +81,8 @@ function canonicalJson(value) {
|
|
|
81
81
|
if (typeof value === "string") return JSON.stringify(value);
|
|
82
82
|
if (Array.isArray(value)) return `[${value.map(canonicalJson).join(",")}]`;
|
|
83
83
|
if (typeof value === "object") {
|
|
84
|
-
const
|
|
85
|
-
return `{${Object.keys(
|
|
84
|
+
const record14 = value;
|
|
85
|
+
return `{${Object.keys(record14).sort().filter((key) => record14[key] !== void 0).map((key) => `${JSON.stringify(key)}:${canonicalJson(record14[key])}`).join(",")}}`;
|
|
86
86
|
}
|
|
87
87
|
throw new TypeError(`canonical JSON does not support ${typeof value}`);
|
|
88
88
|
}
|
|
@@ -408,21 +408,21 @@ function validateJsonSchema(value, schema, path = "$") {
|
|
|
408
408
|
if (typeof rule.multipleOf === "number" && Math.abs(value / rule.multipleOf - Math.round(value / rule.multipleOf)) > Number.EPSILON * 8) return `${path} is not a multiple`;
|
|
409
409
|
}
|
|
410
410
|
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
411
|
-
const
|
|
412
|
-
for (const key of Array.isArray(rule.required) ? rule.required : []) if (typeof key === "string" && !(key in
|
|
411
|
+
const record14 = value;
|
|
412
|
+
for (const key of Array.isArray(rule.required) ? rule.required : []) if (typeof key === "string" && !(key in record14)) return `${path}.${key} is required`;
|
|
413
413
|
const properties = rule.properties && typeof rule.properties === "object" && !Array.isArray(rule.properties) ? rule.properties : {};
|
|
414
|
-
if (typeof rule.minProperties === "number" && Object.keys(
|
|
415
|
-
if (typeof rule.maxProperties === "number" && Object.keys(
|
|
414
|
+
if (typeof rule.minProperties === "number" && Object.keys(record14).length < rule.minProperties) return `${path} has too few properties`;
|
|
415
|
+
if (typeof rule.maxProperties === "number" && Object.keys(record14).length > rule.maxProperties) return `${path} has too many properties`;
|
|
416
416
|
if (rule.additionalProperties === false) {
|
|
417
|
-
const extra = Object.keys(
|
|
417
|
+
const extra = Object.keys(record14).find((key) => !(key in properties));
|
|
418
418
|
if (extra) return `${path}.${extra} is not allowed`;
|
|
419
419
|
}
|
|
420
|
-
for (const [key, child] of Object.entries(properties)) if (key in
|
|
421
|
-
const error = validateJsonSchema(
|
|
420
|
+
for (const [key, child] of Object.entries(properties)) if (key in record14) {
|
|
421
|
+
const error = validateJsonSchema(record14[key], child, `${path}.${key}`);
|
|
422
422
|
if (error) return error;
|
|
423
423
|
}
|
|
424
|
-
if (rule.additionalProperties && typeof rule.additionalProperties === "object") for (const key of Object.keys(
|
|
425
|
-
const error = validateJsonSchema(
|
|
424
|
+
if (rule.additionalProperties && typeof rule.additionalProperties === "object") for (const key of Object.keys(record14).filter((candidate) => !(candidate in properties))) {
|
|
425
|
+
const error = validateJsonSchema(record14[key], rule.additionalProperties, `${path}.${key}`);
|
|
426
426
|
if (error) return error;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
@@ -568,7 +568,8 @@ var RESOURCE_KINDS = [
|
|
|
568
568
|
"db",
|
|
569
569
|
"browser",
|
|
570
570
|
"sandbox-pool",
|
|
571
|
-
"vault"
|
|
571
|
+
"vault",
|
|
572
|
+
"system"
|
|
572
573
|
];
|
|
573
574
|
var PLATFORM_ADDRESS_KINDS = [
|
|
574
575
|
"analytics",
|
|
@@ -1892,6 +1893,7 @@ var CONSTAL_API_QUERY_KINDS = [
|
|
|
1892
1893
|
"eval-suite",
|
|
1893
1894
|
"eval-baseline",
|
|
1894
1895
|
"eval-schedule",
|
|
1896
|
+
"failure-group",
|
|
1895
1897
|
"training-job",
|
|
1896
1898
|
"checkpoint",
|
|
1897
1899
|
"training-provider",
|
|
@@ -3031,9 +3033,9 @@ function modelHistoryMessages(value) {
|
|
|
3031
3033
|
if (!open2.done) throw new TypeError(`model history Tool call ${open2.value} has no tool message answering it before message ${index}`);
|
|
3032
3034
|
if (source.role === "user" || source.toolCalls === void 0) return { role: source.role, content: source.content };
|
|
3033
3035
|
if (!Array.isArray(source.toolCalls)) throw new TypeError(`${at} toolCalls must be an array`);
|
|
3034
|
-
const toolCalls = source.toolCalls.map((call,
|
|
3036
|
+
const toolCalls = source.toolCalls.map((call, position2) => {
|
|
3035
3037
|
const entry2 = record7(call);
|
|
3036
|
-
if (!entry2 || !nonempty(entry2.id) || !nonempty(entry2.name)) throw new TypeError(`${at} Tool call ${
|
|
3038
|
+
if (!entry2 || !nonempty(entry2.id) || !nonempty(entry2.name)) throw new TypeError(`${at} Tool call ${position2} needs an id and a name`);
|
|
3037
3039
|
if (ids.has(entry2.id)) throw new TypeError(`${at} repeats Tool call id ${entry2.id}`);
|
|
3038
3040
|
try {
|
|
3039
3041
|
canonicalJson(entry2.args);
|
|
@@ -3337,7 +3339,7 @@ function chatMessage(value, index) {
|
|
|
3337
3339
|
if (source.role === "user" && exactKeys3(source, ["role", "content"])) return source;
|
|
3338
3340
|
if (source.role === "tool" && typeof source.toolCallId === "string" && source.toolCallId && (source.isError === void 0 || typeof source.isError === "boolean") && exactKeys3(source, ["role", "toolCallId", "content"], ["isError"])) return source;
|
|
3339
3341
|
if (source.role === "assistant" && exactKeys3(source, ["role", "content"], ["toolCalls", "reasoning"]) && (source.reasoning === void 0 || typeof source.reasoning === "string") && (source.toolCalls === void 0 || Array.isArray(source.toolCalls))) {
|
|
3340
|
-
source.toolCalls?.forEach((call,
|
|
3342
|
+
source.toolCalls?.forEach((call, position2) => toolCall(call, `${field2} Tool call ${position2}`));
|
|
3341
3343
|
return source;
|
|
3342
3344
|
}
|
|
3343
3345
|
throw new TypeError(`${field2} is invalid`);
|
|
@@ -3353,8 +3355,8 @@ function chatRenderInput(value) {
|
|
|
3353
3355
|
if (!tool || typeof tool.name !== "string" || !tool.name || typeof tool.description !== "string" || !record8(tool.schema) || !jsonValue(tool.schema) || !exactKeys3(tool, ["name", "description", "schema"])) throw new TypeError(`chat Tool ${index} is invalid`);
|
|
3354
3356
|
});
|
|
3355
3357
|
if (source.toolChoice === "required" && source.tools.length === 0) throw new TypeError("required Tool choice needs at least one offered Tool");
|
|
3356
|
-
source.train.forEach((index,
|
|
3357
|
-
if (!Number.isSafeInteger(index) || index < 0 || index >= messages.length || messages[index].role !== "assistant" ||
|
|
3358
|
+
source.train.forEach((index, position2) => {
|
|
3359
|
+
if (!Number.isSafeInteger(index) || index < 0 || index >= messages.length || messages[index].role !== "assistant" || position2 > 0 && index <= source.train[position2 - 1]) {
|
|
3358
3360
|
throw new TypeError("chat render request trains only assistant messages, in ascending order");
|
|
3359
3361
|
}
|
|
3360
3362
|
});
|
|
@@ -4235,6 +4237,22 @@ function credentialProviderConfigSchema(value) {
|
|
|
4235
4237
|
function interactionRecord(value) {
|
|
4236
4238
|
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4237
4239
|
}
|
|
4240
|
+
var CONFIG_PROPERTY = /^[A-Za-z][A-Za-z0-9._-]{0,127}$/u;
|
|
4241
|
+
function credentialProviderConfigEgress(value) {
|
|
4242
|
+
if (value === void 0) return [];
|
|
4243
|
+
if (!Array.isArray(value)) throw new TypeError("credential provider config egress is invalid");
|
|
4244
|
+
return value.map((raw) => {
|
|
4245
|
+
const item = interactionRecord(raw);
|
|
4246
|
+
if (!item || !CONFIG_PROPERTY.test(String(item.urlProperty ?? "")) || !Array.isArray(item.operations) || item.operations.length === 0 || item.operations.some((operation) => typeof operation !== "string" || operation !== "*" && !/^[A-Za-z][A-Za-z0-9._-]{0,127}$/u.test(operation)) || !Array.isArray(item.methods) || item.methods.length === 0 || item.methods.some((method) => typeof method !== "string" || !/^(?:GET|POST|PUT|PATCH|DELETE)$/u.test(method)) || Object.keys(item).some((key) => !["urlProperty", "operations", "methods"].includes(key))) {
|
|
4247
|
+
throw new TypeError("credential provider config egress is invalid");
|
|
4248
|
+
}
|
|
4249
|
+
return {
|
|
4250
|
+
urlProperty: String(item.urlProperty),
|
|
4251
|
+
operations: [...new Set(item.operations)],
|
|
4252
|
+
methods: [...new Set(item.methods)]
|
|
4253
|
+
};
|
|
4254
|
+
});
|
|
4255
|
+
}
|
|
4238
4256
|
function exactKeys4(value, allowed) {
|
|
4239
4257
|
return Object.keys(value).every((key) => allowed.includes(key));
|
|
4240
4258
|
}
|
|
@@ -4407,7 +4425,7 @@ function credentialProvider(definition) {
|
|
|
4407
4425
|
}
|
|
4408
4426
|
const setup = credentialProviderSetupMetadata(definition.setup, definition.credentialSlots);
|
|
4409
4427
|
const interaction = definition.interaction ?? null;
|
|
4410
|
-
if (interaction && (!Array.isArray(interaction.origins) || interaction.origins.length === 0 || new Set(interaction.origins).size !== interaction.origins.length || interaction.origins.some((origin) => {
|
|
4428
|
+
if (interaction && ("urlProperty" in interaction ? "origins" in interaction || !CONFIG_PROPERTY.test(String(interaction.urlProperty)) : !Array.isArray(interaction.origins) || interaction.origins.length === 0 || new Set(interaction.origins).size !== interaction.origins.length || interaction.origins.some((origin) => {
|
|
4411
4429
|
try {
|
|
4412
4430
|
const url = new URL(origin);
|
|
4413
4431
|
return url.protocol !== "https:" || url.origin !== origin;
|
|
@@ -4417,6 +4435,17 @@ function credentialProvider(definition) {
|
|
|
4417
4435
|
}))) {
|
|
4418
4436
|
throw new TypeError("credential provider interaction origins are invalid");
|
|
4419
4437
|
}
|
|
4438
|
+
const configEgress = credentialProviderConfigEgress(definition.configEgress);
|
|
4439
|
+
const properties = interactionRecord(definition.configSchema.properties) ?? {};
|
|
4440
|
+
for (const property of [
|
|
4441
|
+
...interaction && "urlProperty" in interaction ? [interaction.urlProperty] : [],
|
|
4442
|
+
...configEgress.map((binding) => binding.urlProperty)
|
|
4443
|
+
]) {
|
|
4444
|
+
const declaration = interactionRecord(properties[property]);
|
|
4445
|
+
if (declaration?.type !== "string" || declaration.format !== "uri") {
|
|
4446
|
+
throw new TypeError(`credential provider config origin property must be a URI string: ${property}`);
|
|
4447
|
+
}
|
|
4448
|
+
}
|
|
4420
4449
|
const mintRecovery = definition.mintRecovery ?? { kind: "idempotency-key" };
|
|
4421
4450
|
if (!["idempotency-key", "outcome-unknown"].includes(mintRecovery.kind)) {
|
|
4422
4451
|
throw new TypeError("credential provider mint recovery is invalid");
|
|
@@ -4432,9 +4461,10 @@ function credentialProvider(definition) {
|
|
|
4432
4461
|
...setup ? { setup } : {},
|
|
4433
4462
|
credentialSlots: [...definition.credentialSlots].sort(),
|
|
4434
4463
|
credentialConfigSchema: definition.credentialConfigSchema,
|
|
4435
|
-
interaction: interaction ? { origins: [...interaction.origins].sort() }
|
|
4464
|
+
interaction: !interaction ? null : "urlProperty" in interaction ? { urlProperty: interaction.urlProperty } : { origins: [...interaction.origins].sort() },
|
|
4436
4465
|
rotation: definition.rotation,
|
|
4437
|
-
egress: integrationEgressPolicy(definition.egress)
|
|
4466
|
+
egress: integrationEgressPolicy(definition.egress),
|
|
4467
|
+
...configEgress.length ? { configEgress } : {}
|
|
4438
4468
|
};
|
|
4439
4469
|
return Object.freeze({ ...definition, mintRecovery, metadata: metadata3 });
|
|
4440
4470
|
}
|
|
@@ -4883,11 +4913,87 @@ function evaluateCodeScorer(raw, subject) {
|
|
|
4883
4913
|
};
|
|
4884
4914
|
}
|
|
4885
4915
|
|
|
4916
|
+
// packages/sdk/src/evals.ts
|
|
4917
|
+
async function scorerDraftHash(definition) {
|
|
4918
|
+
const { id: _id, version: _version, ...draft } = definition;
|
|
4919
|
+
return hash("constal/scorer-draft/v1", draft);
|
|
4920
|
+
}
|
|
4921
|
+
|
|
4922
|
+
// packages/sdk/src/judge.ts
|
|
4923
|
+
var GENERAL_QUALITY_JUDGE = {
|
|
4924
|
+
applies: "trajectory",
|
|
4925
|
+
scale: { min: 0, max: 1 },
|
|
4926
|
+
threshold: 0.5,
|
|
4927
|
+
rubric: {
|
|
4928
|
+
instructions: "You are judging one run of an AI agent: what it was asked (its input) and what it did (its reply, and when shown, its turns and the Tool calls they made with their results). Judge the outcome a person who asked would care about. A good run does what the input asked, gets it right, and makes no mistakes along the way. Any approach that achieves this is good: do not expect particular wording, a particular order of Tool calls, or one way of solving the task. When the input cannot be done as asked, a reply that says so clearly, or asks for what is missing, is good.",
|
|
4929
|
+
dimensions: {
|
|
4930
|
+
"did-what-was-asked": { instructions: "It addressed every part of the request, did not do something else instead, and did not stop before finishing." },
|
|
4931
|
+
correct: { instructions: "Every fact, number and claim in the reply is supported by the input or by what its Tool calls returned; nothing is made up." },
|
|
4932
|
+
"no-mistakes": { instructions: "No Tool call with wrong or invented arguments, no action the request did not call for, and no error it ignored or hid." }
|
|
4933
|
+
}
|
|
4934
|
+
}
|
|
4935
|
+
};
|
|
4936
|
+
function record13(value) {
|
|
4937
|
+
return value && typeof value === "object" && !Array.isArray(value) ? value : null;
|
|
4938
|
+
}
|
|
4939
|
+
function question2(criterion, field2) {
|
|
4940
|
+
const source = record13(criterion);
|
|
4941
|
+
if (!source || source.instructions === void 0 || Object.keys(source).some((key) => key !== "instructions" && key !== "levels") || source.levels !== void 0 && (!Array.isArray(source.levels) || source.levels.length < 2)) {
|
|
4942
|
+
throw new TypeError(`${field2} is { instructions, levels? } with at least two levels`);
|
|
4943
|
+
}
|
|
4944
|
+
const instructions = source.instructions;
|
|
4945
|
+
return source.levels === void 0 ? { type: "noul", instructions } : { type: "score", instructions, criteria: source.levels };
|
|
4946
|
+
}
|
|
4947
|
+
function position(answer2, asked) {
|
|
4948
|
+
if (answer2.type === "noul") return answer2.noul;
|
|
4949
|
+
if (answer2.type === "score" && asked.type === "score") return answer2.score / (asked.criteria.length - 1);
|
|
4950
|
+
throw new TypeError("evaluation answer does not match its rubric question");
|
|
4951
|
+
}
|
|
4952
|
+
function judged(message2) {
|
|
4953
|
+
const body = record13(message2);
|
|
4954
|
+
const state = body?.kind === "eval-judge" ? body.value : body?.task === "evaluate" ? { case: body.case, output: body.output } : void 0;
|
|
4955
|
+
const scale = record13(body?.scale);
|
|
4956
|
+
if (!body || state === void 0 || typeof scale?.min !== "number" || typeof scale.max !== "number" || !Number.isFinite(scale.min) || !Number.isFinite(scale.max) || scale.min >= scale.max) {
|
|
4957
|
+
throw new TypeError('a Judge is given { kind: "eval-judge", rubric, scale, value } or { task: "evaluate", rubric, scale, case, output }');
|
|
4958
|
+
}
|
|
4959
|
+
return { rubric: body.rubric, scale: { min: scale.min, max: scale.max }, state };
|
|
4960
|
+
}
|
|
4961
|
+
function judgeAgent(input) {
|
|
4962
|
+
return agent({
|
|
4963
|
+
id: input.id,
|
|
4964
|
+
version: input.version,
|
|
4965
|
+
async onMessage(message2, ctx) {
|
|
4966
|
+
const { rubric, scale, state } = judged(message2);
|
|
4967
|
+
const source = record13(rubric);
|
|
4968
|
+
const dimensions = source?.dimensions === void 0 ? {} : record13(source.dimensions);
|
|
4969
|
+
if (!source || !dimensions || Object.keys(source).some((key) => !["instructions", "levels", "dimensions"].includes(key))) {
|
|
4970
|
+
throw new TypeError("a Judge rubric is { instructions, levels?, dimensions? }");
|
|
4971
|
+
}
|
|
4972
|
+
const questions = { score: question2({
|
|
4973
|
+
instructions: source.instructions,
|
|
4974
|
+
...source.levels === void 0 ? {} : { levels: source.levels }
|
|
4975
|
+
}, "the rubric") };
|
|
4976
|
+
for (const [name, criterion] of Object.entries(dimensions)) questions[`dimension:${name}`] = question2(criterion, `rubric dimension ${name}`);
|
|
4977
|
+
const { answers, model } = await ctx.evaluate({ state, questions });
|
|
4978
|
+
const onScale = (id2) => Math.min(scale.max, Math.max(
|
|
4979
|
+
scale.min,
|
|
4980
|
+
scale.min + position(answers[id2], questions[id2]) * (scale.max - scale.min)
|
|
4981
|
+
));
|
|
4982
|
+
const names = Object.keys(dimensions);
|
|
4983
|
+
return {
|
|
4984
|
+
score: onScale("score"),
|
|
4985
|
+
dimensions: names.length === 0 ? null : Object.fromEntries(names.map((name) => [name, onScale(`dimension:${name}`)])),
|
|
4986
|
+
evidence: { model, answers }
|
|
4987
|
+
};
|
|
4988
|
+
}
|
|
4989
|
+
});
|
|
4990
|
+
}
|
|
4991
|
+
|
|
4886
4992
|
// packages/sdk/src/errors.ts
|
|
4887
4993
|
var GateExhausted = class extends Error {
|
|
4888
|
-
constructor(
|
|
4994
|
+
constructor(record14) {
|
|
4889
4995
|
super("turn gate exhausted");
|
|
4890
|
-
this.record =
|
|
4996
|
+
this.record = record14;
|
|
4891
4997
|
this.name = "GateExhausted";
|
|
4892
4998
|
}
|
|
4893
4999
|
record;
|
|
@@ -5115,6 +5221,7 @@ export {
|
|
|
5115
5221
|
EVALUATION_LIMITS,
|
|
5116
5222
|
EffectCeilingExceeded,
|
|
5117
5223
|
EmptyJoin,
|
|
5224
|
+
GENERAL_QUALITY_JUDGE,
|
|
5118
5225
|
GateExhausted,
|
|
5119
5226
|
IntegrationRequestNotSent,
|
|
5120
5227
|
LeaseLost,
|
|
@@ -5220,6 +5327,7 @@ export {
|
|
|
5220
5327
|
immutableContainerImageReference,
|
|
5221
5328
|
integrationEgressPolicy,
|
|
5222
5329
|
invocationCredentialUses,
|
|
5330
|
+
judgeAgent,
|
|
5223
5331
|
labelSelector,
|
|
5224
5332
|
matchesAction,
|
|
5225
5333
|
matchesLabelSelector,
|
|
@@ -5274,6 +5382,7 @@ export {
|
|
|
5274
5382
|
scopedCredentialRef,
|
|
5275
5383
|
scopedResourceRef,
|
|
5276
5384
|
scoreLevel,
|
|
5385
|
+
scorerDraftHash,
|
|
5277
5386
|
scorerName,
|
|
5278
5387
|
select,
|
|
5279
5388
|
selectableResourceLabels,
|