@aexol/spectral 0.9.266 → 0.9.270
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/extensions/dataset-uploader/cleaner.d.ts +8 -0
- package/dist/extensions/dataset-uploader/cleaner.d.ts.map +1 -1
- package/dist/extensions/dataset-uploader/cleaner.js +28 -2
- package/dist/extensions/dataset-uploader/exporter.d.ts.map +1 -1
- package/dist/extensions/dataset-uploader/exporter.js +9 -1
- package/dist/extensions/dataset-uploader/scrubber.d.ts +2 -0
- package/dist/extensions/dataset-uploader/scrubber.d.ts.map +1 -1
- package/dist/extensions/dataset-uploader/scrubber.js +45 -1
- package/dist/extensions/dataset-uploader/upload.d.ts.map +1 -1
- package/dist/extensions/dataset-uploader/upload.js +5 -1
- package/dist/generated/zeus/const.d.ts.map +1 -1
- package/dist/generated/zeus/const.js +89 -3
- package/dist/generated/zeus/index.d.ts +451 -16
- package/dist/generated/zeus/index.d.ts.map +1 -1
- package/dist/generated/zeus/index.js +6 -0
- package/dist/memory/tokens.d.ts.map +1 -1
- package/dist/memory/tokens.js +8 -1
- package/dist/sdk/ai/env-api-keys.d.ts.map +1 -1
- package/dist/sdk/ai/env-api-keys.js +38 -8
- package/dist/sdk/coding-agent/core/agent-session.d.ts +2 -1
- package/dist/sdk/coding-agent/core/agent-session.d.ts.map +1 -1
- package/dist/sdk/coding-agent/core/agent-session.js +9 -2
- package/package.json +1 -1
|
@@ -48,6 +48,14 @@ export interface CleanDatasetResult {
|
|
|
48
48
|
}
|
|
49
49
|
/** Derive the default clean output path: `export-x.jsonl` → `export-x.clean.jsonl`. */
|
|
50
50
|
export declare function defaultCleanPath(inputPath: string): string;
|
|
51
|
+
/**
|
|
52
|
+
* Normalize conversation entries to the strict sharegpt contract
|
|
53
|
+
* (`{from, value}`). Internal markers such as `_trunc` (attached by
|
|
54
|
+
* exporter variants to truncated observations) are stripped at
|
|
55
|
+
* serialization time — the marker logic itself is untouched, the key
|
|
56
|
+
* simply never reaches a clean file or the vault.
|
|
57
|
+
*/
|
|
58
|
+
export declare function normalizeConversationEntries(sample: Record<string, unknown>): Record<string, unknown>;
|
|
51
59
|
/**
|
|
52
60
|
* Clean a dataset JSONL file: scrub all string fields, apply optional
|
|
53
61
|
* filters, write `<name>.clean.jsonl` next to the input.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cleaner.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/cleaner.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAQH,MAAM,WAAW,mBAAmB;IAClC,6EAA6E;IAC7E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,qEAAqE;IACrE,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE;QACf,QAAQ,EAAE,MAAM,CAAC;QACjB,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,MAAM,CAAC;KAC3B,CAAC;IACF,2EAA2E;IAC3E,UAAU,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC/C;AA6CD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAK1D;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAC1B,SAAS,EAAE,MA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kBAAkB,CA2DpB"}
|
|
@@ -17,7 +17,7 @@ import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
|
17
17
|
import { dirname } from "node:path";
|
|
18
18
|
import { loadJsonl, sampleChars } from "./analyzer.js";
|
|
19
19
|
import { scrub } from "./scrubber.js";
|
|
20
|
-
const REDACTION_KINDS = ["api_key", "jwt", "bearer", "home_path", "secret_value"];
|
|
20
|
+
const REDACTION_KINDS = ["api_key", "jwt", "bearer", "home_path", "user_path", "secret_value"];
|
|
21
21
|
/**
|
|
22
22
|
* Walk a JSON tree and scrub every string leaf. Objects/arrays are rebuilt
|
|
23
23
|
* (structure and key order preserved); non-string leaves pass through.
|
|
@@ -59,6 +59,32 @@ export function defaultCleanPath(inputPath) {
|
|
|
59
59
|
}
|
|
60
60
|
return `${inputPath}.clean.jsonl`;
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* Normalize conversation entries to the strict sharegpt contract
|
|
64
|
+
* (`{from, value}`). Internal markers such as `_trunc` (attached by
|
|
65
|
+
* exporter variants to truncated observations) are stripped at
|
|
66
|
+
* serialization time — the marker logic itself is untouched, the key
|
|
67
|
+
* simply never reaches a clean file or the vault.
|
|
68
|
+
*/
|
|
69
|
+
export function normalizeConversationEntries(sample) {
|
|
70
|
+
const conversations = sample.conversations;
|
|
71
|
+
if (!Array.isArray(conversations))
|
|
72
|
+
return sample;
|
|
73
|
+
let changed = false;
|
|
74
|
+
const normalized = conversations.map((entry) => {
|
|
75
|
+
if (entry === null || typeof entry !== "object" || Array.isArray(entry))
|
|
76
|
+
return entry;
|
|
77
|
+
const record = entry;
|
|
78
|
+
if (!("_trunc" in record))
|
|
79
|
+
return entry;
|
|
80
|
+
changed = true;
|
|
81
|
+
const { _trunc: _dropped, ...rest } = record;
|
|
82
|
+
return rest;
|
|
83
|
+
});
|
|
84
|
+
if (!changed)
|
|
85
|
+
return sample;
|
|
86
|
+
return { ...sample, conversations: normalized };
|
|
87
|
+
}
|
|
62
88
|
/**
|
|
63
89
|
* Clean a dataset JSONL file: scrub all string fields, apply optional
|
|
64
90
|
* filters, write `<name>.clean.jsonl` next to the input.
|
|
@@ -94,7 +120,7 @@ export function cleanDataset(inputPath, options = {}) {
|
|
|
94
120
|
removedByFilter.keepOnlyToolCalls++;
|
|
95
121
|
continue;
|
|
96
122
|
}
|
|
97
|
-
kept.push(scrubDeep(sample, options.extraValues, counts));
|
|
123
|
+
kept.push(normalizeConversationEntries(scrubDeep(sample, options.extraValues, counts)));
|
|
98
124
|
}
|
|
99
125
|
const outputPath = options.outputPath ?? defaultCleanPath(inputPath);
|
|
100
126
|
mkdirSync(dirname(outputPath), { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/exporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;
|
|
1
|
+
{"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/exporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAmBH,UAAU,iBAAiB;IACzB,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;CACtC;AAED,UAAU,UAAU;IAClB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACxC,KAAK,IAAI,IAAI,CAAC;CACf;AAiCD,uEAAuE;AACvE,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAiB3D;AAMD,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,OAAO,GAAG,KAAK,GAAG,eAAe,GAAG,aAAa,CAAC;IACxD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,UAAU,CAAC;IACjB,QAAQ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AO,MAAM,qBAAqB,OAAO,CAAC;AAE1C,eAAO,MAAM,6BAA6B,mBAAmB,CAAC;AAW9D,UAAU,qBAAqB;IAC7B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,qBAAqB,EAAE,CAAA;KAAE,GAAG,IAAI,CAAC;IACtD,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,qEAAqE;IACrE,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,GAAG,MAAM,CAO1E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,oBAAoB,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,GAAE,MAAM,GAAG,IAAW,EAC9B,eAAe,GAAE,MAAM,GAAG,MAAe,GACxC,mBAAmB,CAmFrB;AA8CD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,qBAA0B,GAAG,oBAAoB,CA4GxF"}
|
|
@@ -39,6 +39,7 @@ import { createRequire } from "node:module";
|
|
|
39
39
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
40
40
|
import { dirname, join } from "node:path";
|
|
41
41
|
import { getConfigDir } from "../../config.js";
|
|
42
|
+
import { scrub } from "./scrubber.js";
|
|
42
43
|
const _require = createRequire(import.meta.url);
|
|
43
44
|
let nodeSqliteModule;
|
|
44
45
|
let nodeSqliteProbed = false;
|
|
@@ -187,9 +188,16 @@ export function parseAssistantEvents(eventsJsonl, capChars = null, includeThinki
|
|
|
187
188
|
const text = extractResultText(event.result);
|
|
188
189
|
if (text.length === 0)
|
|
189
190
|
break;
|
|
191
|
+
// Scrub BEFORE the truncation cap: a secret cut mid-token by the
|
|
192
|
+
// cap would no longer match the scrubber's patterns (e.g. a JWT
|
|
193
|
+
// losing its signature segment), so the full text is sanitised
|
|
194
|
+
// first and then cut. Pattern-only scrub (no extraValues — the
|
|
195
|
+
// export step does not collect secret-store/.env values;
|
|
196
|
+
// dataset_clean applies the full scrub to the whole file later).
|
|
197
|
+
const sanitized = scrub(text).text;
|
|
190
198
|
entries.push({
|
|
191
199
|
from: "observation",
|
|
192
|
-
value: (event.isError ? "[ERROR] " : "") + capObservation(capChars,
|
|
200
|
+
value: (event.isError ? "[ERROR] " : "") + capObservation(capChars, sanitized),
|
|
193
201
|
});
|
|
194
202
|
break;
|
|
195
203
|
}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* - jwt — bare JWTs (eyJ... payload ... signature)
|
|
7
7
|
* - bearer — "Bearer <token>" and Authorization header values
|
|
8
8
|
* - home_path — /Users/<name>/ → /home/
|
|
9
|
+
* - user_path — Wine/Windows user segments (drive_c/users/<name>,
|
|
10
|
+
* <drive>:\Users\<name>) → <name> replaced with "user"
|
|
9
11
|
* - secret_value — opaque values passed in by the caller (secret-store
|
|
10
12
|
* values, .env values). The scrubber NEVER reads any
|
|
11
13
|
* store itself; callers decide what to pass.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/scrubber.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"scrubber.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/scrubber.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,cAAc,EAAE,CAAC;CAC9B;AAiED;;;;;;;;;GASG;AACH,wBAAgB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,EAAE,GAAG,WAAW,CAyDvE"}
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* - jwt — bare JWTs (eyJ... payload ... signature)
|
|
7
7
|
* - bearer — "Bearer <token>" and Authorization header values
|
|
8
8
|
* - home_path — /Users/<name>/ → /home/
|
|
9
|
+
* - user_path — Wine/Windows user segments (drive_c/users/<name>,
|
|
10
|
+
* <drive>:\Users\<name>) → <name> replaced with "user"
|
|
9
11
|
* - secret_value — opaque values passed in by the caller (secret-store
|
|
10
12
|
* values, .env values). The scrubber NEVER reads any
|
|
11
13
|
* store itself; callers decide what to pass.
|
|
@@ -28,13 +30,43 @@ const AUTH_HEADER_PATTERN = /\b(authorization\s*[:=]\s*)(?:bearer\s+)?[A-Za-z0-9
|
|
|
28
30
|
const BEARER_PATTERN = /\bbearer\s+[A-Za-z0-9._~+/=-]+/gi;
|
|
29
31
|
/** Bare JWT: three base64url segments, the first starting with "eyJ". */
|
|
30
32
|
const JWT_PATTERN = /\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g;
|
|
33
|
+
/**
|
|
34
|
+
* Partial / truncated JWT: an "eyJ"-prefixed base64url run with one or two
|
|
35
|
+
* dot-separated segments. A JWT cut mid-string (e.g. by observation
|
|
36
|
+
* truncation) loses its signature segment, so JWT_PATTERN no longer
|
|
37
|
+
* matches — but the surviving payload prefix still leaks identifying
|
|
38
|
+
* claims (teamId, machineName, ...). Runs AFTER the full-3-segment
|
|
39
|
+
* pattern, so complete JWTs are redacted as one unit first and identically
|
|
40
|
+
* to before. The "eyJ" prefix (base64 of `{"`) keeps ordinary prose and
|
|
41
|
+
* non-JWT base64 blobs from matching.
|
|
42
|
+
*/
|
|
43
|
+
const JWT_PARTIAL_PATTERN = /\beyJ[A-Za-z0-9_-]{10,}(?:\.[A-Za-z0-9_-]+){0,2}\b/g;
|
|
31
44
|
/**
|
|
32
45
|
* Home directory segment: /Users/<name> followed by "/" or end-of-text.
|
|
33
46
|
* Normalized to /home (the marker would break the surrounding path).
|
|
34
47
|
*/
|
|
35
48
|
const HOME_PATH_PATTERN = /\/Users\/[A-Za-z0-9._-]+(?=\/|$)/g;
|
|
49
|
+
/**
|
|
50
|
+
* Wine / Windows user segment inside a path:
|
|
51
|
+
* - drive_c/users/<name> (Wine prefix, e.g. /home/.wine/drive_c/users/<name>)
|
|
52
|
+
* - <drive>:\Users\<name> (native Windows path, backslashes)
|
|
53
|
+
* Only the user segment is replaced with "user" — the surrounding path is
|
|
54
|
+
* kept intact (a full-path marker would break the surrounding text).
|
|
55
|
+
* The normalized "user" value itself never re-matches (lookahead), so
|
|
56
|
+
* scrubbing is idempotent: re-scrubbing redacted text produces no new
|
|
57
|
+
* redactions, not even no-op ones.
|
|
58
|
+
*/
|
|
59
|
+
const WINE_USER_PATH_PATTERN = /drive_c\/users\/(?!user(?=[/\\.\s-]|$))[A-Za-z0-9._-]+/g;
|
|
60
|
+
const WINDOWS_USER_PATH_PATTERN = /([A-Za-z]:\\Users\\)(?!user(?=[/\\.\s-]|$))[A-Za-z0-9._-]+/g;
|
|
36
61
|
/** Stable ordering of kinds in the returned redactions array. */
|
|
37
|
-
const REDACTION_KINDS = [
|
|
62
|
+
const REDACTION_KINDS = [
|
|
63
|
+
"api_key",
|
|
64
|
+
"jwt",
|
|
65
|
+
"bearer",
|
|
66
|
+
"home_path",
|
|
67
|
+
"user_path",
|
|
68
|
+
"secret_value",
|
|
69
|
+
];
|
|
38
70
|
/**
|
|
39
71
|
* Scrub `text` for secrets.
|
|
40
72
|
*
|
|
@@ -77,10 +109,22 @@ export function scrub(text, extraValues) {
|
|
|
77
109
|
counts.jwt = (counts.jwt ?? 0) + 1;
|
|
78
110
|
return "[REDACTED:jwt]";
|
|
79
111
|
});
|
|
112
|
+
out = out.replace(JWT_PARTIAL_PATTERN, () => {
|
|
113
|
+
counts.jwt = (counts.jwt ?? 0) + 1;
|
|
114
|
+
return "[REDACTED:jwt]";
|
|
115
|
+
});
|
|
80
116
|
out = out.replace(HOME_PATH_PATTERN, () => {
|
|
81
117
|
counts.home_path = (counts.home_path ?? 0) + 1;
|
|
82
118
|
return "/home";
|
|
83
119
|
});
|
|
120
|
+
out = out.replace(WINE_USER_PATH_PATTERN, () => {
|
|
121
|
+
counts.user_path = (counts.user_path ?? 0) + 1;
|
|
122
|
+
return "drive_c/users/user";
|
|
123
|
+
});
|
|
124
|
+
out = out.replace(WINDOWS_USER_PATH_PATTERN, (match, prefix) => {
|
|
125
|
+
counts.user_path = (counts.user_path ?? 0) + 1;
|
|
126
|
+
return `${prefix}user`;
|
|
127
|
+
});
|
|
84
128
|
const redactions = [];
|
|
85
129
|
for (const kind of REDACTION_KINDS) {
|
|
86
130
|
const count = counts[kind];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../../src/extensions/dataset-uploader/upload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAaH,eAAO,MAAM,kBAAkB,KAAK,CAAC;AAErC,0DAA0D;AAC1D,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,yEAAyE;AACzE,eAAO,MAAM,wBAAwB,wBAAwB,CAAC;AAE9D,eAAO,MAAM,cAAc,aAAa,CAAC;AAEzC;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,CAC5B,IAAI,EAAE,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,EAAE;QAAE,eAAe,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC9D,uEAAuE;IACvE,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAQD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAAC,EAAE,EAAE,eAAe,GAAG,IAAI,GAAG,IAAI,CAE7E;AAmFD;;;;;GAKG;AACH,wBAAsB,aAAa,CACjC,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAgI9B;AAMD,mEAAmE;AACnE,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,MAAM,CA2CxE"}
|
|
@@ -28,6 +28,7 @@ import { ensureAuthenticated } from "../../auth-helper.js";
|
|
|
28
28
|
import { readStudioBinding } from "../../studio-binding.js";
|
|
29
29
|
import { renderContentToString } from "../aexol-backend-client.js";
|
|
30
30
|
import { loadJsonl } from "./analyzer.js";
|
|
31
|
+
import { normalizeConversationEntries } from "./cleaner.js";
|
|
31
32
|
import { scrub } from "./scrubber.js";
|
|
32
33
|
export const DEFAULT_BATCH_SIZE = 50;
|
|
33
34
|
/** Backend MCP tool that ingests one batch of samples. */
|
|
@@ -149,7 +150,10 @@ export async function uploadDataset(options) {
|
|
|
149
150
|
}
|
|
150
151
|
notes.push("Per-project batching is not supported by the exporter JSONL (no per-sample project provenance); " +
|
|
151
152
|
"a single projectId from the binding is used for all batches.");
|
|
152
|
-
|
|
153
|
+
// Serialize with conversation entries normalized to the strict sharegpt
|
|
154
|
+
// contract ({from, value}) — internal markers such as `_trunc` never
|
|
155
|
+
// reach the vault, even when the input file was not run through clean.
|
|
156
|
+
const validSamples = samples.map((s) => JSON.stringify(normalizeConversationEntries(s)));
|
|
153
157
|
const invalidLines = malformedLines;
|
|
154
158
|
// ---- pre-upload residue warning (pattern-only dry-run scrub) ------------
|
|
155
159
|
// Runs in BOTH dry-run and real uploads, before the first network batch.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/generated/zeus/const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,
|
|
1
|
+
{"version":3,"file":"const.d.ts","sourceRoot":"","sources":["../../../src/generated/zeus/const.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAogC5C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAC,GAAG,CAmjD1C,CAAA;AAED,eAAO,MAAM,GAAG;;;;CAIf,CAAA"}
|
|
@@ -229,6 +229,9 @@ export const AllTypesProps = {
|
|
|
229
229
|
adminVastAiOffers: {
|
|
230
230
|
query: "AdminVastAiOfferQueryInput"
|
|
231
231
|
},
|
|
232
|
+
adminUpCloudGpuPrices: {},
|
|
233
|
+
adminUpCloudServers: {},
|
|
234
|
+
adminUpCloudServer: {},
|
|
232
235
|
adminRunPodPods: {},
|
|
233
236
|
adminDeployConfig: {},
|
|
234
237
|
adminColdStartRuns: {},
|
|
@@ -448,6 +451,13 @@ export const AllTypesProps = {
|
|
|
448
451
|
adminStartVastAiInstance: {},
|
|
449
452
|
adminStopVastAiInstance: {},
|
|
450
453
|
adminDestroyVastAiInstance: {},
|
|
454
|
+
adminUpCloudDeployServer: {
|
|
455
|
+
input: "UpCloudDeployInput"
|
|
456
|
+
},
|
|
457
|
+
adminUpCloudStartServer: {},
|
|
458
|
+
adminUpCloudStopServer: {},
|
|
459
|
+
adminUpCloudAddFirewallPorts: {},
|
|
460
|
+
adminUpCloudDestroyServer: {},
|
|
451
461
|
adminCreateRunPod: {
|
|
452
462
|
input: "AdminCreateRunPodInput"
|
|
453
463
|
},
|
|
@@ -579,6 +589,10 @@ export const AllTypesProps = {
|
|
|
579
589
|
AdminVastAiOfferQueryInput: {},
|
|
580
590
|
AdminCreateVastAiInstanceInput: {},
|
|
581
591
|
AdminUpdateVastAiInstanceInput: {},
|
|
592
|
+
UpCloudLabelInput: {},
|
|
593
|
+
UpCloudDeployInput: {
|
|
594
|
+
labels: "UpCloudLabelInput"
|
|
595
|
+
},
|
|
582
596
|
AdminCreateRunPodInput: {
|
|
583
597
|
env: "JSON"
|
|
584
598
|
},
|
|
@@ -588,8 +602,13 @@ export const AllTypesProps = {
|
|
|
588
602
|
AdminCreateDeployConfigInput: {},
|
|
589
603
|
AdminUpdateDeployConfigInput: {},
|
|
590
604
|
ColdStartRunStatus: "enum",
|
|
591
|
-
|
|
592
|
-
|
|
605
|
+
GpuProvider: "enum",
|
|
606
|
+
AdminColdStartProfileInput: {
|
|
607
|
+
provider: "GpuProvider"
|
|
608
|
+
},
|
|
609
|
+
AdminUpdateColdStartProfileInput: {
|
|
610
|
+
provider: "GpuProvider"
|
|
611
|
+
},
|
|
593
612
|
ColdStartStopMode: "enum",
|
|
594
613
|
BaseModelUpdateInput: {},
|
|
595
614
|
BaseModelCreateInput: {
|
|
@@ -1179,6 +1198,12 @@ export const ReturnTypes = {
|
|
|
1179
1198
|
adminVastAiSettings: "AdminVastAiSettings",
|
|
1180
1199
|
adminVastAiOffers: "AdminVastAiOffer",
|
|
1181
1200
|
adminVastAiInstances: "AdminVastAiInstance",
|
|
1201
|
+
adminUpCloudAccount: "UpCloudAccount",
|
|
1202
|
+
adminUpCloudGpuPlans: "UpCloudGpuPlan",
|
|
1203
|
+
adminUpCloudGpuPrices: "UpCloudPlanPrices",
|
|
1204
|
+
adminUpCloudTemplates: "UpCloudTemplate",
|
|
1205
|
+
adminUpCloudServers: "UpCloudServer",
|
|
1206
|
+
adminUpCloudServer: "UpCloudServer",
|
|
1182
1207
|
adminRunPodAccount: "AdminRunPodAccount",
|
|
1183
1208
|
adminRunPodSettings: "AdminRunPodSettings",
|
|
1184
1209
|
adminRunPodPods: "AdminRunPodPod",
|
|
@@ -1305,6 +1330,11 @@ export const ReturnTypes = {
|
|
|
1305
1330
|
adminStartVastAiInstance: "AdminVastAiOperation",
|
|
1306
1331
|
adminStopVastAiInstance: "AdminVastAiOperation",
|
|
1307
1332
|
adminDestroyVastAiInstance: "AdminVastAiOperation",
|
|
1333
|
+
adminUpCloudDeployServer: "UpCloudServer",
|
|
1334
|
+
adminUpCloudStartServer: "UpCloudOperation",
|
|
1335
|
+
adminUpCloudStopServer: "UpCloudOperation",
|
|
1336
|
+
adminUpCloudAddFirewallPorts: "UpCloudOperation",
|
|
1337
|
+
adminUpCloudDestroyServer: "UpCloudOperation",
|
|
1308
1338
|
adminCreateRunPod: "AdminRunPodPod",
|
|
1309
1339
|
adminUpdateRunPod: "AdminRunPodPod",
|
|
1310
1340
|
adminStartRunPod: "AdminRunPodOperation",
|
|
@@ -1893,6 +1923,59 @@ export const ReturnTypes = {
|
|
|
1893
1923
|
status: "String",
|
|
1894
1924
|
message: "String"
|
|
1895
1925
|
},
|
|
1926
|
+
UpCloudAccount: {
|
|
1927
|
+
username: "String",
|
|
1928
|
+
creditsEur: "Float",
|
|
1929
|
+
paidCreditsEur: "Float",
|
|
1930
|
+
resourceLimitsCores: "Int",
|
|
1931
|
+
resourceLimitsGpus: "Int",
|
|
1932
|
+
resourceLimitsMemoryMiB: "Int",
|
|
1933
|
+
resourceLimitsPublicIpv4: "Int"
|
|
1934
|
+
},
|
|
1935
|
+
UpCloudGpuPlan: {
|
|
1936
|
+
name: "String",
|
|
1937
|
+
cores: "Int",
|
|
1938
|
+
memoryGb: "Float",
|
|
1939
|
+
gpuAmount: "Int",
|
|
1940
|
+
gpuModel: "String",
|
|
1941
|
+
spot: "Boolean"
|
|
1942
|
+
},
|
|
1943
|
+
UpCloudPlanPrice: {
|
|
1944
|
+
plan: "String",
|
|
1945
|
+
hourlyEur: "Float",
|
|
1946
|
+
spotHourlyEur: "Float"
|
|
1947
|
+
},
|
|
1948
|
+
UpCloudPlanPrices: {
|
|
1949
|
+
byPlan: "UpCloudPlanPrice",
|
|
1950
|
+
storageStandardEurPerGbMonth: "Float",
|
|
1951
|
+
storageMaxiopsEurPerGbMonth: "Float",
|
|
1952
|
+
publicIpv4EurPerMonth: "Float"
|
|
1953
|
+
},
|
|
1954
|
+
UpCloudTemplate: {
|
|
1955
|
+
uuid: "String",
|
|
1956
|
+
title: "String",
|
|
1957
|
+
sizeGb: "Int",
|
|
1958
|
+
cloudInit: "Boolean"
|
|
1959
|
+
},
|
|
1960
|
+
UpCloudLabel: {
|
|
1961
|
+
key: "String",
|
|
1962
|
+
value: "String"
|
|
1963
|
+
},
|
|
1964
|
+
UpCloudServer: {
|
|
1965
|
+
uuid: "String",
|
|
1966
|
+
title: "String",
|
|
1967
|
+
hostname: "String",
|
|
1968
|
+
plan: "String",
|
|
1969
|
+
zone: "String",
|
|
1970
|
+
state: "String",
|
|
1971
|
+
publicIp: "String",
|
|
1972
|
+
labels: "UpCloudLabel"
|
|
1973
|
+
},
|
|
1974
|
+
UpCloudOperation: {
|
|
1975
|
+
uuid: "String",
|
|
1976
|
+
status: "String",
|
|
1977
|
+
message: "String"
|
|
1978
|
+
},
|
|
1896
1979
|
AdminRunPodAccount: {
|
|
1897
1980
|
balance: "Float",
|
|
1898
1981
|
spendPerHr: "Float",
|
|
@@ -1959,13 +2042,15 @@ export const ReturnTypes = {
|
|
|
1959
2042
|
id: "String",
|
|
1960
2043
|
name: "String",
|
|
1961
2044
|
description: "String",
|
|
2045
|
+
provider: "GpuProvider",
|
|
1962
2046
|
targetUserModelSlug: "String",
|
|
1963
2047
|
servedModelName: "String",
|
|
1964
2048
|
hfModel: "String",
|
|
1965
2049
|
gpuNames: "String",
|
|
1966
2050
|
minGpus: "Int",
|
|
1967
2051
|
minVramGb: "Int",
|
|
1968
|
-
|
|
2052
|
+
maxPricePerHour: "Float",
|
|
2053
|
+
maxPricePerHourCurrency: "String",
|
|
1969
2054
|
minReliability: "Float",
|
|
1970
2055
|
verifiedOnly: "Boolean",
|
|
1971
2056
|
datacenterOnly: "Boolean",
|
|
@@ -1995,6 +2080,7 @@ export const ReturnTypes = {
|
|
|
1995
2080
|
profileId: "String",
|
|
1996
2081
|
userModelId: "String",
|
|
1997
2082
|
status: "ColdStartRunStatus",
|
|
2083
|
+
provider: "GpuProvider",
|
|
1998
2084
|
offerId: "String",
|
|
1999
2085
|
machineId: "String",
|
|
2000
2086
|
instanceId: "String",
|