@respan/cli 0.2.0 → 0.3.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/auth/login.d.ts +1 -0
- package/dist/commands/auth/login.js +117 -8
- package/oclif.manifest.json +190 -184
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ export default class AuthLogin extends BaseCommand {
|
|
|
5
5
|
'api-key': import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
6
6
|
'profile-name': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
7
7
|
'base-url': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
8
|
+
enterprise: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
8
9
|
profile: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
10
|
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
11
|
csv: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
@@ -1,26 +1,135 @@
|
|
|
1
1
|
import { Flags } from '@oclif/core';
|
|
2
|
-
import { password } from '@inquirer/prompts';
|
|
2
|
+
import { select, password } from '@inquirer/prompts';
|
|
3
|
+
import * as http from 'node:http';
|
|
4
|
+
import * as open from 'node:child_process';
|
|
3
5
|
import { BaseCommand } from '../../lib/base-command.js';
|
|
4
6
|
import { setCredential } from '../../lib/config.js';
|
|
5
7
|
import { printLoginSuccess } from '../../lib/banner.js';
|
|
8
|
+
const CALLBACK_PORT = 18392;
|
|
9
|
+
const CALLBACK_PATH = '/callback';
|
|
10
|
+
const LOGIN_TIMEOUT_MS = 120_000;
|
|
11
|
+
const LOGIN_URL_BASE = 'https://platform.respan.ai/login';
|
|
12
|
+
function openBrowser(url) {
|
|
13
|
+
const cmd = process.platform === 'darwin' ? 'open' : process.platform === 'win32' ? 'start' : 'xdg-open';
|
|
14
|
+
open.exec(`${cmd} "${url}"`);
|
|
15
|
+
}
|
|
16
|
+
function successHtml() {
|
|
17
|
+
return `<!DOCTYPE html>
|
|
18
|
+
<html>
|
|
19
|
+
<head><meta charset="utf-8"><title>Respan CLI</title>
|
|
20
|
+
<style>body{font-family:-apple-system,system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#0a0a0f;color:#fff}
|
|
21
|
+
.card{text-align:center;padding:2rem}.check{font-size:3rem;margin-bottom:1rem;color:#6483F0}p{color:#aaa;margin-top:0.5rem}</style></head>
|
|
22
|
+
<body><div class="card"><div class="check">✓</div><h2>Login successful!</h2><p>You can close this window and return to the terminal.</p></div></body></html>`;
|
|
23
|
+
}
|
|
24
|
+
function errorHtml(msg) {
|
|
25
|
+
return `<!DOCTYPE html>
|
|
26
|
+
<html>
|
|
27
|
+
<head><meta charset="utf-8"><title>Respan CLI</title>
|
|
28
|
+
<style>body{font-family:-apple-system,system-ui,sans-serif;display:flex;align-items:center;justify-content:center;height:100vh;margin:0;background:#0a0a0f;color:#fff}
|
|
29
|
+
.card{text-align:center;padding:2rem}.icon{font-size:3rem;margin-bottom:1rem;color:#f06464}p{color:#aaa;margin-top:0.5rem}</style></head>
|
|
30
|
+
<body><div class="card"><div class="icon">✗</div><h2>Login failed</h2><p>${msg}</p></div></body></html>`;
|
|
31
|
+
}
|
|
32
|
+
function waitForBrowserLogin(enterprise) {
|
|
33
|
+
return new Promise((resolve, reject) => {
|
|
34
|
+
const server = http.createServer((req, res) => {
|
|
35
|
+
const url = new URL(req.url || '/', `http://localhost:${CALLBACK_PORT}`);
|
|
36
|
+
if (url.pathname !== CALLBACK_PATH) {
|
|
37
|
+
res.writeHead(404);
|
|
38
|
+
res.end('Not found');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
const token = url.searchParams.get('token');
|
|
42
|
+
const refreshToken = url.searchParams.get('refresh_token');
|
|
43
|
+
const email = url.searchParams.get('email') || undefined;
|
|
44
|
+
if (!token || !refreshToken) {
|
|
45
|
+
res.writeHead(400, { 'Content-Type': 'text/html' });
|
|
46
|
+
res.end(errorHtml('Missing token. Please try again.'));
|
|
47
|
+
cleanup();
|
|
48
|
+
reject(new Error('Login callback missing token or refresh_token.'));
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
52
|
+
res.end(successHtml());
|
|
53
|
+
cleanup();
|
|
54
|
+
resolve({ token, refreshToken, email });
|
|
55
|
+
});
|
|
56
|
+
const timeout = setTimeout(() => {
|
|
57
|
+
cleanup();
|
|
58
|
+
reject(new Error('Login timed out after 120 seconds. Please try again.'));
|
|
59
|
+
}, LOGIN_TIMEOUT_MS);
|
|
60
|
+
function cleanup() {
|
|
61
|
+
clearTimeout(timeout);
|
|
62
|
+
server.close();
|
|
63
|
+
}
|
|
64
|
+
server.on('error', (err) => {
|
|
65
|
+
if (err.code === 'EADDRINUSE') {
|
|
66
|
+
reject(new Error(`Port ${CALLBACK_PORT} is in use. Close the other process and try again.`));
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
reject(err);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
server.listen(CALLBACK_PORT, '127.0.0.1', () => {
|
|
73
|
+
const redirectUri = `http://localhost:${CALLBACK_PORT}${CALLBACK_PATH}`;
|
|
74
|
+
const loginUrl = new URL(LOGIN_URL_BASE);
|
|
75
|
+
loginUrl.searchParams.set('mode', 'cli');
|
|
76
|
+
loginUrl.searchParams.set('redirect_uri', redirectUri);
|
|
77
|
+
if (enterprise) {
|
|
78
|
+
loginUrl.searchParams.set('enterprise', 'true');
|
|
79
|
+
}
|
|
80
|
+
console.log('');
|
|
81
|
+
console.log(' Opening browser to log in...');
|
|
82
|
+
console.log(` If the browser doesn't open, visit:`);
|
|
83
|
+
console.log(` ${loginUrl.toString()}`);
|
|
84
|
+
console.log('');
|
|
85
|
+
console.log(' Waiting for login (timeout: 120s)...');
|
|
86
|
+
openBrowser(loginUrl.toString());
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
}
|
|
6
90
|
class AuthLogin extends BaseCommand {
|
|
7
91
|
async run() {
|
|
8
92
|
const { flags } = await this.parse(AuthLogin);
|
|
9
93
|
this.globalFlags = flags;
|
|
10
|
-
let apiKey = flags['api-key'];
|
|
11
|
-
if (!apiKey) {
|
|
12
|
-
apiKey = await password({ message: 'Enter your Respan API key:' });
|
|
13
|
-
}
|
|
14
94
|
const profile = flags['profile-name'] || 'default';
|
|
15
|
-
|
|
16
|
-
|
|
95
|
+
// If --api-key passed directly, skip interactive
|
|
96
|
+
if (flags['api-key']) {
|
|
97
|
+
setCredential(profile, { type: 'api_key', apiKey: flags['api-key'], baseUrl: flags['base-url'] });
|
|
98
|
+
await printLoginSuccess(undefined, profile);
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const method = await select({
|
|
102
|
+
message: 'How would you like to log in?',
|
|
103
|
+
choices: [
|
|
104
|
+
{ name: 'Browser login (recommended)', value: 'browser' },
|
|
105
|
+
{ name: 'Enterprise SSO', value: 'enterprise' },
|
|
106
|
+
{ name: 'API key', value: 'api_key' },
|
|
107
|
+
],
|
|
108
|
+
});
|
|
109
|
+
if (method === 'api_key') {
|
|
110
|
+
const apiKey = await password({ message: 'Enter your Respan API key:' });
|
|
111
|
+
setCredential(profile, { type: 'api_key', apiKey, baseUrl: flags['base-url'] });
|
|
112
|
+
await printLoginSuccess(undefined, profile);
|
|
113
|
+
return;
|
|
114
|
+
}
|
|
115
|
+
const enterprise = method === 'enterprise' || flags.enterprise;
|
|
116
|
+
const result = await waitForBrowserLogin(enterprise);
|
|
117
|
+
setCredential(profile, {
|
|
118
|
+
type: 'jwt',
|
|
119
|
+
accessToken: result.token,
|
|
120
|
+
refreshToken: result.refreshToken,
|
|
121
|
+
email: result.email || '',
|
|
122
|
+
baseUrl: flags['base-url'],
|
|
123
|
+
});
|
|
124
|
+
await printLoginSuccess(result.email, profile);
|
|
17
125
|
}
|
|
18
126
|
}
|
|
19
127
|
AuthLogin.description = 'Log in to Respan';
|
|
20
128
|
AuthLogin.flags = {
|
|
21
129
|
...BaseCommand.baseFlags,
|
|
22
|
-
'api-key': Flags.string({ description: 'API key to store' }),
|
|
130
|
+
'api-key': Flags.string({ description: 'API key to store (skips interactive prompt)' }),
|
|
23
131
|
'profile-name': Flags.string({ description: 'Profile name', default: 'default' }),
|
|
24
132
|
'base-url': Flags.string({ description: 'API base URL', default: 'https://api.respan.ai/api' }),
|
|
133
|
+
enterprise: Flags.boolean({ description: 'Use enterprise SSO login', default: false }),
|
|
25
134
|
};
|
|
26
135
|
export default AuthLogin;
|
package/oclif.manifest.json
CHANGED
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"description": "Log in to Respan",
|
|
62
62
|
"flags": {
|
|
63
63
|
"api-key": {
|
|
64
|
-
"description": "API key to store",
|
|
64
|
+
"description": "API key to store (skips interactive prompt)",
|
|
65
65
|
"name": "api-key",
|
|
66
66
|
"hasDynamicHelp": false,
|
|
67
67
|
"multiple": false,
|
|
@@ -108,6 +108,12 @@
|
|
|
108
108
|
"hasDynamicHelp": false,
|
|
109
109
|
"multiple": false,
|
|
110
110
|
"type": "option"
|
|
111
|
+
},
|
|
112
|
+
"enterprise": {
|
|
113
|
+
"description": "Use enterprise SSO login",
|
|
114
|
+
"name": "enterprise",
|
|
115
|
+
"allowNo": false,
|
|
116
|
+
"type": "boolean"
|
|
111
117
|
}
|
|
112
118
|
},
|
|
113
119
|
"hasDynamicHelp": false,
|
|
@@ -423,16 +429,10 @@
|
|
|
423
429
|
"set.js"
|
|
424
430
|
]
|
|
425
431
|
},
|
|
426
|
-
"
|
|
432
|
+
"evaluators:create": {
|
|
427
433
|
"aliases": [],
|
|
428
|
-
"args": {
|
|
429
|
-
|
|
430
|
-
"description": "Dataset ID",
|
|
431
|
-
"name": "dataset-id",
|
|
432
|
-
"required": true
|
|
433
|
-
}
|
|
434
|
-
},
|
|
435
|
-
"description": "Add existing spans to a dataset",
|
|
434
|
+
"args": {},
|
|
435
|
+
"description": "Create a new evaluator",
|
|
436
436
|
"flags": {
|
|
437
437
|
"api-key": {
|
|
438
438
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -468,18 +468,39 @@
|
|
|
468
468
|
"allowNo": false,
|
|
469
469
|
"type": "boolean"
|
|
470
470
|
},
|
|
471
|
-
"
|
|
472
|
-
"description": "
|
|
473
|
-
"name": "
|
|
471
|
+
"name": {
|
|
472
|
+
"description": "Evaluator name",
|
|
473
|
+
"name": "name",
|
|
474
474
|
"required": true,
|
|
475
475
|
"hasDynamicHelp": false,
|
|
476
476
|
"multiple": false,
|
|
477
477
|
"type": "option"
|
|
478
|
+
},
|
|
479
|
+
"type": {
|
|
480
|
+
"description": "Evaluator type",
|
|
481
|
+
"name": "type",
|
|
482
|
+
"hasDynamicHelp": false,
|
|
483
|
+
"multiple": false,
|
|
484
|
+
"type": "option"
|
|
485
|
+
},
|
|
486
|
+
"description": {
|
|
487
|
+
"description": "Evaluator description",
|
|
488
|
+
"name": "description",
|
|
489
|
+
"hasDynamicHelp": false,
|
|
490
|
+
"multiple": false,
|
|
491
|
+
"type": "option"
|
|
492
|
+
},
|
|
493
|
+
"config": {
|
|
494
|
+
"description": "Evaluator config as JSON string",
|
|
495
|
+
"name": "config",
|
|
496
|
+
"hasDynamicHelp": false,
|
|
497
|
+
"multiple": false,
|
|
498
|
+
"type": "option"
|
|
478
499
|
}
|
|
479
500
|
},
|
|
480
501
|
"hasDynamicHelp": false,
|
|
481
502
|
"hiddenAliases": [],
|
|
482
|
-
"id": "
|
|
503
|
+
"id": "evaluators:create",
|
|
483
504
|
"pluginAlias": "@respan/cli",
|
|
484
505
|
"pluginName": "@respan/cli",
|
|
485
506
|
"pluginType": "core",
|
|
@@ -489,20 +510,20 @@
|
|
|
489
510
|
"relativePath": [
|
|
490
511
|
"dist",
|
|
491
512
|
"commands",
|
|
492
|
-
"
|
|
493
|
-
"
|
|
513
|
+
"evaluators",
|
|
514
|
+
"create.js"
|
|
494
515
|
]
|
|
495
516
|
},
|
|
496
|
-
"
|
|
517
|
+
"evaluators:get": {
|
|
497
518
|
"aliases": [],
|
|
498
519
|
"args": {
|
|
499
|
-
"
|
|
500
|
-
"description": "
|
|
501
|
-
"name": "
|
|
520
|
+
"id": {
|
|
521
|
+
"description": "Evaluator ID",
|
|
522
|
+
"name": "id",
|
|
502
523
|
"required": true
|
|
503
524
|
}
|
|
504
525
|
},
|
|
505
|
-
"description": "
|
|
526
|
+
"description": "Get a specific evaluator",
|
|
506
527
|
"flags": {
|
|
507
528
|
"api-key": {
|
|
508
529
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -537,19 +558,11 @@
|
|
|
537
558
|
"name": "verbose",
|
|
538
559
|
"allowNo": false,
|
|
539
560
|
"type": "boolean"
|
|
540
|
-
},
|
|
541
|
-
"body": {
|
|
542
|
-
"description": "Span body as JSON string",
|
|
543
|
-
"name": "body",
|
|
544
|
-
"required": true,
|
|
545
|
-
"hasDynamicHelp": false,
|
|
546
|
-
"multiple": false,
|
|
547
|
-
"type": "option"
|
|
548
561
|
}
|
|
549
562
|
},
|
|
550
563
|
"hasDynamicHelp": false,
|
|
551
564
|
"hiddenAliases": [],
|
|
552
|
-
"id": "
|
|
565
|
+
"id": "evaluators:get",
|
|
553
566
|
"pluginAlias": "@respan/cli",
|
|
554
567
|
"pluginName": "@respan/cli",
|
|
555
568
|
"pluginType": "core",
|
|
@@ -559,14 +572,14 @@
|
|
|
559
572
|
"relativePath": [
|
|
560
573
|
"dist",
|
|
561
574
|
"commands",
|
|
562
|
-
"
|
|
563
|
-
"
|
|
575
|
+
"evaluators",
|
|
576
|
+
"get.js"
|
|
564
577
|
]
|
|
565
578
|
},
|
|
566
|
-
"
|
|
579
|
+
"evaluators:list": {
|
|
567
580
|
"aliases": [],
|
|
568
581
|
"args": {},
|
|
569
|
-
"description": "
|
|
582
|
+
"description": "List evaluators",
|
|
570
583
|
"flags": {
|
|
571
584
|
"api-key": {
|
|
572
585
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -602,17 +615,18 @@
|
|
|
602
615
|
"allowNo": false,
|
|
603
616
|
"type": "boolean"
|
|
604
617
|
},
|
|
605
|
-
"
|
|
606
|
-
"description": "
|
|
607
|
-
"name": "
|
|
608
|
-
"
|
|
618
|
+
"limit": {
|
|
619
|
+
"description": "Number of results per page",
|
|
620
|
+
"name": "limit",
|
|
621
|
+
"default": 20,
|
|
609
622
|
"hasDynamicHelp": false,
|
|
610
623
|
"multiple": false,
|
|
611
624
|
"type": "option"
|
|
612
625
|
},
|
|
613
|
-
"
|
|
614
|
-
"description": "
|
|
615
|
-
"name": "
|
|
626
|
+
"page": {
|
|
627
|
+
"description": "Page number",
|
|
628
|
+
"name": "page",
|
|
629
|
+
"default": 1,
|
|
616
630
|
"hasDynamicHelp": false,
|
|
617
631
|
"multiple": false,
|
|
618
632
|
"type": "option"
|
|
@@ -620,7 +634,7 @@
|
|
|
620
634
|
},
|
|
621
635
|
"hasDynamicHelp": false,
|
|
622
636
|
"hiddenAliases": [],
|
|
623
|
-
"id": "
|
|
637
|
+
"id": "evaluators:list",
|
|
624
638
|
"pluginAlias": "@respan/cli",
|
|
625
639
|
"pluginName": "@respan/cli",
|
|
626
640
|
"pluginType": "core",
|
|
@@ -630,25 +644,20 @@
|
|
|
630
644
|
"relativePath": [
|
|
631
645
|
"dist",
|
|
632
646
|
"commands",
|
|
633
|
-
"
|
|
634
|
-
"
|
|
647
|
+
"evaluators",
|
|
648
|
+
"list.js"
|
|
635
649
|
]
|
|
636
650
|
},
|
|
637
|
-
"
|
|
651
|
+
"evaluators:run": {
|
|
638
652
|
"aliases": [],
|
|
639
653
|
"args": {
|
|
640
|
-
"
|
|
641
|
-
"description": "
|
|
642
|
-
"name": "
|
|
643
|
-
"required": true
|
|
644
|
-
},
|
|
645
|
-
"span-id": {
|
|
646
|
-
"description": "Span ID",
|
|
647
|
-
"name": "span-id",
|
|
654
|
+
"id": {
|
|
655
|
+
"description": "Evaluator ID",
|
|
656
|
+
"name": "id",
|
|
648
657
|
"required": true
|
|
649
658
|
}
|
|
650
659
|
},
|
|
651
|
-
"description": "
|
|
660
|
+
"description": "Run an evaluator",
|
|
652
661
|
"flags": {
|
|
653
662
|
"api-key": {
|
|
654
663
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -683,11 +692,32 @@
|
|
|
683
692
|
"name": "verbose",
|
|
684
693
|
"allowNo": false,
|
|
685
694
|
"type": "boolean"
|
|
695
|
+
},
|
|
696
|
+
"dataset-id": {
|
|
697
|
+
"description": "Dataset ID to evaluate against",
|
|
698
|
+
"name": "dataset-id",
|
|
699
|
+
"hasDynamicHelp": false,
|
|
700
|
+
"multiple": false,
|
|
701
|
+
"type": "option"
|
|
702
|
+
},
|
|
703
|
+
"log-ids": {
|
|
704
|
+
"description": "Comma-separated log/span IDs to evaluate",
|
|
705
|
+
"name": "log-ids",
|
|
706
|
+
"hasDynamicHelp": false,
|
|
707
|
+
"multiple": false,
|
|
708
|
+
"type": "option"
|
|
709
|
+
},
|
|
710
|
+
"params": {
|
|
711
|
+
"description": "Additional parameters as JSON string",
|
|
712
|
+
"name": "params",
|
|
713
|
+
"hasDynamicHelp": false,
|
|
714
|
+
"multiple": false,
|
|
715
|
+
"type": "option"
|
|
686
716
|
}
|
|
687
717
|
},
|
|
688
718
|
"hasDynamicHelp": false,
|
|
689
719
|
"hiddenAliases": [],
|
|
690
|
-
"id": "
|
|
720
|
+
"id": "evaluators:run",
|
|
691
721
|
"pluginAlias": "@respan/cli",
|
|
692
722
|
"pluginName": "@respan/cli",
|
|
693
723
|
"pluginType": "core",
|
|
@@ -697,20 +727,20 @@
|
|
|
697
727
|
"relativePath": [
|
|
698
728
|
"dist",
|
|
699
729
|
"commands",
|
|
700
|
-
"
|
|
701
|
-
"
|
|
730
|
+
"evaluators",
|
|
731
|
+
"run.js"
|
|
702
732
|
]
|
|
703
733
|
},
|
|
704
|
-
"
|
|
734
|
+
"evaluators:update": {
|
|
705
735
|
"aliases": [],
|
|
706
736
|
"args": {
|
|
707
737
|
"id": {
|
|
708
|
-
"description": "
|
|
738
|
+
"description": "Evaluator ID",
|
|
709
739
|
"name": "id",
|
|
710
740
|
"required": true
|
|
711
741
|
}
|
|
712
742
|
},
|
|
713
|
-
"description": "
|
|
743
|
+
"description": "Update an evaluator",
|
|
714
744
|
"flags": {
|
|
715
745
|
"api-key": {
|
|
716
746
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -745,11 +775,32 @@
|
|
|
745
775
|
"name": "verbose",
|
|
746
776
|
"allowNo": false,
|
|
747
777
|
"type": "boolean"
|
|
778
|
+
},
|
|
779
|
+
"name": {
|
|
780
|
+
"description": "Evaluator name",
|
|
781
|
+
"name": "name",
|
|
782
|
+
"hasDynamicHelp": false,
|
|
783
|
+
"multiple": false,
|
|
784
|
+
"type": "option"
|
|
785
|
+
},
|
|
786
|
+
"description": {
|
|
787
|
+
"description": "Evaluator description",
|
|
788
|
+
"name": "description",
|
|
789
|
+
"hasDynamicHelp": false,
|
|
790
|
+
"multiple": false,
|
|
791
|
+
"type": "option"
|
|
792
|
+
},
|
|
793
|
+
"config": {
|
|
794
|
+
"description": "Evaluator config as JSON string",
|
|
795
|
+
"name": "config",
|
|
796
|
+
"hasDynamicHelp": false,
|
|
797
|
+
"multiple": false,
|
|
798
|
+
"type": "option"
|
|
748
799
|
}
|
|
749
800
|
},
|
|
750
801
|
"hasDynamicHelp": false,
|
|
751
802
|
"hiddenAliases": [],
|
|
752
|
-
"id": "
|
|
803
|
+
"id": "evaluators:update",
|
|
753
804
|
"pluginAlias": "@respan/cli",
|
|
754
805
|
"pluginName": "@respan/cli",
|
|
755
806
|
"pluginType": "core",
|
|
@@ -759,14 +810,20 @@
|
|
|
759
810
|
"relativePath": [
|
|
760
811
|
"dist",
|
|
761
812
|
"commands",
|
|
762
|
-
"
|
|
763
|
-
"
|
|
813
|
+
"evaluators",
|
|
814
|
+
"update.js"
|
|
764
815
|
]
|
|
765
816
|
},
|
|
766
|
-
"datasets:
|
|
817
|
+
"datasets:add-spans": {
|
|
767
818
|
"aliases": [],
|
|
768
|
-
"args": {
|
|
769
|
-
|
|
819
|
+
"args": {
|
|
820
|
+
"dataset-id": {
|
|
821
|
+
"description": "Dataset ID",
|
|
822
|
+
"name": "dataset-id",
|
|
823
|
+
"required": true
|
|
824
|
+
}
|
|
825
|
+
},
|
|
826
|
+
"description": "Add existing spans to a dataset",
|
|
770
827
|
"flags": {
|
|
771
828
|
"api-key": {
|
|
772
829
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -802,18 +859,10 @@
|
|
|
802
859
|
"allowNo": false,
|
|
803
860
|
"type": "boolean"
|
|
804
861
|
},
|
|
805
|
-
"
|
|
806
|
-
"description": "
|
|
807
|
-
"name": "
|
|
808
|
-
"
|
|
809
|
-
"hasDynamicHelp": false,
|
|
810
|
-
"multiple": false,
|
|
811
|
-
"type": "option"
|
|
812
|
-
},
|
|
813
|
-
"page": {
|
|
814
|
-
"description": "Page number",
|
|
815
|
-
"name": "page",
|
|
816
|
-
"default": 1,
|
|
862
|
+
"span-ids": {
|
|
863
|
+
"description": "Comma-separated span IDs",
|
|
864
|
+
"name": "span-ids",
|
|
865
|
+
"required": true,
|
|
817
866
|
"hasDynamicHelp": false,
|
|
818
867
|
"multiple": false,
|
|
819
868
|
"type": "option"
|
|
@@ -821,7 +870,7 @@
|
|
|
821
870
|
},
|
|
822
871
|
"hasDynamicHelp": false,
|
|
823
872
|
"hiddenAliases": [],
|
|
824
|
-
"id": "datasets:
|
|
873
|
+
"id": "datasets:add-spans",
|
|
825
874
|
"pluginAlias": "@respan/cli",
|
|
826
875
|
"pluginName": "@respan/cli",
|
|
827
876
|
"pluginType": "core",
|
|
@@ -832,10 +881,10 @@
|
|
|
832
881
|
"dist",
|
|
833
882
|
"commands",
|
|
834
883
|
"datasets",
|
|
835
|
-
"
|
|
884
|
+
"add-spans.js"
|
|
836
885
|
]
|
|
837
886
|
},
|
|
838
|
-
"datasets:
|
|
887
|
+
"datasets:create-span": {
|
|
839
888
|
"aliases": [],
|
|
840
889
|
"args": {
|
|
841
890
|
"dataset-id": {
|
|
@@ -844,7 +893,7 @@
|
|
|
844
893
|
"required": true
|
|
845
894
|
}
|
|
846
895
|
},
|
|
847
|
-
"description": "
|
|
896
|
+
"description": "Create a span in a dataset",
|
|
848
897
|
"flags": {
|
|
849
898
|
"api-key": {
|
|
850
899
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -879,11 +928,19 @@
|
|
|
879
928
|
"name": "verbose",
|
|
880
929
|
"allowNo": false,
|
|
881
930
|
"type": "boolean"
|
|
931
|
+
},
|
|
932
|
+
"body": {
|
|
933
|
+
"description": "Span body as JSON string",
|
|
934
|
+
"name": "body",
|
|
935
|
+
"required": true,
|
|
936
|
+
"hasDynamicHelp": false,
|
|
937
|
+
"multiple": false,
|
|
938
|
+
"type": "option"
|
|
882
939
|
}
|
|
883
940
|
},
|
|
884
941
|
"hasDynamicHelp": false,
|
|
885
942
|
"hiddenAliases": [],
|
|
886
|
-
"id": "datasets:
|
|
943
|
+
"id": "datasets:create-span",
|
|
887
944
|
"pluginAlias": "@respan/cli",
|
|
888
945
|
"pluginName": "@respan/cli",
|
|
889
946
|
"pluginType": "core",
|
|
@@ -894,19 +951,13 @@
|
|
|
894
951
|
"dist",
|
|
895
952
|
"commands",
|
|
896
953
|
"datasets",
|
|
897
|
-
"
|
|
954
|
+
"create-span.js"
|
|
898
955
|
]
|
|
899
956
|
},
|
|
900
|
-
"datasets:
|
|
957
|
+
"datasets:create": {
|
|
901
958
|
"aliases": [],
|
|
902
|
-
"args": {
|
|
903
|
-
|
|
904
|
-
"description": "Dataset ID",
|
|
905
|
-
"name": "id",
|
|
906
|
-
"required": true
|
|
907
|
-
}
|
|
908
|
-
},
|
|
909
|
-
"description": "Update a dataset",
|
|
959
|
+
"args": {},
|
|
960
|
+
"description": "Create a new dataset",
|
|
910
961
|
"flags": {
|
|
911
962
|
"api-key": {
|
|
912
963
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -945,6 +996,7 @@
|
|
|
945
996
|
"name": {
|
|
946
997
|
"description": "Dataset name",
|
|
947
998
|
"name": "name",
|
|
999
|
+
"required": true,
|
|
948
1000
|
"hasDynamicHelp": false,
|
|
949
1001
|
"multiple": false,
|
|
950
1002
|
"type": "option"
|
|
@@ -959,7 +1011,7 @@
|
|
|
959
1011
|
},
|
|
960
1012
|
"hasDynamicHelp": false,
|
|
961
1013
|
"hiddenAliases": [],
|
|
962
|
-
"id": "datasets:
|
|
1014
|
+
"id": "datasets:create",
|
|
963
1015
|
"pluginAlias": "@respan/cli",
|
|
964
1016
|
"pluginName": "@respan/cli",
|
|
965
1017
|
"pluginType": "core",
|
|
@@ -970,13 +1022,24 @@
|
|
|
970
1022
|
"dist",
|
|
971
1023
|
"commands",
|
|
972
1024
|
"datasets",
|
|
973
|
-
"
|
|
1025
|
+
"create.js"
|
|
974
1026
|
]
|
|
975
1027
|
},
|
|
976
|
-
"
|
|
1028
|
+
"datasets:get-span": {
|
|
977
1029
|
"aliases": [],
|
|
978
|
-
"args": {
|
|
979
|
-
|
|
1030
|
+
"args": {
|
|
1031
|
+
"dataset-id": {
|
|
1032
|
+
"description": "Dataset ID",
|
|
1033
|
+
"name": "dataset-id",
|
|
1034
|
+
"required": true
|
|
1035
|
+
},
|
|
1036
|
+
"span-id": {
|
|
1037
|
+
"description": "Span ID",
|
|
1038
|
+
"name": "span-id",
|
|
1039
|
+
"required": true
|
|
1040
|
+
}
|
|
1041
|
+
},
|
|
1042
|
+
"description": "Get a specific span from a dataset",
|
|
980
1043
|
"flags": {
|
|
981
1044
|
"api-key": {
|
|
982
1045
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -1011,40 +1074,11 @@
|
|
|
1011
1074
|
"name": "verbose",
|
|
1012
1075
|
"allowNo": false,
|
|
1013
1076
|
"type": "boolean"
|
|
1014
|
-
},
|
|
1015
|
-
"name": {
|
|
1016
|
-
"description": "Evaluator name",
|
|
1017
|
-
"name": "name",
|
|
1018
|
-
"required": true,
|
|
1019
|
-
"hasDynamicHelp": false,
|
|
1020
|
-
"multiple": false,
|
|
1021
|
-
"type": "option"
|
|
1022
|
-
},
|
|
1023
|
-
"type": {
|
|
1024
|
-
"description": "Evaluator type",
|
|
1025
|
-
"name": "type",
|
|
1026
|
-
"hasDynamicHelp": false,
|
|
1027
|
-
"multiple": false,
|
|
1028
|
-
"type": "option"
|
|
1029
|
-
},
|
|
1030
|
-
"description": {
|
|
1031
|
-
"description": "Evaluator description",
|
|
1032
|
-
"name": "description",
|
|
1033
|
-
"hasDynamicHelp": false,
|
|
1034
|
-
"multiple": false,
|
|
1035
|
-
"type": "option"
|
|
1036
|
-
},
|
|
1037
|
-
"config": {
|
|
1038
|
-
"description": "Evaluator config as JSON string",
|
|
1039
|
-
"name": "config",
|
|
1040
|
-
"hasDynamicHelp": false,
|
|
1041
|
-
"multiple": false,
|
|
1042
|
-
"type": "option"
|
|
1043
1077
|
}
|
|
1044
1078
|
},
|
|
1045
1079
|
"hasDynamicHelp": false,
|
|
1046
1080
|
"hiddenAliases": [],
|
|
1047
|
-
"id": "
|
|
1081
|
+
"id": "datasets:get-span",
|
|
1048
1082
|
"pluginAlias": "@respan/cli",
|
|
1049
1083
|
"pluginName": "@respan/cli",
|
|
1050
1084
|
"pluginType": "core",
|
|
@@ -1054,20 +1088,20 @@
|
|
|
1054
1088
|
"relativePath": [
|
|
1055
1089
|
"dist",
|
|
1056
1090
|
"commands",
|
|
1057
|
-
"
|
|
1058
|
-
"
|
|
1091
|
+
"datasets",
|
|
1092
|
+
"get-span.js"
|
|
1059
1093
|
]
|
|
1060
1094
|
},
|
|
1061
|
-
"
|
|
1095
|
+
"datasets:get": {
|
|
1062
1096
|
"aliases": [],
|
|
1063
1097
|
"args": {
|
|
1064
1098
|
"id": {
|
|
1065
|
-
"description": "
|
|
1099
|
+
"description": "Dataset ID",
|
|
1066
1100
|
"name": "id",
|
|
1067
1101
|
"required": true
|
|
1068
1102
|
}
|
|
1069
1103
|
},
|
|
1070
|
-
"description": "Get a specific
|
|
1104
|
+
"description": "Get a specific dataset",
|
|
1071
1105
|
"flags": {
|
|
1072
1106
|
"api-key": {
|
|
1073
1107
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -1106,7 +1140,7 @@
|
|
|
1106
1140
|
},
|
|
1107
1141
|
"hasDynamicHelp": false,
|
|
1108
1142
|
"hiddenAliases": [],
|
|
1109
|
-
"id": "
|
|
1143
|
+
"id": "datasets:get",
|
|
1110
1144
|
"pluginAlias": "@respan/cli",
|
|
1111
1145
|
"pluginName": "@respan/cli",
|
|
1112
1146
|
"pluginType": "core",
|
|
@@ -1116,14 +1150,14 @@
|
|
|
1116
1150
|
"relativePath": [
|
|
1117
1151
|
"dist",
|
|
1118
1152
|
"commands",
|
|
1119
|
-
"
|
|
1153
|
+
"datasets",
|
|
1120
1154
|
"get.js"
|
|
1121
1155
|
]
|
|
1122
1156
|
},
|
|
1123
|
-
"
|
|
1157
|
+
"datasets:list": {
|
|
1124
1158
|
"aliases": [],
|
|
1125
1159
|
"args": {},
|
|
1126
|
-
"description": "List
|
|
1160
|
+
"description": "List datasets",
|
|
1127
1161
|
"flags": {
|
|
1128
1162
|
"api-key": {
|
|
1129
1163
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -1162,7 +1196,7 @@
|
|
|
1162
1196
|
"limit": {
|
|
1163
1197
|
"description": "Number of results per page",
|
|
1164
1198
|
"name": "limit",
|
|
1165
|
-
"default":
|
|
1199
|
+
"default": 50,
|
|
1166
1200
|
"hasDynamicHelp": false,
|
|
1167
1201
|
"multiple": false,
|
|
1168
1202
|
"type": "option"
|
|
@@ -1178,7 +1212,7 @@
|
|
|
1178
1212
|
},
|
|
1179
1213
|
"hasDynamicHelp": false,
|
|
1180
1214
|
"hiddenAliases": [],
|
|
1181
|
-
"id": "
|
|
1215
|
+
"id": "datasets:list",
|
|
1182
1216
|
"pluginAlias": "@respan/cli",
|
|
1183
1217
|
"pluginName": "@respan/cli",
|
|
1184
1218
|
"pluginType": "core",
|
|
@@ -1188,20 +1222,20 @@
|
|
|
1188
1222
|
"relativePath": [
|
|
1189
1223
|
"dist",
|
|
1190
1224
|
"commands",
|
|
1191
|
-
"
|
|
1225
|
+
"datasets",
|
|
1192
1226
|
"list.js"
|
|
1193
1227
|
]
|
|
1194
1228
|
},
|
|
1195
|
-
"
|
|
1229
|
+
"datasets:spans": {
|
|
1196
1230
|
"aliases": [],
|
|
1197
1231
|
"args": {
|
|
1198
|
-
"id": {
|
|
1199
|
-
"description": "
|
|
1200
|
-
"name": "id",
|
|
1232
|
+
"dataset-id": {
|
|
1233
|
+
"description": "Dataset ID",
|
|
1234
|
+
"name": "dataset-id",
|
|
1201
1235
|
"required": true
|
|
1202
1236
|
}
|
|
1203
1237
|
},
|
|
1204
|
-
"description": "
|
|
1238
|
+
"description": "List spans in a dataset",
|
|
1205
1239
|
"flags": {
|
|
1206
1240
|
"api-key": {
|
|
1207
1241
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -1236,32 +1270,11 @@
|
|
|
1236
1270
|
"name": "verbose",
|
|
1237
1271
|
"allowNo": false,
|
|
1238
1272
|
"type": "boolean"
|
|
1239
|
-
},
|
|
1240
|
-
"dataset-id": {
|
|
1241
|
-
"description": "Dataset ID to evaluate against",
|
|
1242
|
-
"name": "dataset-id",
|
|
1243
|
-
"hasDynamicHelp": false,
|
|
1244
|
-
"multiple": false,
|
|
1245
|
-
"type": "option"
|
|
1246
|
-
},
|
|
1247
|
-
"log-ids": {
|
|
1248
|
-
"description": "Comma-separated log/span IDs to evaluate",
|
|
1249
|
-
"name": "log-ids",
|
|
1250
|
-
"hasDynamicHelp": false,
|
|
1251
|
-
"multiple": false,
|
|
1252
|
-
"type": "option"
|
|
1253
|
-
},
|
|
1254
|
-
"params": {
|
|
1255
|
-
"description": "Additional parameters as JSON string",
|
|
1256
|
-
"name": "params",
|
|
1257
|
-
"hasDynamicHelp": false,
|
|
1258
|
-
"multiple": false,
|
|
1259
|
-
"type": "option"
|
|
1260
1273
|
}
|
|
1261
1274
|
},
|
|
1262
1275
|
"hasDynamicHelp": false,
|
|
1263
1276
|
"hiddenAliases": [],
|
|
1264
|
-
"id": "
|
|
1277
|
+
"id": "datasets:spans",
|
|
1265
1278
|
"pluginAlias": "@respan/cli",
|
|
1266
1279
|
"pluginName": "@respan/cli",
|
|
1267
1280
|
"pluginType": "core",
|
|
@@ -1271,20 +1284,20 @@
|
|
|
1271
1284
|
"relativePath": [
|
|
1272
1285
|
"dist",
|
|
1273
1286
|
"commands",
|
|
1274
|
-
"
|
|
1275
|
-
"
|
|
1287
|
+
"datasets",
|
|
1288
|
+
"spans.js"
|
|
1276
1289
|
]
|
|
1277
1290
|
},
|
|
1278
|
-
"
|
|
1291
|
+
"datasets:update": {
|
|
1279
1292
|
"aliases": [],
|
|
1280
1293
|
"args": {
|
|
1281
1294
|
"id": {
|
|
1282
|
-
"description": "
|
|
1295
|
+
"description": "Dataset ID",
|
|
1283
1296
|
"name": "id",
|
|
1284
1297
|
"required": true
|
|
1285
1298
|
}
|
|
1286
1299
|
},
|
|
1287
|
-
"description": "Update
|
|
1300
|
+
"description": "Update a dataset",
|
|
1288
1301
|
"flags": {
|
|
1289
1302
|
"api-key": {
|
|
1290
1303
|
"description": "API key (env: RESPAN_API_KEY)",
|
|
@@ -1321,30 +1334,23 @@
|
|
|
1321
1334
|
"type": "boolean"
|
|
1322
1335
|
},
|
|
1323
1336
|
"name": {
|
|
1324
|
-
"description": "
|
|
1337
|
+
"description": "Dataset name",
|
|
1325
1338
|
"name": "name",
|
|
1326
1339
|
"hasDynamicHelp": false,
|
|
1327
1340
|
"multiple": false,
|
|
1328
1341
|
"type": "option"
|
|
1329
1342
|
},
|
|
1330
1343
|
"description": {
|
|
1331
|
-
"description": "
|
|
1344
|
+
"description": "Dataset description",
|
|
1332
1345
|
"name": "description",
|
|
1333
1346
|
"hasDynamicHelp": false,
|
|
1334
1347
|
"multiple": false,
|
|
1335
1348
|
"type": "option"
|
|
1336
|
-
},
|
|
1337
|
-
"config": {
|
|
1338
|
-
"description": "Evaluator config as JSON string",
|
|
1339
|
-
"name": "config",
|
|
1340
|
-
"hasDynamicHelp": false,
|
|
1341
|
-
"multiple": false,
|
|
1342
|
-
"type": "option"
|
|
1343
1349
|
}
|
|
1344
1350
|
},
|
|
1345
1351
|
"hasDynamicHelp": false,
|
|
1346
1352
|
"hiddenAliases": [],
|
|
1347
|
-
"id": "
|
|
1353
|
+
"id": "datasets:update",
|
|
1348
1354
|
"pluginAlias": "@respan/cli",
|
|
1349
1355
|
"pluginName": "@respan/cli",
|
|
1350
1356
|
"pluginType": "core",
|
|
@@ -1354,7 +1360,7 @@
|
|
|
1354
1360
|
"relativePath": [
|
|
1355
1361
|
"dist",
|
|
1356
1362
|
"commands",
|
|
1357
|
-
"
|
|
1363
|
+
"datasets",
|
|
1358
1364
|
"update.js"
|
|
1359
1365
|
]
|
|
1360
1366
|
},
|
|
@@ -2882,5 +2888,5 @@
|
|
|
2882
2888
|
]
|
|
2883
2889
|
}
|
|
2884
2890
|
},
|
|
2885
|
-
"version": "0.
|
|
2891
|
+
"version": "0.3.0"
|
|
2886
2892
|
}
|