@wayai/cli 0.3.40 → 0.3.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.
- package/dist/index.js +16920 -310
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/dist/commands/admin.d.ts +0 -1
- package/dist/commands/admin.js +0 -913
- package/dist/commands/admin.js.map +0 -1
- package/dist/commands/analytics.d.ts +0 -34
- package/dist/commands/analytics.js +0 -605
- package/dist/commands/analytics.js.map +0 -1
- package/dist/commands/conversations.d.ts +0 -14
- package/dist/commands/conversations.js +0 -292
- package/dist/commands/conversations.js.map +0 -1
- package/dist/commands/create-credential.d.ts +0 -20
- package/dist/commands/create-credential.js +0 -146
- package/dist/commands/create-credential.js.map +0 -1
- package/dist/commands/delete-history.d.ts +0 -15
- package/dist/commands/delete-history.js +0 -56
- package/dist/commands/delete-history.js.map +0 -1
- package/dist/commands/eval-capture.d.ts +0 -1
- package/dist/commands/eval-capture.js +0 -135
- package/dist/commands/eval-capture.js.map +0 -1
- package/dist/commands/eval-results.d.ts +0 -10
- package/dist/commands/eval-results.js +0 -168
- package/dist/commands/eval-results.js.map +0 -1
- package/dist/commands/eval.d.ts +0 -1
- package/dist/commands/eval.js +0 -49
- package/dist/commands/eval.js.map +0 -1
- package/dist/commands/evals.d.ts +0 -21
- package/dist/commands/evals.js +0 -120
- package/dist/commands/evals.js.map +0 -1
- package/dist/commands/init.d.ts +0 -16
- package/dist/commands/init.js +0 -191
- package/dist/commands/init.js.map +0 -1
- package/dist/commands/list.d.ts +0 -13
- package/dist/commands/list.js +0 -70
- package/dist/commands/list.js.map +0 -1
- package/dist/commands/login.d.ts +0 -8
- package/dist/commands/login.js +0 -145
- package/dist/commands/login.js.map +0 -1
- package/dist/commands/logout.d.ts +0 -1
- package/dist/commands/logout.js +0 -19
- package/dist/commands/logout.js.map +0 -1
- package/dist/commands/migrate.d.ts +0 -12
- package/dist/commands/migrate.js +0 -106
- package/dist/commands/migrate.js.map +0 -1
- package/dist/commands/observability.d.ts +0 -14
- package/dist/commands/observability.js +0 -124
- package/dist/commands/observability.js.map +0 -1
- package/dist/commands/org.d.ts +0 -19
- package/dist/commands/org.js +0 -186
- package/dist/commands/org.js.map +0 -1
- package/dist/commands/pull.d.ts +0 -31
- package/dist/commands/pull.js +0 -210
- package/dist/commands/pull.js.map +0 -1
- package/dist/commands/push.d.ts +0 -25
- package/dist/commands/push.js +0 -472
- package/dist/commands/push.js.map +0 -1
- package/dist/commands/report-create.d.ts +0 -18
- package/dist/commands/report-create.js +0 -143
- package/dist/commands/report-create.js.map +0 -1
- package/dist/commands/report.d.ts +0 -16
- package/dist/commands/report.js +0 -252
- package/dist/commands/report.js.map +0 -1
- package/dist/commands/run-eval.d.ts +0 -15
- package/dist/commands/run-eval.js +0 -187
- package/dist/commands/run-eval.js.map +0 -1
- package/dist/commands/send-message.d.ts +0 -11
- package/dist/commands/send-message.js +0 -63
- package/dist/commands/send-message.js.map +0 -1
- package/dist/commands/status.d.ts +0 -17
- package/dist/commands/status.js +0 -205
- package/dist/commands/status.js.map +0 -1
- package/dist/commands/sync-mcp.d.ts +0 -16
- package/dist/commands/sync-mcp.js +0 -51
- package/dist/commands/sync-mcp.js.map +0 -1
- package/dist/commands/sync-skills.d.ts +0 -10
- package/dist/commands/sync-skills.js +0 -49
- package/dist/commands/sync-skills.js.map +0 -1
- package/dist/commands/unlock.d.ts +0 -1
- package/dist/commands/unlock.js +0 -13
- package/dist/commands/unlock.js.map +0 -1
- package/dist/commands/update-credential.d.ts +0 -29
- package/dist/commands/update-credential.js +0 -156
- package/dist/commands/update-credential.js.map +0 -1
- package/dist/commands/update.d.ts +0 -6
- package/dist/commands/update.js +0 -36
- package/dist/commands/update.js.map +0 -1
- package/dist/commands/use.d.ts +0 -1
- package/dist/commands/use.js +0 -56
- package/dist/commands/use.js.map +0 -1
- package/dist/commands/whoami.d.ts +0 -11
- package/dist/commands/whoami.js +0 -30
- package/dist/commands/whoami.js.map +0 -1
- package/dist/index.d.ts +0 -28
- package/dist/lib/analytics-constants.d.ts +0 -6
- package/dist/lib/analytics-constants.js +0 -14
- package/dist/lib/analytics-constants.js.map +0 -1
- package/dist/lib/api-client.d.ts +0 -568
- package/dist/lib/api-client.js +0 -445
- package/dist/lib/api-client.js.map +0 -1
- package/dist/lib/auth.d.ts +0 -50
- package/dist/lib/auth.js +0 -230
- package/dist/lib/auth.js.map +0 -1
- package/dist/lib/config.d.ts +0 -34
- package/dist/lib/config.js +0 -69
- package/dist/lib/config.js.map +0 -1
- package/dist/lib/credential-utils.d.ts +0 -36
- package/dist/lib/credential-utils.js +0 -88
- package/dist/lib/credential-utils.js.map +0 -1
- package/dist/lib/diff-display.d.ts +0 -8
- package/dist/lib/diff-display.js +0 -37
- package/dist/lib/diff-display.js.map +0 -1
- package/dist/lib/eval-format.d.ts +0 -29
- package/dist/lib/eval-format.js +0 -44
- package/dist/lib/eval-format.js.map +0 -1
- package/dist/lib/hub-lock.d.ts +0 -7
- package/dist/lib/hub-lock.js +0 -116
- package/dist/lib/hub-lock.js.map +0 -1
- package/dist/lib/layout.d.ts +0 -79
- package/dist/lib/layout.js +0 -133
- package/dist/lib/layout.js.map +0 -1
- package/dist/lib/org-workspace.d.ts +0 -22
- package/dist/lib/org-workspace.js +0 -106
- package/dist/lib/org-workspace.js.map +0 -1
- package/dist/lib/parser.d.ts +0 -16
- package/dist/lib/parser.js +0 -306
- package/dist/lib/parser.js.map +0 -1
- package/dist/lib/repo-config.d.ts +0 -23
- package/dist/lib/repo-config.js +0 -91
- package/dist/lib/repo-config.js.map +0 -1
- package/dist/lib/report-edit-args.d.ts +0 -27
- package/dist/lib/report-edit-args.js +0 -56
- package/dist/lib/report-edit-args.js.map +0 -1
- package/dist/lib/report-inbox.d.ts +0 -19
- package/dist/lib/report-inbox.js +0 -73
- package/dist/lib/report-inbox.js.map +0 -1
- package/dist/lib/resource-files.d.ts +0 -29
- package/dist/lib/resource-files.js +0 -156
- package/dist/lib/resource-files.js.map +0 -1
- package/dist/lib/sentry.d.ts +0 -38
- package/dist/lib/sentry.js +0 -168
- package/dist/lib/sentry.js.map +0 -1
- package/dist/lib/skill-version.d.ts +0 -9
- package/dist/lib/skill-version.js +0 -53
- package/dist/lib/skill-version.js.map +0 -1
- package/dist/lib/sql-output.d.ts +0 -17
- package/dist/lib/sql-output.js +0 -48
- package/dist/lib/sql-output.js.map +0 -1
- package/dist/lib/token-store.d.ts +0 -37
- package/dist/lib/token-store.js +0 -354
- package/dist/lib/token-store.js.map +0 -1
- package/dist/lib/types.d.ts +0 -18
- package/dist/lib/types.js +0 -5
- package/dist/lib/types.js.map +0 -1
- package/dist/lib/utils.d.ts +0 -97
- package/dist/lib/utils.js +0 -288
- package/dist/lib/utils.js.map +0 -1
- package/dist/lib/version-cache.d.ts +0 -10
- package/dist/lib/version-cache.js +0 -34
- package/dist/lib/version-cache.js.map +0 -1
- package/dist/lib/workspace.d.ts +0 -112
- package/dist/lib/workspace.js +0 -387
- package/dist/lib/workspace.js.map +0 -1
- package/dist/lib/yaml-writer.d.ts +0 -18
- package/dist/lib/yaml-writer.js +0 -283
- package/dist/lib/yaml-writer.js.map +0 -1
package/dist/lib/auth.js
DELETED
|
@@ -1,230 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Authentication — OAuth 2.1 + PKCE browser login + way_ token fallback
|
|
3
|
-
*
|
|
4
|
-
* Two login paths:
|
|
5
|
-
* 1. Browser login (default): OAuth 2.1 with PKCE → JWT + refresh token
|
|
6
|
-
* 2. Token login (--token): User pastes a way_ scoped token directly
|
|
7
|
-
*
|
|
8
|
-
* The CLI exchanges codes directly with AuthKit's token endpoint.
|
|
9
|
-
*/
|
|
10
|
-
import * as crypto from 'node:crypto';
|
|
11
|
-
import * as http from 'node:http';
|
|
12
|
-
import { readConfig, writeConfig } from './config.js';
|
|
13
|
-
import { getToken, setOAuthTokens, clearTokens, migrateLegacyTokens } from './token-store.js';
|
|
14
|
-
import { setSentryUser } from './sentry.js';
|
|
15
|
-
// =============================================================================
|
|
16
|
-
// PKCE Utilities
|
|
17
|
-
// =============================================================================
|
|
18
|
-
export function generateCodeVerifier() {
|
|
19
|
-
return crypto.randomBytes(32).toString('base64url');
|
|
20
|
-
}
|
|
21
|
-
export async function generateCodeChallenge(verifier) {
|
|
22
|
-
const hash = crypto.createHash('sha256').update(verifier).digest();
|
|
23
|
-
return hash.toString('base64url');
|
|
24
|
-
}
|
|
25
|
-
export function generateState() {
|
|
26
|
-
return crypto.randomBytes(16).toString('base64url');
|
|
27
|
-
}
|
|
28
|
-
// =============================================================================
|
|
29
|
-
// AuthKit Token Exchange
|
|
30
|
-
// =============================================================================
|
|
31
|
-
/**
|
|
32
|
-
* Convert a token lifetime in seconds (as returned by AuthKit) into an absolute
|
|
33
|
-
* ISO 8601 timestamp suitable for `token_expires_at` in the CLI config.
|
|
34
|
-
*/
|
|
35
|
-
export function expiresInToIso(expiresInSeconds) {
|
|
36
|
-
return new Date(Date.now() + expiresInSeconds * 1000).toISOString();
|
|
37
|
-
}
|
|
38
|
-
export async function exchangeCodeForTokens(authkitDomain, clientId, code, codeVerifier, redirectUri) {
|
|
39
|
-
const response = await fetch(`${authkitDomain}/oauth2/token`, {
|
|
40
|
-
method: 'POST',
|
|
41
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
42
|
-
body: new URLSearchParams({
|
|
43
|
-
grant_type: 'authorization_code',
|
|
44
|
-
code,
|
|
45
|
-
code_verifier: codeVerifier,
|
|
46
|
-
redirect_uri: redirectUri,
|
|
47
|
-
client_id: clientId,
|
|
48
|
-
}).toString(),
|
|
49
|
-
});
|
|
50
|
-
if (!response.ok) {
|
|
51
|
-
const body = await response.text();
|
|
52
|
-
throw new Error(`Token exchange failed (${response.status}): ${body}`);
|
|
53
|
-
}
|
|
54
|
-
return response.json();
|
|
55
|
-
}
|
|
56
|
-
export async function refreshAccessToken(authkitDomain, clientId, refreshToken) {
|
|
57
|
-
const response = await fetch(`${authkitDomain}/oauth2/token`, {
|
|
58
|
-
method: 'POST',
|
|
59
|
-
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
|
|
60
|
-
body: new URLSearchParams({
|
|
61
|
-
grant_type: 'refresh_token',
|
|
62
|
-
refresh_token: refreshToken,
|
|
63
|
-
client_id: clientId,
|
|
64
|
-
}).toString(),
|
|
65
|
-
});
|
|
66
|
-
if (!response.ok) {
|
|
67
|
-
const status = response.status;
|
|
68
|
-
const body = await response.text();
|
|
69
|
-
if (status === 400 || status === 401) {
|
|
70
|
-
let isInvalidGrant = false;
|
|
71
|
-
try {
|
|
72
|
-
const parsed = JSON.parse(body);
|
|
73
|
-
if (parsed.error === 'invalid_grant')
|
|
74
|
-
isInvalidGrant = true;
|
|
75
|
-
}
|
|
76
|
-
catch { /* non-JSON body */ }
|
|
77
|
-
if (isInvalidGrant)
|
|
78
|
-
throw new Error('SESSION_EXPIRED');
|
|
79
|
-
}
|
|
80
|
-
throw new Error(`Token refresh failed (${status}): ${body}`);
|
|
81
|
-
}
|
|
82
|
-
return response.json();
|
|
83
|
-
}
|
|
84
|
-
export async function validateToken(apiUrl, token) {
|
|
85
|
-
const response = await fetch(`${apiUrl}/api/auth/me`, {
|
|
86
|
-
headers: { Authorization: `Bearer ${token}` },
|
|
87
|
-
});
|
|
88
|
-
if (!response.ok) {
|
|
89
|
-
throw new Error(`Token validation failed (${response.status})`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
// =============================================================================
|
|
93
|
-
// Callback Server
|
|
94
|
-
// =============================================================================
|
|
95
|
-
/** Fixed port for OAuth callback — must match the redirect URI registered in WorkOS */
|
|
96
|
-
export const OAUTH_CALLBACK_PORT = 3829;
|
|
97
|
-
export function startCallbackServer(port, expectedState, timeoutMs = 120_000) {
|
|
98
|
-
return new Promise((resolve, reject) => {
|
|
99
|
-
const server = http.createServer((req, res) => {
|
|
100
|
-
const url = new URL(req.url || '/', `http://127.0.0.1:${port}`);
|
|
101
|
-
if (url.pathname === '/callback') {
|
|
102
|
-
const code = url.searchParams.get('code');
|
|
103
|
-
const state = url.searchParams.get('state');
|
|
104
|
-
const error = url.searchParams.get('error');
|
|
105
|
-
const errorDescription = url.searchParams.get('error_description');
|
|
106
|
-
if (error) {
|
|
107
|
-
res.writeHead(400, { 'Content-Type': 'text/html' });
|
|
108
|
-
res.end(`<html><body><h2>Login failed</h2><p>${errorDescription || error}</p></body></html>`);
|
|
109
|
-
server.close();
|
|
110
|
-
reject(new Error(`OAuth callback error: ${errorDescription || error}`));
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (state !== expectedState) {
|
|
114
|
-
res.writeHead(400, { 'Content-Type': 'text/html' });
|
|
115
|
-
res.end('<html><body><h2>Login failed</h2><p>Invalid state parameter</p></body></html>');
|
|
116
|
-
server.close();
|
|
117
|
-
reject(new Error('OAuth state mismatch — possible CSRF attack'));
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
if (code) {
|
|
121
|
-
res.writeHead(200, { 'Content-Type': 'text/html' });
|
|
122
|
-
res.end('<html><body><h2>Login successful!</h2><p>You can close this tab and return to your terminal.</p></body></html>');
|
|
123
|
-
server.close();
|
|
124
|
-
resolve({ code, port });
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
res.writeHead(400, { 'Content-Type': 'text/html' });
|
|
128
|
-
res.end('<html><body><h2>Login failed</h2><p>No authorization code received</p></body></html>');
|
|
129
|
-
server.close();
|
|
130
|
-
reject(new Error('No authorization code received'));
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
else {
|
|
134
|
-
res.writeHead(404);
|
|
135
|
-
res.end();
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
const timeout = setTimeout(() => {
|
|
139
|
-
server.close();
|
|
140
|
-
reject(new Error('Timed out waiting for login. Run `wayai login` again.'));
|
|
141
|
-
}, timeoutMs);
|
|
142
|
-
server.on('close', () => clearTimeout(timeout));
|
|
143
|
-
server.listen(port, '127.0.0.1');
|
|
144
|
-
server.on('error', (err) => {
|
|
145
|
-
if (err.code === 'EADDRINUSE') {
|
|
146
|
-
reject(new Error(`Port ${port} is in use. Try again.`));
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
reject(err);
|
|
150
|
-
}
|
|
151
|
-
});
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
// =============================================================================
|
|
155
|
-
// Token Resolution (for API calls)
|
|
156
|
-
// =============================================================================
|
|
157
|
-
const AUTHKIT_DOMAIN = 'https://sprightly-comic-51.authkit.app';
|
|
158
|
-
const AUTHKIT_CLIENT_ID = 'client_01KMZHB50KENM5SV90ZA80VXK4'; // WayAI CLI Connect app (public, PKCE)
|
|
159
|
-
export function getAuthKitDomain() {
|
|
160
|
-
return process.env.WAYAI_AUTHKIT_DOMAIN || AUTHKIT_DOMAIN;
|
|
161
|
-
}
|
|
162
|
-
export function getAuthKitClientId() {
|
|
163
|
-
return process.env.WAYAI_AUTHKIT_CLIENT_ID || AUTHKIT_CLIENT_ID;
|
|
164
|
-
}
|
|
165
|
-
/**
|
|
166
|
-
* Get a valid access token. Reads from the keyring (or env/file fallback) and
|
|
167
|
-
* handles OAuth refresh transparently when nearing expiry.
|
|
168
|
-
*
|
|
169
|
-
* `config` is passed in for `api_url` access and to support the SESSION_EXPIRED
|
|
170
|
-
* recovery path. Token data does NOT live in config anymore — it's resolved
|
|
171
|
-
* from token-store.
|
|
172
|
-
*/
|
|
173
|
-
export async function getAccessToken(config) {
|
|
174
|
-
// One-time migration from legacy plaintext config (versions < 0.4.0). Idempotent.
|
|
175
|
-
await migrateLegacyTokens();
|
|
176
|
-
const resolved = await getToken();
|
|
177
|
-
if (!resolved) {
|
|
178
|
-
throw new Error('No token found. Run `wayai login` to authenticate.');
|
|
179
|
-
}
|
|
180
|
-
// way_ token path — no refresh needed
|
|
181
|
-
if (resolved.kind === 'way') {
|
|
182
|
-
return resolved.token;
|
|
183
|
-
}
|
|
184
|
-
// OAuth JWT path — check expiry and refresh if needed
|
|
185
|
-
const expiresAt = resolved.expires_at;
|
|
186
|
-
if (!expiresAt) {
|
|
187
|
-
return resolved.access_token;
|
|
188
|
-
}
|
|
189
|
-
if (new Date(expiresAt).getTime() > Date.now() + 60_000) {
|
|
190
|
-
return resolved.access_token;
|
|
191
|
-
}
|
|
192
|
-
if (!resolved.refresh_token) {
|
|
193
|
-
throw new Error('Access token expired and no refresh token available. Run `wayai login` again.');
|
|
194
|
-
}
|
|
195
|
-
// Token expired — refresh
|
|
196
|
-
try {
|
|
197
|
-
const result = await refreshAccessToken(getAuthKitDomain(), getAuthKitClientId(), resolved.refresh_token);
|
|
198
|
-
const newExpiresAt = expiresInToIso(result.expires_in);
|
|
199
|
-
// setOAuthTokens persists token_expires_at to the metadata file — no need to
|
|
200
|
-
// writeConfig again here (would double-write the same file).
|
|
201
|
-
await setOAuthTokens(result.access_token, result.refresh_token ?? resolved.refresh_token, newExpiresAt);
|
|
202
|
-
return result.access_token;
|
|
203
|
-
}
|
|
204
|
-
catch (err) {
|
|
205
|
-
if (err instanceof Error && err.message === 'SESSION_EXPIRED') {
|
|
206
|
-
await clearTokens();
|
|
207
|
-
writeConfig({ api_url: config.api_url });
|
|
208
|
-
throw new Error('Session expired. Please run `wayai login` again.');
|
|
209
|
-
}
|
|
210
|
-
throw err;
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
export async function requireAuth() {
|
|
214
|
-
const config = readConfig();
|
|
215
|
-
if (!config) {
|
|
216
|
-
console.error('Not logged in. Run `wayai login` first.');
|
|
217
|
-
process.exit(1);
|
|
218
|
-
}
|
|
219
|
-
try {
|
|
220
|
-
const accessToken = await getAccessToken(config);
|
|
221
|
-
setSentryUser(accessToken);
|
|
222
|
-
return { config, accessToken };
|
|
223
|
-
}
|
|
224
|
-
catch (err) {
|
|
225
|
-
console.error(`Authentication failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
226
|
-
console.error('Run `wayai login` to re-authenticate.');
|
|
227
|
-
process.exit(1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AAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC5F,OAAO,CAAC,KAAK,CAAC,uCAAuC,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
package/dist/lib/config.d.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI configuration — non-secret metadata at ~/.wayai/config.json.
|
|
3
|
-
*
|
|
4
|
-
* Tokens themselves live in the OS keyring (see token-store.ts). This file
|
|
5
|
-
* holds only metadata that survives a logout/login cycle gracefully if needed.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Non-secret CLI configuration. Token fields removed in v0.4.0 — they now live
|
|
9
|
-
* in the OS keyring. token_expires_at is metadata (timestamp, not a secret) and
|
|
10
|
-
* stays here so the refresh path can decide when to refresh without unlocking
|
|
11
|
-
* the keyring just to read the expiry.
|
|
12
|
-
*/
|
|
13
|
-
export interface CliConfig {
|
|
14
|
-
api_url: string;
|
|
15
|
-
/** ISO 8601 expiry of the OAuth access token (metadata, not secret). */
|
|
16
|
-
token_expires_at?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Report-action nudge dedup keys the user has already been nudged about, so the login/status
|
|
19
|
-
* reminder fires once per notifiable event. Shipped keys are `<report_id>:shipped:<contest_count>`
|
|
20
|
-
* (one per shipment — a re-shipped fix re-nudges, matching the re-firing shipped email); dismissed
|
|
21
|
-
* keys are `<report_id>:dismissed` (once-ever, matching the once-ever dismissed email). Capped to
|
|
22
|
-
* the most-recent entries by the writer.
|
|
23
|
-
*/
|
|
24
|
-
nudged_report_ids?: string[];
|
|
25
|
-
}
|
|
26
|
-
export declare function getConfigPath(): string;
|
|
27
|
-
/**
|
|
28
|
-
* Read the metadata config. Tokens are NOT included — fetch them via
|
|
29
|
-
* `getToken()` from token-store. Returns null only when the user has never
|
|
30
|
-
* logged in (no config file at all).
|
|
31
|
-
*/
|
|
32
|
-
export declare function readConfig(): CliConfig | null;
|
|
33
|
-
export declare function writeConfig(config: CliConfig): void;
|
|
34
|
-
export declare function deleteConfig(): void;
|
package/dist/lib/config.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* CLI configuration — non-secret metadata at ~/.wayai/config.json.
|
|
3
|
-
*
|
|
4
|
-
* Tokens themselves live in the OS keyring (see token-store.ts). This file
|
|
5
|
-
* holds only metadata that survives a logout/login cycle gracefully if needed.
|
|
6
|
-
*/
|
|
7
|
-
import * as fs from 'node:fs';
|
|
8
|
-
import * as path from 'node:path';
|
|
9
|
-
import * as os from 'node:os';
|
|
10
|
-
// Resolved per-call so tests can redirect via $HOME and any runtime HOME change
|
|
11
|
-
// (e.g., su -) is picked up. Frozen module-level constants previously made tests
|
|
12
|
-
// write to the user's real ~/.wayai/.
|
|
13
|
-
function configDir() { return path.join(os.homedir(), '.wayai'); }
|
|
14
|
-
function configPath() { return path.join(configDir(), 'config.json'); }
|
|
15
|
-
export function getConfigPath() {
|
|
16
|
-
return configPath();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Read the metadata config. Tokens are NOT included — fetch them via
|
|
20
|
-
* `getToken()` from token-store. Returns null only when the user has never
|
|
21
|
-
* logged in (no config file at all).
|
|
22
|
-
*/
|
|
23
|
-
export function readConfig() {
|
|
24
|
-
if (!fs.existsSync(configPath()))
|
|
25
|
-
return null;
|
|
26
|
-
try {
|
|
27
|
-
const content = fs.readFileSync(configPath(), 'utf-8');
|
|
28
|
-
const parsed = JSON.parse(content);
|
|
29
|
-
if (!parsed.api_url)
|
|
30
|
-
return null;
|
|
31
|
-
return {
|
|
32
|
-
api_url: parsed.api_url,
|
|
33
|
-
token_expires_at: parsed.token_expires_at,
|
|
34
|
-
nudged_report_ids: Array.isArray(parsed.nudged_report_ids)
|
|
35
|
-
? parsed.nudged_report_ids.filter((x) => typeof x === 'string')
|
|
36
|
-
: undefined,
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
catch {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
export function writeConfig(config) {
|
|
44
|
-
if (!fs.existsSync(configDir())) {
|
|
45
|
-
fs.mkdirSync(configDir(), { recursive: true });
|
|
46
|
-
}
|
|
47
|
-
// Preserve any existing metadata fields (e.g., user_id) that may be added later.
|
|
48
|
-
let existing = {};
|
|
49
|
-
if (fs.existsSync(configPath())) {
|
|
50
|
-
try {
|
|
51
|
-
existing = JSON.parse(fs.readFileSync(configPath(), 'utf-8'));
|
|
52
|
-
}
|
|
53
|
-
catch { /* corrupt — overwrite */ }
|
|
54
|
-
}
|
|
55
|
-
// Drop any legacy plaintext token fields that may still be present.
|
|
56
|
-
delete existing.token;
|
|
57
|
-
delete existing.access_token;
|
|
58
|
-
delete existing.refresh_token;
|
|
59
|
-
Object.assign(existing, config);
|
|
60
|
-
fs.writeFileSync(configPath(), JSON.stringify(existing, null, 2) + '\n', {
|
|
61
|
-
mode: 0o600, // owner-only read/write
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
export function deleteConfig() {
|
|
65
|
-
if (fs.existsSync(configPath())) {
|
|
66
|
-
fs.unlinkSync(configPath());
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
//# sourceMappingURL=config.js.map
|
package/dist/lib/config.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/lib/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAsB9B,gFAAgF;AAChF,iFAAiF;AACjF,sCAAsC;AACtC,SAAS,SAAS,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE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CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;QAChC,IAAI,CAAC;YACH,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;QAChE,CAAC;QAAC,MAAM,CAAC,CAAC,yBAAyB,CAAC,CAAC;IACvC,CAAC;IACD,oEAAoE;IACpE,OAAO,QAAQ,CAAC,KAAK,CAAC;IACtB,OAAO,QAAQ,CAAC,YAAY,CAAC;IAC7B,OAAO,QAAQ,CAAC,aAAa,CAAC;IAE9B,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAEhC,EAAE,CAAC,aAAa,CAAC,UAAU,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,EAAE;QACvE,IAAI,EAAE,KAAK,EAAE,wBAAwB;KACtC,CAAC,CAAC;AACL,CAAC;AAED,MAAM,UAAU,YAAY;IAC1B,IAAI,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,EAAE,CAAC;QAChC,EAAE,CAAC,UAAU,CAAC,UAAU,EAAE,CAAC,CAAC;IAC9B,CAAC;AACH,CAAC"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers for the org-credential CLI commands (create-credential,
|
|
3
|
-
* update-credential).
|
|
4
|
-
*/
|
|
5
|
-
export declare const VALID_AUTH_TYPES: readonly ["api_key", "bearer", "basic_auth"];
|
|
6
|
-
export type AuthType = typeof VALID_AUTH_TYPES[number];
|
|
7
|
-
/** Maps legacy display names to canonical lowercase codes for backward compat. */
|
|
8
|
-
export declare const LEGACY_AUTH_TYPE_MAP: Record<string, AuthType>;
|
|
9
|
-
/** Normalize a user-supplied auth type, accepting legacy display names. */
|
|
10
|
-
export declare function normalizeCliAuthType(type: string): AuthType | null;
|
|
11
|
-
export declare const VALID_ENVIRONMENTS: readonly ["preview", "production", "all"];
|
|
12
|
-
export type Environment = typeof VALID_ENVIRONMENTS[number];
|
|
13
|
-
/** Validate a user-supplied credential environment; returns null when invalid. */
|
|
14
|
-
export declare function normalizeCliEnvironment(env: string): Environment | null;
|
|
15
|
-
/**
|
|
16
|
-
* Map a single secret string (read from stdin) to the credential body fields
|
|
17
|
-
* the backend expects for the given auth type. Basic Auth expects
|
|
18
|
-
* `username:password`. Throws on malformed Basic Auth input.
|
|
19
|
-
*/
|
|
20
|
-
export declare function mapSecretToCredentialFields(authType: AuthType, secret: string): Record<string, string>;
|
|
21
|
-
export interface OrgTagLike {
|
|
22
|
-
tag_id: string;
|
|
23
|
-
name: string;
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Resolve a list of tag references (names, or raw tag UUIDs) to tag UUIDs using
|
|
27
|
-
* the org's tag registry. Accepts names primarily (the human-facing identifier);
|
|
28
|
-
* a value that is already a known tag_id passes through. Unknown references throw
|
|
29
|
-
* with the list of available tag names. Empty/whitespace entries are skipped.
|
|
30
|
-
*/
|
|
31
|
-
export declare function resolveTagIds(tagRefs: string[], orgTags: OrgTagLike[]): string[];
|
|
32
|
-
/**
|
|
33
|
-
* Split repeatable + comma-separated `--tag` values into a flat list of refs.
|
|
34
|
-
* `['a,b', 'c']` → `['a', 'b', 'c']`.
|
|
35
|
-
*/
|
|
36
|
-
export declare function splitTagRefs(rawValues: string[]): string[];
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers for the org-credential CLI commands (create-credential,
|
|
3
|
-
* update-credential).
|
|
4
|
-
*/
|
|
5
|
-
export const VALID_AUTH_TYPES = ['api_key', 'bearer', 'basic_auth'];
|
|
6
|
-
/** Maps legacy display names to canonical lowercase codes for backward compat. */
|
|
7
|
-
export const LEGACY_AUTH_TYPE_MAP = {
|
|
8
|
-
'API Key': 'api_key',
|
|
9
|
-
'Bearer Token': 'bearer',
|
|
10
|
-
'Basic Auth': 'basic_auth',
|
|
11
|
-
};
|
|
12
|
-
/** Normalize a user-supplied auth type, accepting legacy display names. */
|
|
13
|
-
export function normalizeCliAuthType(type) {
|
|
14
|
-
const normalized = LEGACY_AUTH_TYPE_MAP[type] ?? type;
|
|
15
|
-
return VALID_AUTH_TYPES.includes(normalized) ? normalized : null;
|
|
16
|
-
}
|
|
17
|
-
export const VALID_ENVIRONMENTS = ['preview', 'production', 'all'];
|
|
18
|
-
/** Validate a user-supplied credential environment; returns null when invalid. */
|
|
19
|
-
export function normalizeCliEnvironment(env) {
|
|
20
|
-
return VALID_ENVIRONMENTS.includes(env) ? env : null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Map a single secret string (read from stdin) to the credential body fields
|
|
24
|
-
* the backend expects for the given auth type. Basic Auth expects
|
|
25
|
-
* `username:password`. Throws on malformed Basic Auth input.
|
|
26
|
-
*/
|
|
27
|
-
export function mapSecretToCredentialFields(authType, secret) {
|
|
28
|
-
switch (authType) {
|
|
29
|
-
case 'bearer':
|
|
30
|
-
return { access_token: secret };
|
|
31
|
-
case 'api_key':
|
|
32
|
-
return { api_key: secret };
|
|
33
|
-
case 'basic_auth': {
|
|
34
|
-
const colonIdx = secret.indexOf(':');
|
|
35
|
-
if (colonIdx === -1) {
|
|
36
|
-
throw new Error('Basic Auth stdin format: username:password');
|
|
37
|
-
}
|
|
38
|
-
return {
|
|
39
|
-
username: secret.slice(0, colonIdx),
|
|
40
|
-
password: secret.slice(colonIdx + 1),
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* Resolve a list of tag references (names, or raw tag UUIDs) to tag UUIDs using
|
|
47
|
-
* the org's tag registry. Accepts names primarily (the human-facing identifier);
|
|
48
|
-
* a value that is already a known tag_id passes through. Unknown references throw
|
|
49
|
-
* with the list of available tag names. Empty/whitespace entries are skipped.
|
|
50
|
-
*/
|
|
51
|
-
export function resolveTagIds(tagRefs, orgTags) {
|
|
52
|
-
const byName = new Map(orgTags.map((t) => [t.name, t.tag_id]));
|
|
53
|
-
const byId = new Set(orgTags.map((t) => t.tag_id));
|
|
54
|
-
const ids = [];
|
|
55
|
-
const missing = [];
|
|
56
|
-
for (const raw of tagRefs) {
|
|
57
|
-
const ref = raw.trim();
|
|
58
|
-
if (!ref)
|
|
59
|
-
continue;
|
|
60
|
-
const resolved = byName.get(ref);
|
|
61
|
-
if (resolved) {
|
|
62
|
-
ids.push(resolved);
|
|
63
|
-
}
|
|
64
|
-
else if (byId.has(ref)) {
|
|
65
|
-
ids.push(ref);
|
|
66
|
-
}
|
|
67
|
-
else {
|
|
68
|
-
missing.push(ref);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
if (missing.length > 0) {
|
|
72
|
-
const available = orgTags.map((t) => t.name).join(', ') || '(none)';
|
|
73
|
-
throw new Error(`Unknown tag(s): ${missing.join(', ')}. Available org tags: ${available}`);
|
|
74
|
-
}
|
|
75
|
-
// De-dup while preserving order.
|
|
76
|
-
return [...new Set(ids)];
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Split repeatable + comma-separated `--tag` values into a flat list of refs.
|
|
80
|
-
* `['a,b', 'c']` → `['a', 'b', 'c']`.
|
|
81
|
-
*/
|
|
82
|
-
export function splitTagRefs(rawValues) {
|
|
83
|
-
return rawValues
|
|
84
|
-
.flatMap((v) => v.split(','))
|
|
85
|
-
.map((v) => v.trim())
|
|
86
|
-
.filter((v) => v.length > 0);
|
|
87
|
-
}
|
|
88
|
-
//# sourceMappingURL=credential-utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential-utils.js","sourceRoot":"","sources":["../../src/lib/credential-utils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,YAAY,CAAU,CAAC;AAG7E,kFAAkF;AAClF,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,IAAI,CAAC,IAAI,CAAC,yBAAyB,SAAS,EAAE,CAC1E,CAAC;IACJ,CAAC;IAED,iCAAiC;IACjC,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,YAAY,CAAC,SAAmB;IAC9C,OAAO,SAAS;SACb,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;SAC5B,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;SACpB,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AACjC,CAAC"}
|
package/dist/lib/diff-display.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Colored terminal output from diff summary markdown
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Print a diff summary to the terminal with ANSI colors.
|
|
6
|
-
* Parses the markdown summary from the backend diff endpoint.
|
|
7
|
-
*/
|
|
8
|
-
export function printDiff(summary) {
|
|
9
|
-
const lines = summary.split('\n');
|
|
10
|
-
for (const line of lines) {
|
|
11
|
-
if (line.startsWith('**') && line.endsWith('**')) {
|
|
12
|
-
// Section header
|
|
13
|
-
console.log(`\n\x1b[1m${line.replace(/\*\*/g, '')}\x1b[0m`);
|
|
14
|
-
}
|
|
15
|
-
else if (line.trimStart().startsWith('+ ')) {
|
|
16
|
-
// Addition — green
|
|
17
|
-
console.log(`\x1b[32m${line}\x1b[0m`);
|
|
18
|
-
}
|
|
19
|
-
else if (line.trimStart().startsWith('- ')) {
|
|
20
|
-
// Deletion — red
|
|
21
|
-
console.log(`\x1b[31m${line}\x1b[0m`);
|
|
22
|
-
}
|
|
23
|
-
else if (line.trimStart().startsWith('~ ')) {
|
|
24
|
-
// Modification — yellow
|
|
25
|
-
console.log(`\x1b[33m${line}\x1b[0m`);
|
|
26
|
-
}
|
|
27
|
-
else if (line.includes('(no changes)')) {
|
|
28
|
-
// No changes — dim
|
|
29
|
-
console.log(`\x1b[2m${line}\x1b[0m`);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
console.log(line);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
console.log(); // trailing newline
|
|
36
|
-
}
|
|
37
|
-
//# sourceMappingURL=diff-display.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff-display.js","sourceRoot":"","sources":["../../src/lib/diff-display.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAElC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,iBAAiB;YACjB,OAAO,CAAC,GAAG,CAAC,YAAY,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9D,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,mBAAmB;YACnB,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,iBAAiB;YACjB,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YAC7C,wBAAwB;YACxB,OAAO,CAAC,GAAG,CAAC,WAAW,IAAI,SAAS,CAAC,CAAC;QACxC,CAAC;aAAM,IAAI,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,EAAE,CAAC;YACzC,mBAAmB;YACnB,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,SAAS,CAAC,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,mBAAmB;AACpC,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared formatting helpers for eval results display.
|
|
3
|
-
*/
|
|
4
|
-
interface ResultRow {
|
|
5
|
-
eval_id: string;
|
|
6
|
-
total_runs: number;
|
|
7
|
-
successful_runs: number;
|
|
8
|
-
failed_runs: number;
|
|
9
|
-
pending_runs?: number;
|
|
10
|
-
running_runs?: number;
|
|
11
|
-
avg_execution_time_ms?: number;
|
|
12
|
-
aggregated_scores?: Record<string, {
|
|
13
|
-
avg: number;
|
|
14
|
-
min: number;
|
|
15
|
-
max: number;
|
|
16
|
-
}>;
|
|
17
|
-
eval?: {
|
|
18
|
-
eval_id: string;
|
|
19
|
-
eval_name: string;
|
|
20
|
-
} | null;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Print a results table and overall summary.
|
|
24
|
-
*
|
|
25
|
-
* @param mode - 'compact': scores show avg only (used by run-eval summary)
|
|
26
|
-
* 'detailed': scores show avg/min/max (used by eval-results)
|
|
27
|
-
*/
|
|
28
|
-
export declare function printResultsTable(results: ResultRow[], mode: 'compact' | 'detailed'): void;
|
|
29
|
-
export {};
|
package/dist/lib/eval-format.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared formatting helpers for eval results display.
|
|
3
|
-
*/
|
|
4
|
-
/**
|
|
5
|
-
* Print a results table and overall summary.
|
|
6
|
-
*
|
|
7
|
-
* @param mode - 'compact': scores show avg only (used by run-eval summary)
|
|
8
|
-
* 'detailed': scores show avg/min/max (used by eval-results)
|
|
9
|
-
*/
|
|
10
|
-
export function printResultsTable(results, mode) {
|
|
11
|
-
let totalPassed = 0;
|
|
12
|
-
let totalTerminal = 0;
|
|
13
|
-
let totalInProgress = 0;
|
|
14
|
-
for (const r of results) {
|
|
15
|
-
const evalName = r.eval?.eval_name || r.eval_id.slice(0, 8);
|
|
16
|
-
// Denominator = completed runs (`successful + failed`, = the backend's
|
|
17
|
-
// `completed` count). Counting still-running runs against it understates the
|
|
18
|
-
// pass rate mid-run (gh #2604); in-progress runs are surfaced separately.
|
|
19
|
-
// (`completed` includes unevaluated/errored rows, per `failed_runs`;
|
|
20
|
-
// `success_rate` uses the narrower evaluated-only denominator.)
|
|
21
|
-
const terminalRuns = r.successful_runs + r.failed_runs;
|
|
22
|
-
const inProgress = (r.running_runs ?? 0) + (r.pending_runs ?? 0);
|
|
23
|
-
const passed = inProgress > 0
|
|
24
|
-
? `${r.successful_runs}/${terminalRuns} passed (+${inProgress} in progress)`
|
|
25
|
-
: `${r.successful_runs}/${terminalRuns} passed`;
|
|
26
|
-
const avgTime = r.avg_execution_time_ms != null ? `avg ${(r.avg_execution_time_ms / 1000).toFixed(1)}s` : '';
|
|
27
|
-
let scoresStr = '';
|
|
28
|
-
if (r.aggregated_scores) {
|
|
29
|
-
const parts = Object.entries(r.aggregated_scores).map(([key, val]) => mode === 'compact'
|
|
30
|
-
? `${key}: ${Math.round(val.avg * 100)}%`
|
|
31
|
-
: `${key}: avg ${Math.round(val.avg * 100)}%, min ${Math.round(val.min * 100)}%, max ${Math.round(val.max * 100)}%`);
|
|
32
|
-
if (parts.length > 0)
|
|
33
|
-
scoresStr = ' ' + parts.join(' ');
|
|
34
|
-
}
|
|
35
|
-
console.log(` ${evalName.padEnd(20)} ${passed.padEnd(14)} ${avgTime}${scoresStr}`);
|
|
36
|
-
totalPassed += r.successful_runs;
|
|
37
|
-
totalTerminal += terminalRuns;
|
|
38
|
-
totalInProgress += inProgress;
|
|
39
|
-
}
|
|
40
|
-
const pct = totalTerminal > 0 ? ((totalPassed / totalTerminal) * 100).toFixed(1) : '0.0';
|
|
41
|
-
const inProgressNote = totalInProgress > 0 ? ` — ${totalInProgress} in progress` : '';
|
|
42
|
-
console.log(`\nOverall: ${totalPassed}/${totalTerminal} passed (${pct}%)${inProgressNote}`);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=eval-format.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eval-format.js","sourceRoot":"","sources":["../../src/lib/eval-format.ts"],"names":[],"mappings":"AAAA;;GAEG;AAgBH;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAC/B,OAAoB,EACpB,IAA4B;IAE5B,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,IAAI,aAAa,GAAG,CAAC,CAAC;IACtB,IAAI,eAAe,GAAG,CAAC,CAAC;IAExB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,MAAM,QAAQ,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;QAC5D,uEAAuE;QACvE,6EAA6E;QAC7E,0EAA0E;QAC1E,qEAAqE;QACrE,gEAAgE;QAChE,MAAM,YAAY,GAAG,CAAC,CAAC,eAAe,GAAG,CAAC,CAAC,WAAW,CAAC;QACvD,MAAM,UAAU,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,CAAC;QACjE,MAAM,MAAM,GAAG,UAAU,GAAG,CAAC;YAC3B,CAAC,CAAC,GAAG,CAAC,CAAC,eAAe,IAAI,YAAY,aAAa,UAAU,eAAe;YAC5E,CAAC,CAA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C,CAAC;IAED,MAAM,GAAG,GAAG,aAAa,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,GAAG,aAAa,CAAC,GAAG,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IACzF,MAAM,cAAc,GAAG,eAAe,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,eAAe,cAAc,CAAC,CAAC,CAAC,EAAE,CAAC;IACtF,OAAO,CAAC,GAAG,CAAC,cAAc,WAAW,IAAI,aAAa,YAAY,GAAG,KAAK,cAAc,EAAE,CAAC,CAAC;AAC9F,CAAC"}
|
package/dist/lib/hub-lock.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
export declare function getLockPath(): string | null;
|
|
2
|
-
export declare function readLock(): string | null;
|
|
3
|
-
export declare function writeLock(hubId: string): void;
|
|
4
|
-
export declare function clearLock(): boolean;
|
|
5
|
-
export declare function assertHubMatchesLock(resolvedHubId: string, hubLabel?: string): void;
|
|
6
|
-
export declare function autoLockIfUnlocked(hubId: string): boolean;
|
|
7
|
-
export declare function assertNoLockBlocksHubCreation(newHubName: string): void;
|