@dalmia/calibrate-mcp 0.0.40 → 0.0.42

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.
Files changed (103) hide show
  1. package/bin/mcp-server.js +1218 -682
  2. package/bin/mcp-server.js.map +35 -33
  3. package/esm/funcs/agentTestsListRunsForAgent.js +1 -0
  4. package/esm/funcs/agentTestsListRunsForAgent.js.map +1 -1
  5. package/esm/landing-page.js +1 -1
  6. package/esm/lib/config.d.ts +2 -2
  7. package/esm/lib/config.js +2 -2
  8. package/esm/mcp-server/mcp-server.js +1 -1
  9. package/esm/mcp-server/server.js +1 -1
  10. package/esm/models/agentcreate.d.ts +26 -0
  11. package/esm/models/agentcreate.d.ts.map +1 -1
  12. package/esm/models/agentcreate.js +18 -0
  13. package/esm/models/agentcreate.js.map +1 -1
  14. package/esm/models/agentresponse.d.ts +26 -0
  15. package/esm/models/agentresponse.d.ts.map +1 -1
  16. package/esm/models/agentresponse.js +17 -0
  17. package/esm/models/agentresponse.js.map +1 -1
  18. package/esm/models/agentsummary.d.ts +26 -0
  19. package/esm/models/agentsummary.d.ts.map +1 -1
  20. package/esm/models/agentsummary.js +17 -0
  21. package/esm/models/agentsummary.js.map +1 -1
  22. package/esm/models/agenttestrunlistitem.d.ts +2 -0
  23. package/esm/models/agenttestrunlistitem.d.ts.map +1 -1
  24. package/esm/models/agenttestrunlistitem.js +2 -0
  25. package/esm/models/agenttestrunlistitem.js.map +1 -1
  26. package/esm/models/annotationtaskresponse.js +1 -1
  27. package/esm/models/annotationtaskresponse.js.map +1 -1
  28. package/esm/models/bulktestitem.d.ts +2 -1
  29. package/esm/models/bulktestitem.d.ts.map +1 -1
  30. package/esm/models/bulktestitem.js +4 -2
  31. package/esm/models/bulktestitem.js.map +1 -1
  32. package/esm/models/bulktestupload.d.ts +4 -0
  33. package/esm/models/bulktestupload.d.ts.map +1 -1
  34. package/esm/models/bulktestupload.js +5 -2
  35. package/esm/models/bulktestupload.js.map +1 -1
  36. package/esm/models/evaluatorcreate.d.ts +4 -0
  37. package/esm/models/evaluatorcreate.d.ts.map +1 -1
  38. package/esm/models/evaluatorcreate.js +5 -2
  39. package/esm/models/evaluatorcreate.js.map +1 -1
  40. package/esm/models/evaluatordetailresponsecompact.d.ts +5 -0
  41. package/esm/models/evaluatordetailresponsecompact.d.ts.map +1 -1
  42. package/esm/models/evaluatordetailresponsecompact.js +6 -2
  43. package/esm/models/evaluatordetailresponsecompact.js.map +1 -1
  44. package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.d.ts +1 -0
  45. package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.d.ts.map +1 -1
  46. package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.js +1 -0
  47. package/esm/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.js.map +1 -1
  48. package/esm/models/listevaluatorsevaluatorsgetop.d.ts +2 -0
  49. package/esm/models/listevaluatorsevaluatorsgetop.d.ts.map +1 -1
  50. package/esm/models/listevaluatorsevaluatorsgetop.js +2 -0
  51. package/esm/models/listevaluatorsevaluatorsgetop.js.map +1 -1
  52. package/esm/models/routersevaluatorsevaluatorresponse.d.ts +5 -0
  53. package/esm/models/routersevaluatorsevaluatorresponse.d.ts.map +1 -1
  54. package/esm/models/routersevaluatorsevaluatorresponse.js +6 -2
  55. package/esm/models/routersevaluatorsevaluatorresponse.js.map +1 -1
  56. package/esm/models/testcreate.d.ts +4 -0
  57. package/esm/models/testcreate.d.ts.map +1 -1
  58. package/esm/models/testcreate.js +6 -3
  59. package/esm/models/testcreate.js.map +1 -1
  60. package/esm/models/testlistresponse.d.ts +4 -0
  61. package/esm/models/testlistresponse.d.ts.map +1 -1
  62. package/esm/models/testlistresponse.js +5 -2
  63. package/esm/models/testlistresponse.js.map +1 -1
  64. package/esm/models/testresponse.d.ts +4 -0
  65. package/esm/models/testresponse.d.ts.map +1 -1
  66. package/esm/models/testresponse.js +5 -2
  67. package/esm/models/testresponse.js.map +1 -1
  68. package/esm/models/testupdate.d.ts +2 -0
  69. package/esm/models/testupdate.d.ts.map +1 -1
  70. package/esm/models/testupdate.js +4 -2
  71. package/esm/models/testupdate.js.map +1 -1
  72. package/esm/models/traceingest.d.ts +6 -1
  73. package/esm/models/traceingest.d.ts.map +1 -1
  74. package/esm/models/traceingest.js +8 -1
  75. package/esm/models/traceingest.js.map +1 -1
  76. package/esm/models/tracetoolcall.d.ts +1 -0
  77. package/esm/models/tracetoolcall.d.ts.map +1 -1
  78. package/esm/models/tracetoolcall.js +1 -0
  79. package/esm/models/tracetoolcall.js.map +1 -1
  80. package/package.json +1 -1
  81. package/src/funcs/agentTestsListRunsForAgent.ts +1 -0
  82. package/src/landing-page.ts +1 -1
  83. package/src/lib/config.ts +2 -2
  84. package/src/mcp-server/mcp-server.ts +1 -1
  85. package/src/mcp-server/server.ts +1 -1
  86. package/src/models/agentcreate.ts +36 -0
  87. package/src/models/agentresponse.ts +35 -0
  88. package/src/models/agentsummary.ts +35 -0
  89. package/src/models/agenttestrunlistitem.ts +6 -0
  90. package/src/models/annotationtaskresponse.ts +1 -1
  91. package/src/models/bulktestitem.ts +10 -5
  92. package/src/models/bulktestupload.ts +6 -2
  93. package/src/models/evaluatorcreate.ts +6 -2
  94. package/src/models/evaluatordetailresponsecompact.ts +10 -2
  95. package/src/models/getagenttestrunsagenttestsagentagentuuidrunsgetop.ts +4 -0
  96. package/src/models/listevaluatorsevaluatorsgetop.ts +2 -0
  97. package/src/models/routersevaluatorsevaluatorresponse.ts +10 -2
  98. package/src/models/testcreate.ts +7 -3
  99. package/src/models/testlistresponse.ts +6 -2
  100. package/src/models/testresponse.ts +6 -2
  101. package/src/models/testupdate.ts +4 -2
  102. package/src/models/traceingest.ts +18 -3
  103. package/src/models/tracetoolcall.ts +4 -0
@@ -19,6 +19,7 @@ import {
19
19
  * - `llm`: a reply with its conversation history
20
20
  * - `llm-general`: a standalone input and output pair
21
21
  * - `conversation`: a full conversation
22
+ * - `tool-call`: whether the agent called the right tool, labelled by a person
22
23
  */
23
24
  export const RoutersEvaluatorsEvaluatorResponseEvaluatorType = {
24
25
  Tts: "tts",
@@ -26,6 +27,7 @@ export const RoutersEvaluatorsEvaluatorResponseEvaluatorType = {
26
27
  Llm: "llm",
27
28
  LlmGeneral: "llm-general",
28
29
  Conversation: "conversation",
30
+ ToolCall: "tool-call",
29
31
  } as const;
30
32
  /**
31
33
  * What the evaluator judges:
@@ -37,6 +39,7 @@ export const RoutersEvaluatorsEvaluatorResponseEvaluatorType = {
37
39
  * - `llm`: a reply with its conversation history
38
40
  * - `llm-general`: a standalone input and output pair
39
41
  * - `conversation`: a full conversation
42
+ * - `tool-call`: whether the agent called the right tool, labelled by a person
40
43
  */
41
44
  export type RoutersEvaluatorsEvaluatorResponseEvaluatorType = ClosedEnum<
42
45
  typeof RoutersEvaluatorsEvaluatorResponseEvaluatorType
@@ -49,9 +52,10 @@ export const RoutersEvaluatorsEvaluatorResponseEvaluatorType$zodSchema = z.enum(
49
52
  "llm",
50
53
  "llm-general",
51
54
  "conversation",
55
+ "tool-call",
52
56
  ],
53
57
  ).describe(
54
- "What the evaluator judges:\n\n- `tts`: TTS audio\n- `stt`: one transcript\n- `llm`: a reply with its conversation history\n- `llm-general`: a standalone input and output pair\n- `conversation`: a full conversation\n",
58
+ "What the evaluator judges:\n\n- `tts`: TTS audio\n- `stt`: one transcript\n- `llm`: a reply with its conversation history\n- `llm-general`: a standalone input and output pair\n- `conversation`: a full conversation\n- `tool-call`: whether the agent called the right tool, labelled by a person\n",
55
59
  );
56
60
 
57
61
  /**
@@ -122,6 +126,7 @@ export type RoutersEvaluatorsEvaluatorResponse = {
122
126
  data_type: RoutersEvaluatorsEvaluatorResponseDataType;
123
127
  output_type: RoutersEvaluatorsEvaluatorResponseOutputType;
124
128
  is_default: boolean;
129
+ is_protected: boolean;
125
130
  slug?: string | null | undefined;
126
131
  source_default_slug?: string | null | undefined;
127
132
  live_version_id?: string | null | undefined;
@@ -144,11 +149,14 @@ export const RoutersEvaluatorsEvaluatorResponse$zodSchema: z.ZodType<
144
149
  ),
145
150
  evaluator_type: RoutersEvaluatorsEvaluatorResponseEvaluatorType$zodSchema
146
151
  .describe(
147
- "What the evaluator judges:\n\n- `tts`: TTS audio\n- `stt`: one transcript\n- `llm`: a reply with its conversation history\n- `llm-general`: a standalone input and output pair\n- `conversation`: a full conversation\n",
152
+ "What the evaluator judges:\n\n- `tts`: TTS audio\n- `stt`: one transcript\n- `llm`: a reply with its conversation history\n- `llm-general`: a standalone input and output pair\n- `conversation`: a full conversation\n- `tool-call`: whether the agent called the right tool, labelled by a person\n",
148
153
  ),
149
154
  is_default: z.boolean().describe(
150
155
  "True when the evaluator is a built-in default or your workspace's editable copy of one. False for an evaluator you created yourself",
151
156
  ),
157
+ is_protected: z.boolean().describe(
158
+ "True when the evaluator is locked. A locked evaluator cannot be deleted, and only its name, description and rubric can change",
159
+ ),
152
160
  live_version: EvaluatorLiveVersionSummary$zodSchema.nullable().optional()
153
161
  .describe("The version that is currently live"),
154
162
  live_version_id: z.string().nullable().optional().describe(
@@ -17,11 +17,13 @@ import {
17
17
  * - `response`: judges the generated reply
18
18
  * - `tool_call`: diffs the generated tool calls
19
19
  * - `conversation`: judges the full conversation
20
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
20
21
  */
21
22
  export const TestCreateType = {
22
23
  Response: "response",
23
24
  ToolCall: "tool_call",
24
25
  Conversation: "conversation",
26
+ General: "general",
25
27
  } as const;
26
28
  /**
27
29
  * What the test judges:
@@ -31,6 +33,7 @@ export const TestCreateType = {
31
33
  * - `response`: judges the generated reply
32
34
  * - `tool_call`: diffs the generated tool calls
33
35
  * - `conversation`: judges the full conversation
36
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
34
37
  */
35
38
  export type TestCreateType = ClosedEnum<typeof TestCreateType>;
36
39
 
@@ -38,8 +41,9 @@ export const TestCreateType$zodSchema = z.enum([
38
41
  "response",
39
42
  "tool_call",
40
43
  "conversation",
44
+ "general",
41
45
  ]).describe(
42
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
46
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
43
47
  );
44
48
 
45
49
  export type TestCreate = {
@@ -51,7 +55,7 @@ export type TestCreate = {
51
55
 
52
56
  export const TestCreate$zodSchema: z.ZodType<TestCreate> = z.object({
53
57
  config: z.record(z.string(), z.any()).nullable().optional().describe(
54
- "The calibrate test config. Three top-level keys.\n\n- `history`: the required conversation up to the agent's turn. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nOmit to create the test with no config and fill it in later via update",
58
+ "The calibrate test config.\n\n- `history`: the conversation up to the agent's turn, required for `response` and `conversation` tests and for a `tool_call` test aimed at a conversational agent. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `input`: a standalone prompt with no conversation around it, required for `general` tests and for a `tool_call` test aimed at a `general` agent. A string, not a conversation.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\nA `tool_call` test carries exactly one of `history` or `input`, and which one it carries decides the agent it can be linked to.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n- `general`: judge a standalone, non-conversational input/output pair, graded by the linked evaluators. `{\"type\": \"general\"}`\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example, for a conversational agent. Swap `history` for `input` to aim it at a `general` agent:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\n`general` example:\n```json\n{\n \"input\": \"Summarize this article: ...\",\n \"evaluation\": {\"type\": \"general\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nOmit to create the test with no config and fill it in later via update",
55
59
  ),
56
60
  evaluators: z.array(RoutersTestsEvaluatorRef$zodSchema).nullable().optional()
57
61
  .describe(
@@ -59,6 +63,6 @@ export const TestCreate$zodSchema: z.ZodType<TestCreate> = z.object({
59
63
  ),
60
64
  name: z.string().describe("Name of the test, unique within the workspace"),
61
65
  type: TestCreateType$zodSchema.describe(
62
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
66
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
63
67
  ),
64
68
  });
@@ -14,11 +14,13 @@ import { TestListConfig, TestListConfig$zodSchema } from "./testlistconfig.js";
14
14
  * - `response`: judges the generated reply
15
15
  * - `tool_call`: diffs the generated tool calls
16
16
  * - `conversation`: judges the full conversation
17
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
17
18
  */
18
19
  export const TestListResponseType = {
19
20
  Response: "response",
20
21
  ToolCall: "tool_call",
21
22
  Conversation: "conversation",
23
+ General: "general",
22
24
  } as const;
23
25
  /**
24
26
  * What the test judges:
@@ -28,6 +30,7 @@ export const TestListResponseType = {
28
30
  * - `response`: judges the generated reply
29
31
  * - `tool_call`: diffs the generated tool calls
30
32
  * - `conversation`: judges the full conversation
33
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
31
34
  */
32
35
  export type TestListResponseType = ClosedEnum<typeof TestListResponseType>;
33
36
 
@@ -35,8 +38,9 @@ export const TestListResponseType$zodSchema = z.enum([
35
38
  "response",
36
39
  "tool_call",
37
40
  "conversation",
41
+ "general",
38
42
  ]).describe(
39
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
43
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
40
44
  );
41
45
 
42
46
  /**
@@ -63,7 +67,7 @@ export const TestListResponse$zodSchema: z.ZodType<TestListResponse> = z.object(
63
67
  created_at: z.string().describe("When the test was created (ISO 8601 UTC)"),
64
68
  name: z.string().describe("Name of the test"),
65
69
  type: TestListResponseType$zodSchema.describe(
66
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
70
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
67
71
  ),
68
72
  updated_at: z.string().describe(
69
73
  "When the test was last updated (ISO 8601 UTC)",
@@ -13,11 +13,13 @@ import { ClosedEnum } from "../types/enums.js";
13
13
  * - `response`: judges the generated reply
14
14
  * - `tool_call`: diffs the generated tool calls
15
15
  * - `conversation`: judges the full conversation
16
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
16
17
  */
17
18
  export const TestResponseType = {
18
19
  Response: "response",
19
20
  ToolCall: "tool_call",
20
21
  Conversation: "conversation",
22
+ General: "general",
21
23
  } as const;
22
24
  /**
23
25
  * What the test judges:
@@ -27,6 +29,7 @@ export const TestResponseType = {
27
29
  * - `response`: judges the generated reply
28
30
  * - `tool_call`: diffs the generated tool calls
29
31
  * - `conversation`: judges the full conversation
32
+ * - `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)
30
33
  */
31
34
  export type TestResponseType = ClosedEnum<typeof TestResponseType>;
32
35
 
@@ -34,8 +37,9 @@ export const TestResponseType$zodSchema = z.enum([
34
37
  "response",
35
38
  "tool_call",
36
39
  "conversation",
40
+ "general",
37
41
  ]).describe(
38
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
42
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
39
43
  );
40
44
 
41
45
  export type TestResponse = {
@@ -58,7 +62,7 @@ export const TestResponse$zodSchema: z.ZodType<TestResponse> = z.object({
58
62
  ),
59
63
  name: z.string().describe("Name of the test"),
60
64
  type: TestResponseType$zodSchema.describe(
61
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n",
65
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n",
62
66
  ),
63
67
  updated_at: z.string().describe(
64
68
  "When the test was last updated (ISO 8601 UTC)",
@@ -13,6 +13,7 @@ export const TestUpdateType = {
13
13
  Response: "response",
14
14
  ToolCall: "tool_call",
15
15
  Conversation: "conversation",
16
+ General: "general",
16
17
  } as const;
17
18
  export type TestUpdateType = ClosedEnum<typeof TestUpdateType>;
18
19
 
@@ -20,6 +21,7 @@ export const TestUpdateType$zodSchema = z.enum([
20
21
  "response",
21
22
  "tool_call",
22
23
  "conversation",
24
+ "general",
23
25
  ]);
24
26
 
25
27
  export type TestUpdate = {
@@ -31,7 +33,7 @@ export type TestUpdate = {
31
33
 
32
34
  export const TestUpdate$zodSchema: z.ZodType<TestUpdate> = z.object({
33
35
  config: z.record(z.string(), z.any()).nullable().optional().describe(
34
- "The calibrate test config. Three top-level keys.\n\n- `history`: the required conversation up to the agent's turn. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nReplaces the stored config. Omit to leave unchanged",
36
+ "The calibrate test config.\n\n- `history`: the conversation up to the agent's turn, required for `response` and `conversation` tests and for a `tool_call` test aimed at a conversational agent. Each item is `{role, content}` with `role` one of `user`, `assistant`, `tool`. A `tool` message also carries `tool_call_id` and `name`.\n- `input`: a standalone prompt with no conversation around it, required for `general` tests and for a `tool_call` test aimed at a `general` agent. A string, not a conversation.\n- `evaluation`: the required `{type, ...}`, where `type` matches the test's `type` below.\n- `settings`: an optional object, e.g. `{\"language\": \"en\"}`.\n\nA `tool_call` test carries exactly one of `history` or `input`, and which one it carries decides the agent it can be linked to.\n\n`evaluation` by test type:\n- `response`: judge the agent's reply, graded by the linked evaluators. `{\"type\": \"response\"}`\n- `conversation`: append the reply and judge the whole conversation. `{\"type\": \"conversation\"}`\n- `tool_call`: diff the agent's tool calls against expected ones. Add `tool_calls`, a list of `{tool, arguments, accept_any_arguments?}`.\n- `general`: judge a standalone, non-conversational input/output pair, graded by the linked evaluators. `{\"type\": \"general\"}`\n\nFor `tool_call`, each expected argument value is one of:\n- `{\"match_type\": \"exact\", \"value\": <any>}`: must equal `value`\n- `{\"match_type\": \"llm_judge\", \"criteria\": \"...\"}`: judged against the criteria\n- `{\"match_type\": \"any\"}`: any value, only checks the argument was passed\n\n`response` / `conversation` example:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"What is your return policy?\"}],\n \"evaluation\": {\"type\": \"response\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\n`tool_call` example, for a conversational agent. Swap `history` for `input` to aim it at a `general` agent:\n```json\n{\n \"history\": [{\"role\": \"user\", \"content\": \"Book room 101 for tomorrow\"}],\n \"evaluation\": {\n \"type\": \"tool_call\",\n \"tool_calls\": [\n {\n \"tool\": \"book_room\",\n \"arguments\": {\n \"room\": {\"match_type\": \"exact\", \"value\": \"101\"},\n \"date\": {\"match_type\": \"llm_judge\", \"criteria\": \"tomorrow's date\"}\n },\n \"accept_any_arguments\": false\n }\n ]\n }\n}\n```\n\n`general` example:\n```json\n{\n \"input\": \"Summarize this article: ...\",\n \"evaluation\": {\"type\": \"general\"},\n \"settings\": {\"language\": \"en\"}\n}\n```\n\nEvaluators are linked via the separate `evaluators` field, not inside `config`.\n\nReplaces the stored config. Omit to leave unchanged",
35
37
  ),
36
38
  evaluators: z.array(RoutersTestsEvaluatorRef$zodSchema).nullable().optional()
37
39
  .describe(
@@ -41,6 +43,6 @@ export const TestUpdate$zodSchema: z.ZodType<TestUpdate> = z.object({
41
43
  "New test name. Omit to leave unchanged",
42
44
  ),
43
45
  type: TestUpdateType$zodSchema.nullable().optional().describe(
44
- "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n\n\nImmutable. Omit it, or send the current value",
46
+ "What the test judges:\n\n- `response`: judges the generated reply\n- `tool_call`: diffs the generated tool calls\n- `conversation`: judges the full conversation\n- `general`: judges a single plain-text input/output pair with no conversation involved (e.g. summarization, extraction, classification)\n\n\nImmutable. Omit it, or send the current value",
45
47
  ),
46
48
  });
@@ -10,11 +10,23 @@ import {
10
10
  import { TraceOutput, TraceOutput$zodSchema } from "./traceoutput.js";
11
11
  import { TraceTurn, TraceTurn$zodSchema } from "./traceturn.js";
12
12
 
13
+ /**
14
+ * What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format
15
+ */
16
+ export type Input = string | Array<TraceTurn>;
17
+
18
+ export const Input$zodSchema: z.ZodType<Input> = z.union([
19
+ z.string(),
20
+ z.array(TraceTurn$zodSchema),
21
+ ]).describe(
22
+ "What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format",
23
+ );
24
+
13
25
  export type TraceIngest = {
14
26
  agent_id: string;
15
27
  message_id?: string | null | undefined;
16
28
  conversation_id?: string | null | undefined;
17
- input: Array<TraceTurn>;
29
+ input: string | Array<TraceTurn>;
18
30
  output: TraceOutput;
19
31
  metadata?: Array<TraceMetadataEntry> | null | undefined;
20
32
  };
@@ -26,8 +38,11 @@ export const TraceIngest$zodSchema: z.ZodType<TraceIngest> = z.object({
26
38
  conversation_id: z.string().nullable().optional().describe(
27
39
  "Your own ID for the conversation this turn belongs to, stored for reference only. Omit if you have none",
28
40
  ),
29
- input: z.array(TraceTurn$zodSchema).describe(
30
- "Conversation history up to the reported output, oldest turn first, in OpenAI chat format",
41
+ input: z.union([
42
+ z.string(),
43
+ z.array(TraceTurn$zodSchema),
44
+ ]).describe(
45
+ "What the agent was given for this turn. For a `general` agent, the standalone prompt as a string. For a `conversation` agent, the history up to the reported output, oldest turn first, in OpenAI chat format",
31
46
  ),
32
47
  message_id: z.string().nullable().optional().describe(
33
48
  "Your own ID for the last user message in `input`, stored for reference only. Omit if you have none",
@@ -7,11 +7,15 @@ import * as z from "zod";
7
7
  export type TraceToolCall = {
8
8
  tool: string;
9
9
  arguments?: { [k: string]: any } | null | undefined;
10
+ output?: any | undefined;
10
11
  };
11
12
 
12
13
  export const TraceToolCall$zodSchema: z.ZodType<TraceToolCall> = z.object({
13
14
  arguments: z.record(z.string(), z.any()).nullable().optional().describe(
14
15
  "Argument values the agent passed to the tool. Omit when the call had none",
15
16
  ),
17
+ output: z.any().optional().describe(
18
+ "What the tool returned for this call. Any JSON value. Omit when you do not record it",
19
+ ),
16
20
  tool: z.string().describe("Name of the tool the agent called"),
17
21
  });