@kortyx/agent 0.34.0 → 0.35.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.
@@ -381,7 +381,14 @@ type EvalStepResult = {
381
381
  reason?: string;
382
382
  criteria: EvalCriterionResult[];
383
383
  };
384
+ type EvalRuntimeExecution = {
385
+ sessionId: string;
386
+ runId: string;
387
+ };
384
388
  type EvalCaseResult = {
389
+ /** SDK-owned identity and execution associations for automatic cost attribution. */
390
+ attemptId?: string;
391
+ runtimeExecutions?: EvalRuntimeExecution[];
385
392
  caseId: string;
386
393
  repetition: number;
387
394
  sessionId: string;
@@ -504,8 +511,15 @@ type EvalProgress = {
504
511
  repetition: number;
505
512
  phase: EvalPhase;
506
513
  stepIndex?: number;
514
+ } | {
515
+ type: "case-runtime-associated";
516
+ caseId: string;
517
+ repetition: number;
518
+ attemptId: string;
519
+ execution: EvalRuntimeExecution;
507
520
  } | {
508
521
  type: "case-started";
522
+ attemptId?: string;
509
523
  caseId: string;
510
524
  repetition: number;
511
525
  sessionId: string;
@@ -524,6 +538,11 @@ type EvalRunOptions = {
524
538
  /** Selected identity pinned by the Studio server when enqueuing a run. */
525
539
  judgeIdentity?: EvalJudgeIdentity;
526
540
  suiteId: string;
541
+ /** Execute one scheduled attempt, preserving its original repetition identity. */
542
+ attempt?: {
543
+ caseId: string;
544
+ repetition: number;
545
+ };
527
546
  caseIds?: readonly string[];
528
547
  repetitions?: number;
529
548
  concurrency?: number;
@@ -847,6 +866,11 @@ declare const EvalStepResultSchema: z.ZodObject<{
847
866
  declare const EvalCaseResultSchema: z.ZodObject<{
848
867
  caseId: z.ZodString;
849
868
  repetition: z.ZodNumber;
869
+ attemptId: z.ZodOptional<z.ZodUUID>;
870
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
871
+ sessionId: z.ZodString;
872
+ runId: z.ZodString;
873
+ }, z.core.$strict>>>;
850
874
  sessionId: z.ZodString;
851
875
  status: z.ZodEnum<{
852
876
  error: "error";
@@ -1396,6 +1420,11 @@ declare const EvalRunResultSchema: z.ZodObject<{
1396
1420
  cases: z.ZodArray<z.ZodObject<{
1397
1421
  caseId: z.ZodString;
1398
1422
  repetition: z.ZodNumber;
1423
+ attemptId: z.ZodOptional<z.ZodUUID>;
1424
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1425
+ sessionId: z.ZodString;
1426
+ runId: z.ZodString;
1427
+ }, z.core.$strict>>>;
1399
1428
  sessionId: z.ZodString;
1400
1429
  status: z.ZodEnum<{
1401
1430
  error: "error";
@@ -1584,6 +1613,7 @@ declare const EvalRunResultSchema: z.ZodObject<{
1584
1613
  declare const EvalManifestSchema: z.ZodObject<{
1585
1614
  schemaVersion: z.ZodLiteral<1>;
1586
1615
  studioJudging: z.ZodOptional<z.ZodLiteral<true>>;
1616
+ attemptScheduling: z.ZodOptional<z.ZodLiteral<true>>;
1587
1617
  suites: z.ZodArray<z.ZodObject<{
1588
1618
  evidence: z.ZodOptional<z.ZodObject<{
1589
1619
  history: z.ZodOptional<z.ZodBoolean>;
@@ -1690,6 +1720,15 @@ declare const EvalManifestSchema: z.ZodObject<{
1690
1720
  }, z.core.$strict>>;
1691
1721
  }, z.core.$strict>;
1692
1722
  declare const EvalProgressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1723
+ type: z.ZodLiteral<"case-runtime-associated">;
1724
+ caseId: z.ZodString;
1725
+ repetition: z.ZodNumber;
1726
+ attemptId: z.ZodUUID;
1727
+ execution: z.ZodObject<{
1728
+ sessionId: z.ZodString;
1729
+ runId: z.ZodString;
1730
+ }, z.core.$strict>;
1731
+ }, z.core.$strict>, z.ZodObject<{
1693
1732
  type: z.ZodLiteral<"run-started">;
1694
1733
  caseIds: z.ZodArray<z.ZodString>;
1695
1734
  repetitions: z.ZodNumber;
@@ -1711,6 +1750,7 @@ declare const EvalProgressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1711
1750
  stepIndex: z.ZodOptional<z.ZodNumber>;
1712
1751
  }, z.core.$strict>, z.ZodObject<{
1713
1752
  type: z.ZodLiteral<"case-started">;
1753
+ attemptId: z.ZodOptional<z.ZodUUID>;
1714
1754
  caseId: z.ZodString;
1715
1755
  repetition: z.ZodNumber;
1716
1756
  sessionId: z.ZodString;
@@ -1869,6 +1909,11 @@ declare const EvalProgressSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
1869
1909
  result: z.ZodObject<{
1870
1910
  caseId: z.ZodString;
1871
1911
  repetition: z.ZodNumber;
1912
+ attemptId: z.ZodOptional<z.ZodUUID>;
1913
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
1914
+ sessionId: z.ZodString;
1915
+ runId: z.ZodString;
1916
+ }, z.core.$strict>>>;
1872
1917
  sessionId: z.ZodString;
1873
1918
  status: z.ZodEnum<{
1874
1919
  error: "error";
@@ -2058,6 +2103,11 @@ declare const EvalRemoteRunRequestSchema: z.ZodObject<{
2058
2103
  caseIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
2059
2104
  repetitions: z.ZodDefault<z.ZodNumber>;
2060
2105
  concurrency: z.ZodDefault<z.ZodNumber>;
2106
+ attempt: z.ZodOptional<z.ZodObject<{
2107
+ caseId: z.ZodString;
2108
+ repetition: z.ZodNumber;
2109
+ evaluationId: z.ZodUUID;
2110
+ }, z.core.$strict>>;
2061
2111
  }, z.core.$strict>;
2062
2112
  declare const StudioEvalStartRequestSchema: z.ZodObject<{
2063
2113
  suiteId: z.ZodString;
@@ -2074,6 +2124,15 @@ declare const StudioEvalStartRequestSchema: z.ZodObject<{
2074
2124
  declare const EvalWireEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2075
2125
  type: z.ZodLiteral<"progress">;
2076
2126
  event: z.ZodDiscriminatedUnion<[z.ZodObject<{
2127
+ type: z.ZodLiteral<"case-runtime-associated">;
2128
+ caseId: z.ZodString;
2129
+ repetition: z.ZodNumber;
2130
+ attemptId: z.ZodUUID;
2131
+ execution: z.ZodObject<{
2132
+ sessionId: z.ZodString;
2133
+ runId: z.ZodString;
2134
+ }, z.core.$strict>;
2135
+ }, z.core.$strict>, z.ZodObject<{
2077
2136
  type: z.ZodLiteral<"run-started">;
2078
2137
  caseIds: z.ZodArray<z.ZodString>;
2079
2138
  repetitions: z.ZodNumber;
@@ -2095,6 +2154,7 @@ declare const EvalWireEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2095
2154
  stepIndex: z.ZodOptional<z.ZodNumber>;
2096
2155
  }, z.core.$strict>, z.ZodObject<{
2097
2156
  type: z.ZodLiteral<"case-started">;
2157
+ attemptId: z.ZodOptional<z.ZodUUID>;
2098
2158
  caseId: z.ZodString;
2099
2159
  repetition: z.ZodNumber;
2100
2160
  sessionId: z.ZodString;
@@ -2253,6 +2313,11 @@ declare const EvalWireEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2253
2313
  result: z.ZodObject<{
2254
2314
  caseId: z.ZodString;
2255
2315
  repetition: z.ZodNumber;
2316
+ attemptId: z.ZodOptional<z.ZodUUID>;
2317
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2318
+ sessionId: z.ZodString;
2319
+ runId: z.ZodString;
2320
+ }, z.core.$strict>>>;
2256
2321
  sessionId: z.ZodString;
2257
2322
  status: z.ZodEnum<{
2258
2323
  error: "error";
@@ -2546,6 +2611,11 @@ declare const EvalWireEventSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
2546
2611
  cases: z.ZodArray<z.ZodObject<{
2547
2612
  caseId: z.ZodString;
2548
2613
  repetition: z.ZodNumber;
2614
+ attemptId: z.ZodOptional<z.ZodUUID>;
2615
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
2616
+ sessionId: z.ZodString;
2617
+ runId: z.ZodString;
2618
+ }, z.core.$strict>>>;
2549
2619
  sessionId: z.ZodString;
2550
2620
  status: z.ZodEnum<{
2551
2621
  error: "error";
@@ -3561,6 +3631,11 @@ declare const StudioEvaluationResultsSchema: z.ZodObject<{
3561
3631
  cases: z.ZodArray<z.ZodObject<{
3562
3632
  caseId: z.ZodString;
3563
3633
  repetition: z.ZodNumber;
3634
+ attemptId: z.ZodOptional<z.ZodUUID>;
3635
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
3636
+ sessionId: z.ZodString;
3637
+ runId: z.ZodString;
3638
+ }, z.core.$strict>>>;
3564
3639
  sessionId: z.ZodString;
3565
3640
  status: z.ZodEnum<{
3566
3641
  error: "error";
@@ -3749,6 +3824,15 @@ declare const StudioEvaluationResultsSchema: z.ZodObject<{
3749
3824
  events: z.ZodArray<z.ZodObject<{
3750
3825
  id: z.ZodNumber;
3751
3826
  event: z.ZodDiscriminatedUnion<[z.ZodObject<{
3827
+ type: z.ZodLiteral<"case-runtime-associated">;
3828
+ caseId: z.ZodString;
3829
+ repetition: z.ZodNumber;
3830
+ attemptId: z.ZodUUID;
3831
+ execution: z.ZodObject<{
3832
+ sessionId: z.ZodString;
3833
+ runId: z.ZodString;
3834
+ }, z.core.$strict>;
3835
+ }, z.core.$strict>, z.ZodObject<{
3752
3836
  type: z.ZodLiteral<"run-started">;
3753
3837
  caseIds: z.ZodArray<z.ZodString>;
3754
3838
  repetitions: z.ZodNumber;
@@ -3770,6 +3854,7 @@ declare const StudioEvaluationResultsSchema: z.ZodObject<{
3770
3854
  stepIndex: z.ZodOptional<z.ZodNumber>;
3771
3855
  }, z.core.$strict>, z.ZodObject<{
3772
3856
  type: z.ZodLiteral<"case-started">;
3857
+ attemptId: z.ZodOptional<z.ZodUUID>;
3773
3858
  caseId: z.ZodString;
3774
3859
  repetition: z.ZodNumber;
3775
3860
  sessionId: z.ZodString;
@@ -3928,6 +4013,11 @@ declare const StudioEvaluationResultsSchema: z.ZodObject<{
3928
4013
  result: z.ZodObject<{
3929
4014
  caseId: z.ZodString;
3930
4015
  repetition: z.ZodNumber;
4016
+ attemptId: z.ZodOptional<z.ZodUUID>;
4017
+ runtimeExecutions: z.ZodOptional<z.ZodArray<z.ZodObject<{
4018
+ sessionId: z.ZodString;
4019
+ runId: z.ZodString;
4020
+ }, z.core.$strict>>>;
3931
4021
  sessionId: z.ZodString;
3932
4022
  status: z.ZodEnum<{
3933
4023
  error: "error";
@@ -4115,4 +4205,4 @@ declare function getEvalGradeEvidence(step: EvalStepResult, previous: readonly E
4115
4205
  /** Discover and pin the Studio backend's judge; grading never runs in the browser. */
4116
4206
  declare function createStudioEvalJudge(options: StudioEvalJudgeOptions): Promise<EvalJudge>;
4117
4207
 
4118
- export { type EvalVerdict as $, type EvalJudgeUsage as A, EvalJudgeUsageSchema as B, type CreateEvalsOptions as C, type EvalManifest as D, type EvalCase as E, EvalManifestSchema as F, type EvalObservation as G, EvalObservationSchema as H, type EvalOutputExpectation as I, type EvalOutputSelector as J, type EvalPhase as K, type EvalProgress as L, EvalProgressSchema as M, type EvalRemoteRunRequest as N, EvalRemoteRunRequestSchema as O, type EvalResponder as P, EvalResumeResponseSchema as Q, type EvalRunOptions as R, type EvalRunResult as S, EvalRunResultSchema as T, type EvalSetupContext as U, type EvalStatus as V, type EvalStep as W, type EvalStepResult as X, EvalStepResultSchema as Y, type EvalSuite as Z, EvalSuiteSchema as _, type EvalCaseResult as a, EvalVerdictSchema as a0, type EvalWireEvent as a1, EvalWireEventSchema as a2, EvaluationMetadataSchema as a3, type StudioEvalJudgeOptions as a4, StudioEvalJudgeRequestSchema as a5, StudioEvalJudgeResponseSchema as a6, StudioEvalStartRequestSchema as a7, type StudioEvaluationDetail as a8, StudioEvaluationDetailSchema as a9, type PendingInterrupt as aA, type ResumableInterrupt as aB, type ResumeHandle as aC, type ResumeOptions as aD, type ResumeResponse as aE, createAgent as aF, projectWorkflowTopology as aG, StudioEvaluationHistorySchema as aa, StudioEvaluationResultsSchema as ab, type StudioEvaluationStartRequest as ac, StudioEvaluationStartRequestSchema as ad, type StudioEvaluationSummary as ae, StudioEvaluationSummarySchema as af, createStudioEvalJudge as ag, defineSuite as ah, getEvalGradeEvidence as ai, parseEvalSuite as aj, type ChatLifecyclePhase as ak, ChatLifecycleHookError as al, type Agent as am, type ChatResponseFinalized as an, type AgentProcessOptions as ao, type AgentProjectTopologyOptions as ap, type ChatResponseStatus as aq, type CreateAgentArgs as ar, type ExecutableWorkflow as as, type ExecuteOptions as at, type ExecutionInfo as au, type ExecutionInterrupt as av, ExecutionRequestError as aw, type ExecutionResult as ax, type InterruptScope as ay, type ListInterruptsOptions as az, EvalCaseResultSchema as b, type EvalCommand as c, EvalConfigurationError as d, type EvalContext as e, type EvalCriterion as f, type EvalCriterionResult as g, type EvalDefaults as h, type EvalEvidenceEvent as i, type EvalEvidenceEventType as j, type EvalEvidenceFilters as k, type EvalEvidencePolicy as l, EvalEvidencePolicySchema as m, type EvalExecution as n, type EvalExecutionStatus as o, type EvalExpectation as p, type EvalGradeInput as q, type EvalHandlerRef as r, type EvalInterrupt as s, type EvalIssue as t, type EvalJson as u, type EvalJudge as v, type EvalJudgeEvidence as w, type EvalJudgeIdentity as x, EvalJudgeIdentitySchema as y, type EvalJudgeOptions as z };
4208
+ export { EvalSuiteSchema as $, type EvalJudgeUsage as A, EvalJudgeUsageSchema as B, type CreateEvalsOptions as C, type EvalManifest as D, type EvalCase as E, EvalManifestSchema as F, type EvalObservation as G, EvalObservationSchema as H, type EvalOutputExpectation as I, type EvalOutputSelector as J, type EvalPhase as K, type EvalProgress as L, EvalProgressSchema as M, type EvalRemoteRunRequest as N, EvalRemoteRunRequestSchema as O, type EvalResponder as P, EvalResumeResponseSchema as Q, type EvalRunOptions as R, type EvalRunResult as S, EvalRunResultSchema as T, type EvalRuntimeExecution as U, type EvalSetupContext as V, type EvalStatus as W, type EvalStep as X, type EvalStepResult as Y, EvalStepResultSchema as Z, type EvalSuite as _, type EvalCaseResult as a, type EvalVerdict as a0, EvalVerdictSchema as a1, type EvalWireEvent as a2, EvalWireEventSchema as a3, EvaluationMetadataSchema as a4, type StudioEvalJudgeOptions as a5, StudioEvalJudgeRequestSchema as a6, StudioEvalJudgeResponseSchema as a7, StudioEvalStartRequestSchema as a8, type StudioEvaluationDetail as a9, type ListInterruptsOptions as aA, type PendingInterrupt as aB, type ResumableInterrupt as aC, type ResumeHandle as aD, type ResumeOptions as aE, type ResumeResponse as aF, createAgent as aG, projectWorkflowTopology as aH, StudioEvaluationDetailSchema as aa, StudioEvaluationHistorySchema as ab, StudioEvaluationResultsSchema as ac, type StudioEvaluationStartRequest as ad, StudioEvaluationStartRequestSchema as ae, type StudioEvaluationSummary as af, StudioEvaluationSummarySchema as ag, createStudioEvalJudge as ah, defineSuite as ai, getEvalGradeEvidence as aj, parseEvalSuite as ak, type ChatLifecyclePhase as al, ChatLifecycleHookError as am, type Agent as an, type ChatResponseFinalized as ao, type AgentProcessOptions as ap, type AgentProjectTopologyOptions as aq, type ChatResponseStatus as ar, type CreateAgentArgs as as, type ExecutableWorkflow as at, type ExecuteOptions as au, type ExecutionInfo as av, type ExecutionInterrupt as aw, ExecutionRequestError as ax, type ExecutionResult as ay, type InterruptScope as az, EvalCaseResultSchema as b, type EvalCommand as c, EvalConfigurationError as d, type EvalContext as e, type EvalCriterion as f, type EvalCriterionResult as g, type EvalDefaults as h, type EvalEvidenceEvent as i, type EvalEvidenceEventType as j, type EvalEvidenceFilters as k, type EvalEvidencePolicy as l, EvalEvidencePolicySchema as m, type EvalExecution as n, type EvalExecutionStatus as o, type EvalExpectation as p, type EvalGradeInput as q, type EvalHandlerRef as r, type EvalInterrupt as s, type EvalIssue as t, type EvalJson as u, type EvalJudge as v, type EvalJudgeEvidence as w, type EvalJudgeIdentity as x, EvalJudgeIdentitySchema as y, type EvalJudgeOptions as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kortyx/agent",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "private": false,
5
5
  "description": "Agent composition utilities for Kortyx.",
6
6
  "keywords": [
@@ -42,11 +42,11 @@
42
42
  "@langchain/core": "^1.1.24",
43
43
  "@langchain/langgraph": "^1.1.4",
44
44
  "zod": "^4.3.6",
45
- "@kortyx/core": "0.12.0",
46
- "@kortyx/providers": "0.9.0",
47
- "@kortyx/stream": "0.15.2",
48
- "@kortyx/runtime": "0.22.0",
49
- "@kortyx/utils": "0.3.4"
45
+ "@kortyx/core": "0.13.0",
46
+ "@kortyx/providers": "0.9.1",
47
+ "@kortyx/runtime": "0.22.1",
48
+ "@kortyx/stream": "0.15.3",
49
+ "@kortyx/utils": "0.3.5"
50
50
  },
51
51
  "devDependencies": {
52
52
  "turbo": "2.9.14",
@@ -55,8 +55,8 @@
55
55
  "vitest": "^4.1.11",
56
56
  "@vitest/coverage-v8": "^4.1.11",
57
57
  "postgres": "^3.4.7",
58
- "@kortyx/hooks": "0.32.0",
59
- "@kortyx/openai": "0.5.6"
58
+ "@kortyx/hooks": "0.32.1",
59
+ "@kortyx/openai": "0.5.7"
60
60
  },
61
61
  "sideEffects": false,
62
62
  "repository": {