@respan/cli 0.11.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/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/oclif.manifest.json +784 -644
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the `respan demo` orchestrator and its per-service seeders.
|
|
3
|
+
*
|
|
4
|
+
* The orchestrator (`commands/demo/*`) is service-agnostic: it knows only the
|
|
5
|
+
* {@link Seeder} contract and aggregates {@link SeederResult}s. Each service
|
|
6
|
+
* (prompts today; traces/datasets/evaluators later) ships its own `seed-*.ts`
|
|
7
|
+
* that implements {@link Seeder}, so adding a service is a drop-in.
|
|
8
|
+
*/
|
|
9
|
+
import { RespanClient } from '@respan/respan-api';
|
|
10
|
+
/** Authed handles every seeder needs to talk to the platform. */
|
|
11
|
+
export interface SeederContext {
|
|
12
|
+
client: RespanClient;
|
|
13
|
+
/** `"Bearer <token>"`, as the SDK request objects expect. */
|
|
14
|
+
authHeader: string;
|
|
15
|
+
/**
|
|
16
|
+
* Resolved API base URL (e.g. `https://api.respan.ai`). Needed by seeders that
|
|
17
|
+
* bypass the SDK — the traces seeder POSTs raw OTLP to `/v2/traces`, which the
|
|
18
|
+
* SDK does not expose. Prompt seeding ignores this.
|
|
19
|
+
*/
|
|
20
|
+
baseUrl: string;
|
|
21
|
+
}
|
|
22
|
+
/** A demo resource that already exists in the account (matched by name). */
|
|
23
|
+
export interface ExistingResource {
|
|
24
|
+
name: string;
|
|
25
|
+
id: string;
|
|
26
|
+
}
|
|
27
|
+
/** Outcome for a single resource. */
|
|
28
|
+
export interface SeedItemResult {
|
|
29
|
+
name: string;
|
|
30
|
+
status: 'created' | 'skipped' | 'deleted';
|
|
31
|
+
/** Resource ID — the new ID when created, the removed ID when deleted. */
|
|
32
|
+
id?: string;
|
|
33
|
+
/** Why it was skipped (e.g. "already exists" / "not found"). */
|
|
34
|
+
reason?: string;
|
|
35
|
+
}
|
|
36
|
+
/** Aggregated outcome for one service's seed or clear run. */
|
|
37
|
+
export interface SeederResult {
|
|
38
|
+
/** Machine key, e.g. `"prompts"`. */
|
|
39
|
+
service: string;
|
|
40
|
+
/** Human label for summaries, e.g. `"Prompts"`. */
|
|
41
|
+
label: string;
|
|
42
|
+
items: SeedItemResult[];
|
|
43
|
+
}
|
|
44
|
+
/** A per-service seeder. Owns its fixtures and all create/find/delete logic for
|
|
45
|
+
* one service, so the orchestrator stays service-agnostic. Both `run` and
|
|
46
|
+
* `clear` must be safely re-runnable (idempotent). */
|
|
47
|
+
export interface Seeder {
|
|
48
|
+
service: string;
|
|
49
|
+
label: string;
|
|
50
|
+
/** Create any missing demo resources, deploying them live. Skips existing. */
|
|
51
|
+
run(ctx: SeederContext): Promise<SeederResult>;
|
|
52
|
+
/** Delete the demo resources this seeder owns (matched by fixture name). */
|
|
53
|
+
clear(ctx: SeederContext): Promise<SeederResult>;
|
|
54
|
+
/** Find demo resources that currently exist in the account (by fixture name),
|
|
55
|
+
* without modifying anything. Used for dedup and for clear previews. */
|
|
56
|
+
findExisting(ctx: SeederContext): Promise<ExistingResource[]>;
|
|
57
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for the `respan demo` orchestrator and its per-service seeders.
|
|
3
|
+
*
|
|
4
|
+
* The orchestrator (`commands/demo/*`) is service-agnostic: it knows only the
|
|
5
|
+
* {@link Seeder} contract and aggregates {@link SeederResult}s. Each service
|
|
6
|
+
* (prompts today; traces/datasets/evaluators later) ships its own `seed-*.ts`
|
|
7
|
+
* that implements {@link Seeder}, so adding a service is a drop-in.
|
|
8
|
+
*/
|
|
9
|
+
export {};
|