@respan/cli 0.10.0 → 0.12.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/dist/commands/demo/clear.d.ts +23 -0
- package/dist/commands/demo/clear.js +114 -0
- package/dist/commands/demo/index.d.ts +15 -0
- package/dist/commands/demo/index.js +81 -0
- package/dist/commands/setup/doctor.d.ts +0 -1
- package/dist/commands/setup/doctor.js +25 -40
- package/dist/commands/setup/gateway.d.ts +16 -0
- package/dist/commands/setup/gateway.js +33 -0
- package/dist/commands/setup/index.d.ts +4 -33
- package/dist/commands/setup/index.js +11 -762
- package/dist/commands/setup/tracing.d.ts +16 -0
- package/dist/commands/setup/tracing.js +33 -0
- package/dist/lib/agents.d.ts +16 -0
- package/dist/lib/agents.js +75 -0
- package/dist/lib/auth.js +24 -0
- package/dist/lib/colors.d.ts +7 -0
- package/dist/lib/colors.js +10 -0
- package/dist/lib/demo/dataset-fixtures.d.ts +32 -0
- package/dist/lib/demo/dataset-fixtures.js +194 -0
- package/dist/lib/demo/evaluator-fixtures.d.ts +41 -0
- package/dist/lib/demo/evaluator-fixtures.js +251 -0
- package/dist/lib/demo/prompt-fixtures.d.ts +54 -0
- package/dist/lib/demo/prompt-fixtures.js +395 -0
- package/dist/lib/demo/seed-datasets.d.ts +15 -0
- package/dist/lib/demo/seed-datasets.js +107 -0
- package/dist/lib/demo/seed-evaluators.d.ts +22 -0
- package/dist/lib/demo/seed-evaluators.js +180 -0
- package/dist/lib/demo/seed-prompts.d.ts +10 -0
- package/dist/lib/demo/seed-prompts.js +111 -0
- package/dist/lib/demo/seed-traces.d.ts +27 -0
- package/dist/lib/demo/seed-traces.js +158 -0
- package/dist/lib/demo/seeders.d.ts +8 -0
- package/dist/lib/demo/seeders.js +11 -0
- package/dist/lib/demo/trace-fixtures.d.ts +31 -0
- package/dist/lib/demo/trace-fixtures.js +79 -0
- package/dist/lib/demo/types.d.ts +57 -0
- package/dist/lib/demo/types.js +9 -0
- package/dist/lib/integrate.d.ts +6 -0
- package/dist/lib/integrate.js +11 -0
- package/dist/lib/setup-base-command.d.ts +84 -0
- package/dist/lib/setup-base-command.js +649 -0
- package/dist/lib/skill-content.d.ts +1 -0
- package/dist/lib/skill-content.js +16 -0
- package/dist/lib/skill-refs.generated.d.ts +3 -2
- package/dist/lib/skill-refs.generated.js +423 -102
- package/oclif.manifest.json +945 -642
- package/package.json +2 -1
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frozen snapshot of the demo evaluators, captured byte-for-byte from the
|
|
3
|
+
* owner's deployed evaluators (graders + Blockly workflow task graphs).
|
|
4
|
+
*
|
|
5
|
+
* Source of truth for `respan demo`. Each entry is one user-facing evaluator: the
|
|
6
|
+
* deployed workflow's task graph plus the grader record(s) it references. The
|
|
7
|
+
* grader `type` is captured verbatim ("human" is the stored default) — the actual
|
|
8
|
+
* LLM engine lives in each eval task's `generation_method`/`_blockly_evaluator_kind`,
|
|
9
|
+
* so replaying the graph reproduces the verified scoring behavior exactly.
|
|
10
|
+
*
|
|
11
|
+
* This is a frozen snapshot: if the source evaluators change, this file does NOT
|
|
12
|
+
* update until someone re-snapshots and ships a new build.
|
|
13
|
+
*
|
|
14
|
+
* Recreate recipe (see seed-evaluators.ts): create each grader -> map its
|
|
15
|
+
* `originalId` to the new id -> rewrite every eval task's `config.evaluator_id`
|
|
16
|
+
* via that map -> createWorkflow -> commit -> deploy. Task ids are kept verbatim
|
|
17
|
+
* so the compute task's `state.<task_id>` input references stay valid.
|
|
18
|
+
*/
|
|
19
|
+
export const DEMO_EVALUATORS = [
|
|
20
|
+
{
|
|
21
|
+
"workflowName": "Demo evaluator 1: support-policy-compliance",
|
|
22
|
+
"description": "Scores a Lumen support reply against refund/escalation policy (1-5).",
|
|
23
|
+
"graders": [
|
|
24
|
+
{
|
|
25
|
+
"name": "support-policy-compliance",
|
|
26
|
+
"originalId": "86d100fb91c547f4b35a2d0a3db1d095",
|
|
27
|
+
"type": "human",
|
|
28
|
+
"score_value_type": "numerical",
|
|
29
|
+
"score_config": {
|
|
30
|
+
"max_score": 5.0,
|
|
31
|
+
"min_score": 0.0
|
|
32
|
+
},
|
|
33
|
+
"passing_conditions": {
|
|
34
|
+
"primary_score": {
|
|
35
|
+
"value": 3,
|
|
36
|
+
"operator": "gte"
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
"llm_config": {
|
|
40
|
+
"model": "openai/gpt-5.1",
|
|
41
|
+
"top_p": 1.0,
|
|
42
|
+
"max_tokens": 200,
|
|
43
|
+
"temperature": 0.1,
|
|
44
|
+
"scoring_rubric": "",
|
|
45
|
+
"presence_penalty": 0.0,
|
|
46
|
+
"frequency_penalty": 0.0,
|
|
47
|
+
"evaluator_definition": "You are checking a Lumen Electronics support reply against policy.\n\nCustomer message: {{input}}\nAgent reply: {{output}}\n\nPolicy: refunds only within 30 days; final-sale items never refundable;\nrefunds over $200 need a stated reason; never refund a delayed or\nundelivered order; if \"delivered but never arrived\" or \"lost in mail\",\nescalate instead of refunding.\n\nScore 1 to 5:\n5 = follows every rule\n3 = right outcome but skipped a step\n1 = broke a refund or escalation rule\n\nReply with only the number."
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
],
|
|
51
|
+
"tasks": [
|
|
52
|
+
{
|
|
53
|
+
"id": "d970b254-ea77-493e-a722-c9ca0c4132e9",
|
|
54
|
+
"next": "90112acd-bb05-46ed-a1c5-ad9fb6f84f33",
|
|
55
|
+
"type": "eval",
|
|
56
|
+
"label": "blockly_hidden_eval_7nyk_jmj_1_g_o3h_b",
|
|
57
|
+
"config": {
|
|
58
|
+
"llm_config": {
|
|
59
|
+
"model": "openai/gpt-5.1",
|
|
60
|
+
"top_p": 1,
|
|
61
|
+
"max_tokens": 200,
|
|
62
|
+
"temperature": 0.1,
|
|
63
|
+
"scoring_rubric": "",
|
|
64
|
+
"presence_penalty": 0,
|
|
65
|
+
"frequency_penalty": 0,
|
|
66
|
+
"evaluator_definition": "You are checking a Lumen Electronics support reply against policy.\n\nCustomer message: {{input}}\nAgent reply: {{output}}\n\nPolicy: refunds only within 30 days; final-sale items never refundable;\nrefunds over $200 need a stated reason; never refund a delayed or\nundelivered order; if \"delivered but never arrived\" or \"lost in mail\",\nescalate instead of refunding.\n\nScore 1 to 5:\n5 = follows every rule\n3 = right outcome but skipped a step\n1 = broke a refund or escalation rule\n\nReply with only the number."
|
|
67
|
+
},
|
|
68
|
+
"evaluator_id": "86d100fb91c547f4b35a2d0a3db1d095",
|
|
69
|
+
"score_config": {
|
|
70
|
+
"max_score": 5,
|
|
71
|
+
"min_score": 0
|
|
72
|
+
},
|
|
73
|
+
"_blockly_node_id": "/7Nyk_jmJ~=1#G;o3h[b",
|
|
74
|
+
"score_value_type": "numerical",
|
|
75
|
+
"_blockly_hidden_eval": true,
|
|
76
|
+
"_blockly_output_field": "primary_score",
|
|
77
|
+
"_blockly_evaluator_kind": "llm",
|
|
78
|
+
"is_auto_persist_enabled": false,
|
|
79
|
+
"_blockly_evaluator_label": "support-policy-compliance"
|
|
80
|
+
},
|
|
81
|
+
"generation_method": "llm"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"id": "90112acd-bb05-46ed-a1c5-ad9fb6f84f33",
|
|
85
|
+
"next": null,
|
|
86
|
+
"type": "transform",
|
|
87
|
+
"label": "blockly_final_result_grp_9_3ivg_r9xnj",
|
|
88
|
+
"config": {
|
|
89
|
+
"params": {
|
|
90
|
+
"field": "primary_score",
|
|
91
|
+
"source_max": 5,
|
|
92
|
+
"source_min": 0,
|
|
93
|
+
"target_max": 5,
|
|
94
|
+
"target_min": 0
|
|
95
|
+
},
|
|
96
|
+
"transform_type": "normalize",
|
|
97
|
+
"_blockly_node_id": "grP#9#3IvG),r9XNJ;{)",
|
|
98
|
+
"_blockly_is_result": true,
|
|
99
|
+
"_blockly_final_result_normalize": true
|
|
100
|
+
},
|
|
101
|
+
"task_type": "transform"
|
|
102
|
+
}
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"workflowName": "Demo evaluator 3: call-transcript-classifier",
|
|
107
|
+
"description": "Scores classifier accuracy vs gold label via weighted average of two graders (0-1).",
|
|
108
|
+
"graders": [
|
|
109
|
+
{
|
|
110
|
+
"name": "extraction-accuracy",
|
|
111
|
+
"originalId": "7d7a60d8184a4d59af405af8362e314b",
|
|
112
|
+
"type": "human",
|
|
113
|
+
"score_value_type": "numerical",
|
|
114
|
+
"score_config": {
|
|
115
|
+
"max_score": 1.0,
|
|
116
|
+
"min_score": 0.0
|
|
117
|
+
},
|
|
118
|
+
"passing_conditions": {
|
|
119
|
+
"primary_score": {
|
|
120
|
+
"value": 0.8,
|
|
121
|
+
"operator": "gte"
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"llm_config": {
|
|
125
|
+
"model": "openai/gpt-5.1",
|
|
126
|
+
"top_p": 1.0,
|
|
127
|
+
"max_tokens": 200,
|
|
128
|
+
"temperature": 0.1,
|
|
129
|
+
"scoring_rubric": "",
|
|
130
|
+
"presence_penalty": 0.0,
|
|
131
|
+
"frequency_penalty": 0.0,
|
|
132
|
+
"evaluator_definition": "Compare the classifier output to the gold label, focusing on EXTRACTED data.\nClassifier output: {{output}}\nGold label: {{expected_output}}\nScore 0.0–1.0 = how well these match: order_ids (exact set),\nproducts_mentioned, agent_name, key_quote (semantic match). Average them.\nReply with only a decimal 0.0–1.0."
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"name": "categorical-accuracy",
|
|
137
|
+
"originalId": "dca4334d65a845838dbcf04dde75e2d8",
|
|
138
|
+
"type": "human",
|
|
139
|
+
"score_value_type": "numerical",
|
|
140
|
+
"score_config": {
|
|
141
|
+
"max_score": 1.0,
|
|
142
|
+
"min_score": 0.0
|
|
143
|
+
},
|
|
144
|
+
"passing_conditions": {
|
|
145
|
+
"primary_score": {
|
|
146
|
+
"value": 0.8,
|
|
147
|
+
"operator": "gte"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"llm_config": {
|
|
151
|
+
"model": "openai/gpt-5.1",
|
|
152
|
+
"top_p": 1.0,
|
|
153
|
+
"max_tokens": 200,
|
|
154
|
+
"temperature": 0.1,
|
|
155
|
+
"scoring_rubric": "",
|
|
156
|
+
"presence_penalty": 0.0,
|
|
157
|
+
"frequency_penalty": 0.0,
|
|
158
|
+
"evaluator_definition": "Compare the classifier output to the gold label, focusing on JUDGMENT fields.\nClassifier output: {{output}}\nGold label: {{expected_output}}\nScore 0.0–1.0 = fraction of these fields that match the gold label:\nprimary_reason, resolution_status, customer_sentiment_start,\ncustomer_sentiment_end, escalation_requested, followup_required.\nReply with only a decimal 0.0–1.0."
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
],
|
|
162
|
+
"tasks": [
|
|
163
|
+
{
|
|
164
|
+
"id": "b505bf79-df32-4fd6-b2b3-eed05afc4955",
|
|
165
|
+
"next": "f9bcfabe-fa16-4fb5-a8c8-dadf3b51027a",
|
|
166
|
+
"type": "eval",
|
|
167
|
+
"label": "blockly_hidden_eval_cd_oamywl_wvoo_6",
|
|
168
|
+
"config": {
|
|
169
|
+
"llm_config": {
|
|
170
|
+
"model": "openai/gpt-5.1",
|
|
171
|
+
"top_p": 1,
|
|
172
|
+
"max_tokens": 200,
|
|
173
|
+
"temperature": 0.1,
|
|
174
|
+
"scoring_rubric": "",
|
|
175
|
+
"presence_penalty": 0,
|
|
176
|
+
"frequency_penalty": 0,
|
|
177
|
+
"evaluator_definition": "Compare the classifier output to the gold label, focusing on EXTRACTED data.\nClassifier output: {{output}}\nGold label: {{expected_output}}\nScore 0.0–1.0 = how well these match: order_ids (exact set),\nproducts_mentioned, agent_name, key_quote (semantic match). Average them.\nReply with only a decimal 0.0–1.0."
|
|
178
|
+
},
|
|
179
|
+
"evaluator_id": "7d7a60d8184a4d59af405af8362e314b",
|
|
180
|
+
"score_config": {
|
|
181
|
+
"max_score": 1,
|
|
182
|
+
"min_score": 0
|
|
183
|
+
},
|
|
184
|
+
"_blockly_node_id": "Cd,OaMYWL.;=wVoO]=~6",
|
|
185
|
+
"score_value_type": "numerical",
|
|
186
|
+
"_blockly_hidden_eval": true,
|
|
187
|
+
"_blockly_output_field": "primary_score",
|
|
188
|
+
"_blockly_evaluator_kind": "llm",
|
|
189
|
+
"is_auto_persist_enabled": false,
|
|
190
|
+
"_blockly_evaluator_label": "extraction-accuracy"
|
|
191
|
+
},
|
|
192
|
+
"generation_method": "llm"
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
"id": "f9bcfabe-fa16-4fb5-a8c8-dadf3b51027a",
|
|
196
|
+
"next": "fefd60d6-a309-4b88-ad9c-b208fe0866fa",
|
|
197
|
+
"type": "eval",
|
|
198
|
+
"label": "blockly_hidden_eval_gq_rw_bra0pfw_y872k",
|
|
199
|
+
"config": {
|
|
200
|
+
"llm_config": {
|
|
201
|
+
"model": "openai/gpt-5.1",
|
|
202
|
+
"top_p": 1,
|
|
203
|
+
"max_tokens": 200,
|
|
204
|
+
"temperature": 0.1,
|
|
205
|
+
"scoring_rubric": "",
|
|
206
|
+
"presence_penalty": 0,
|
|
207
|
+
"frequency_penalty": 0,
|
|
208
|
+
"evaluator_definition": "Compare the classifier output to the gold label, focusing on JUDGMENT fields.\nClassifier output: {{output}}\nGold label: {{expected_output}}\nScore 0.0–1.0 = fraction of these fields that match the gold label:\nprimary_reason, resolution_status, customer_sentiment_start,\ncustomer_sentiment_end, escalation_requested, followup_required.\nReply with only a decimal 0.0–1.0."
|
|
209
|
+
},
|
|
210
|
+
"evaluator_id": "dca4334d65a845838dbcf04dde75e2d8",
|
|
211
|
+
"score_config": {
|
|
212
|
+
"max_score": 1,
|
|
213
|
+
"min_score": 0
|
|
214
|
+
},
|
|
215
|
+
"_blockly_node_id": "Gq`rw!bra0pFw*,Y872k",
|
|
216
|
+
"score_value_type": "numerical",
|
|
217
|
+
"_blockly_hidden_eval": true,
|
|
218
|
+
"_blockly_output_field": "primary_score",
|
|
219
|
+
"_blockly_evaluator_kind": "llm",
|
|
220
|
+
"is_auto_persist_enabled": false,
|
|
221
|
+
"_blockly_evaluator_label": "categorical-accuracy"
|
|
222
|
+
},
|
|
223
|
+
"generation_method": "llm"
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"id": "fefd60d6-a309-4b88-ad9c-b208fe0866fa",
|
|
227
|
+
"next": null,
|
|
228
|
+
"type": "compute",
|
|
229
|
+
"label": "blockly_hidden_compute_clysphgg_qvui_b_4",
|
|
230
|
+
"config": {
|
|
231
|
+
"inputs": [
|
|
232
|
+
{
|
|
233
|
+
"field": "primary_score",
|
|
234
|
+
"source": "state.b505bf79-df32-4fd6-b2b3-eed05afc4955",
|
|
235
|
+
"weight": 0.6
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
"field": "primary_score",
|
|
239
|
+
"source": "state.f9bcfabe-fa16-4fb5-a8c8-dadf3b51027a",
|
|
240
|
+
"weight": 0.4
|
|
241
|
+
}
|
|
242
|
+
],
|
|
243
|
+
"function": "weighted_average",
|
|
244
|
+
"_blockly_node_id": "clySphgG^#@QVUi-b?4%",
|
|
245
|
+
"_blockly_is_result": true,
|
|
246
|
+
"_blockly_hidden_compute": true
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
]
|
|
250
|
+
}
|
|
251
|
+
];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frozen snapshot of the three demo prompts, hand-authored as typed TypeScript.
|
|
3
|
+
*
|
|
4
|
+
* Source of truth for `respan demo`. Each entry is the live/deployed version body
|
|
5
|
+
* of a prompt in the owner's account, captured byte-for-byte (Jinja conditionals,
|
|
6
|
+
* JSON schemas, tool definitions, and template variables preserved verbatim).
|
|
7
|
+
*
|
|
8
|
+
* This is a frozen snapshot: if the source prompts change, this file does NOT
|
|
9
|
+
* update until someone re-snapshots and ships a new build. There is no build-time
|
|
10
|
+
* codegen step — this data is static and imported directly by the seeder.
|
|
11
|
+
*
|
|
12
|
+
* Field set mirrors what `client.prompts.createPromptVersion` accepts, so a fixture
|
|
13
|
+
* version can be spread straight into the create call.
|
|
14
|
+
*/
|
|
15
|
+
/** A single message in a prompt version. `content` is either a plain string or an
|
|
16
|
+
* array of typed content blocks (e.g. `{ type: 'text', text: '...' }`), preserved
|
|
17
|
+
* exactly as stored. */
|
|
18
|
+
export interface DemoPromptMessage {
|
|
19
|
+
role: string;
|
|
20
|
+
content: string | Record<string, unknown>[];
|
|
21
|
+
[key: string]: unknown;
|
|
22
|
+
}
|
|
23
|
+
/** The live version body of a demo prompt. Optional fields are present only when
|
|
24
|
+
* the source version set them. Shape is a subset of `CreatePromptVersionRequest`. */
|
|
25
|
+
export interface DemoPromptVersion {
|
|
26
|
+
messages: DemoPromptMessage[];
|
|
27
|
+
model: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
temperature?: number;
|
|
30
|
+
max_tokens?: number;
|
|
31
|
+
top_p?: number;
|
|
32
|
+
frequency_penalty?: number;
|
|
33
|
+
presence_penalty?: number;
|
|
34
|
+
reasoning_effort?: string;
|
|
35
|
+
verbosity?: string;
|
|
36
|
+
seed?: number;
|
|
37
|
+
stream?: boolean;
|
|
38
|
+
thinking?: Record<string, unknown>;
|
|
39
|
+
variables?: Record<string, unknown>;
|
|
40
|
+
fallback_models?: string[];
|
|
41
|
+
load_balance_models?: Record<string, unknown>[];
|
|
42
|
+
tools?: Record<string, unknown>[];
|
|
43
|
+
tool_choice?: string | Record<string, unknown>;
|
|
44
|
+
response_format?: Record<string, unknown>;
|
|
45
|
+
json_schema?: Record<string, unknown>;
|
|
46
|
+
is_enforcing_response_format?: boolean;
|
|
47
|
+
}
|
|
48
|
+
/** One demo prompt: its name/description plus the single live version to recreate. */
|
|
49
|
+
export interface DemoPromptFixture {
|
|
50
|
+
name: string;
|
|
51
|
+
description?: string;
|
|
52
|
+
version: DemoPromptVersion;
|
|
53
|
+
}
|
|
54
|
+
export declare const DEMO_PROMPTS: DemoPromptFixture[];
|