@respan/cli 0.14.0 → 0.14.2

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.
@@ -112,11 +112,11 @@ class IntegratePi extends BaseCommand {
112
112
  this.log('Set properties via integrate flags or edit respan.json:');
113
113
  this.log(' respan integrate pi --customer-id "frank" --workflow-name "my-agent"');
114
114
  this.log(' respan integrate pi --attrs \'{"team":"platform","env":"staging"}\'');
115
- this.log(' respan integrate pi --trace-scope session # one trace per pi session ("trace_scope")');
115
+ this.log(' respan integrate pi --trace-scope run # one trace per prompt instead of one per session ("trace_scope")');
116
116
  this.log('');
117
117
  this.log('Override per-session with env vars:');
118
118
  this.log(' export RESPAN_CUSTOMER_ID="your-name"');
119
- this.log(' export RESPAN_PI_TRACE_SCOPE=session # or run (default)');
119
+ this.log(' export RESPAN_PI_TRACE_SCOPE=run # or session (default)');
120
120
  this.log(' export RESPAN_PI_TRACING=false # skip tracing for one session');
121
121
  this.log('');
122
122
  this.log('One-off run without installing (from a project that has the package):');
@@ -151,8 +151,8 @@ Scope:
151
151
  --local pi install -l npm:@respan/instrumentation-pi + .pi/respan.json in the project root
152
152
 
153
153
  Trace scope (--trace-scope, "trace_scope" in respan.json):
154
- run one trace per agent run; runs of a session share a thread id (default)
155
- session one multi-root trace per pi session (long-lived, resumed sessions)
154
+ session one multi-root trace per pi session, across processes and pauses (default)
155
+ run one trace per agent run; runs of a session share a thread id
156
156
 
157
157
  Durable delivery (--with-collector):
158
158
  Sets base_url to a local Respan collector (http://127.0.0.1:4318) so traces
@@ -166,7 +166,7 @@ IntegratePi.examples = [
166
166
  'respan integrate pi --disable',
167
167
  'respan integrate pi --local',
168
168
  'respan integrate pi --customer-id frank --workflow-name email-agent',
169
- 'respan integrate pi --trace-scope session',
169
+ 'respan integrate pi --trace-scope run',
170
170
  'respan integrate pi --with-collector',
171
171
  'respan integrate pi --project-id my-project --attrs \'{"env":"prod"}\'',
172
172
  'respan integrate pi --dry-run',
@@ -182,7 +182,7 @@ IntegratePi.flags = {
182
182
  description: 'Alias of --workflow-name (default: pi)',
183
183
  }),
184
184
  'trace-scope': Flags.string({
185
- description: 'Trace scope: "run" = one trace per agent run (default), "session" = one multi-root trace per pi session',
185
+ description: 'Trace scope: "session" = one multi-root trace per pi session (default), "run" = one trace per agent run',
186
186
  options: ['run', 'session'],
187
187
  }),
188
188
  'with-collector': Flags.boolean({
@@ -9,19 +9,19 @@
9
9
  import { DEMO_PROMPTS } from './prompt-fixtures.js';
10
10
  /** Prompts in the account whose name exactly matches a demo fixture name.
11
11
  *
12
- * Queried with the `name` `iexact` filter, one query per fixture name. NOTE: the
13
- * `icontains`/`iexact` filters do NOT OR-match across a multi-value array — a
14
- * single `value: [a, b, c]` matches nothing — so each name must be queried on
15
- * its own. Server matching is case-insensitive, so we re-confirm with an exact,
16
- * case-sensitive match client-side. Returns every match (so duplicates are all
17
- * found, for clear). */
12
+ * Queried with the `name` exact-match filter (operator `''`), one query per
13
+ * fixture name. The backend rejects `iexact` with a 400, and `icontains` does
14
+ * NOT OR-match across a multi-value array — a single `value: [a, b, c]` matches
15
+ * nothing — so each name is queried on its own. Matches are re-confirmed
16
+ * client-side with an exact, case-sensitive comparison. Returns every match (so
17
+ * duplicates are all found, for clear). */
18
18
  async function findExistingPrompts(ctx) {
19
19
  const found = [];
20
20
  for (const fixture of DEMO_PROMPTS) {
21
21
  const response = await ctx.client.prompts.listPrompts({
22
22
  Authorization: ctx.authHeader,
23
23
  page_size: 100,
24
- filters: { name: { operator: 'iexact', value: [fixture.name] } },
24
+ filters: { name: { operator: '', value: [fixture.name] } },
25
25
  });
26
26
  for (const row of response.results ?? []) {
27
27
  if (row.id && row.name === fixture.name) {
@@ -1,10 +1,19 @@
1
1
  /**
2
- * Frozen snapshot of the demo traces, supplied by the team as ready-to-POST OTLP v2
3
- * bodies (the `trace-bodies/` dataset: a 22-span, 6-LLM-call multi-agent AI Service
4
- * Desk run across two tenants). Source of truth for the traces portion of `respan demo`.
2
+ * Frozen snapshot of the demo traces as ready-to-POST OTLP v2 bodies: a multi-agent
3
+ * AI Service Desk run across two tenants, 17 spans each. Four agents (triage,
4
+ * identity, knowledge, notification) hand off to each other, each making one
5
+ * gpt-6.1-sol call and one tool call, plus a RAG embedding. Source of truth for the
6
+ * traces portion of `respan demo`.
5
7
  *
6
- * Each `body` is a complete OTLP/JSON payload for `POST /api/v2/traces`, captured
7
- * VERBATIM. The seeder (`seed-traces.ts`) re-stamps fresh trace/span ids and recent
8
+ * Span names follow the SDKs' semantic style (`llm.<model>`, `agent.<name>`,
9
+ * `tool.<name>`, `handoff.<from>_to_<to>`, `embedding`; see
10
+ * contribution/writing-instrumentations.md), and handoff spans carry
11
+ * `respan.entity.log_type: handoff`. Derived from the team's original
12
+ * `trace-bodies/` dataset by dropping the Vercel AI SDK wrapper spans
13
+ * (`ai.generateText`, `ai.embed`) and moving the LLM calls to gpt-6.1-sol.
14
+ *
15
+ * Each `body` is a complete OTLP/JSON payload for `POST /api/v2/traces`. The
16
+ * seeder (`seed-traces.ts`) re-stamps fresh trace/span ids and recent
8
17
  * timestamps on each fresh seed, and sets the root span's name to `workflow` (below)
9
18
  * so it shows in the dashboard Workflow column and is unique per trace — the dataset
10
19
  * repeats some scenarios with a byte-identical root span, and a unique root name keeps