dataiku-sdk 3.5.0 → 3.6.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/README.md +1 -1
- package/bin/dss.js +28 -2
- package/dist/build-metadata.json +1 -1
- package/dist/src/cli/coerce.d.ts +0 -1
- package/dist/src/cli/coerce.js +0 -5
- package/dist/src/cli/commands/app.js +3 -2
- package/dist/src/cli/commands/dataset.js +2 -4
- package/dist/src/cli/commands/job.js +4 -3
- package/dist/src/cli/contract.js +1 -1
- package/dist/src/cli/env.js +2 -1
- package/dist/src/cli/flags.d.ts +1 -0
- package/dist/src/cli/flags.js +4 -9
- package/dist/src/cli/helpers/app-permissions.js +5 -4
- package/dist/src/cli/helpers/flow-zone.js +6 -5
- package/dist/src/cli/version.d.ts +0 -2
- package/dist/src/cli/version.js +6 -9
- package/dist/src/cli.js +107 -222
- package/dist/src/client.d.ts +2 -1
- package/dist/src/client.js +25 -11
- package/dist/src/resources/base.d.ts +2 -0
- package/dist/src/resources/base.js +14 -2
- package/dist/src/resources/code-envs.js +1 -3
- package/dist/src/resources/data-quality.js +10 -10
- package/dist/src/resources/macros.d.ts +1 -1
- package/dist/src/resources/macros.js +1 -3
- package/dist/src/resources/recipes.js +1 -5
- package/dist/src/resources/saved-models.js +1 -13
- package/dist/src/resources/scenarios.js +1 -3
- package/dist/src/resources/sql.js +1 -5
- package/dist/src/resources/statistics.js +1 -3
- package/dist/src/utils/deep-merge.js +2 -4
- package/dist/src/utils/flow-map.js +1 -6
- package/dist/src/utils/project-archive.js +8 -12
- package/dist/src/utils/project-incarnation.js +3 -7
- package/dist/src/utils/records.d.ts +4 -0
- package/dist/src/utils/records.js +8 -0
- package/package.json +7 -11
- package/plugin.json +1 -1
- package/skills/dataiku-dss/SKILL.md +1 -1
- package/skills/dataiku-dss/references/authentication.md +2 -2
- package/skills/dataiku-dss/references/discovery.md +1 -1
- package/skills/dataiku-dss/references/mutations.md +0 -1
- package/packages/types/dist/index.d.ts +0 -1062
- package/packages/types/dist/index.js +0 -871
package/README.md
CHANGED
|
@@ -267,7 +267,7 @@ DSS_TOKENIZER_MODULE=/absolute/path/to/oh-my-pi/packages/natives/native/index.js
|
|
|
267
267
|
|
|
268
268
|
When configured, the native module also accelerates ordinary OpenAI token measurements after parity checks against the pinned JavaScript model. The JS fingerprint and independent cross-model reference checks remain authoritative; reserved special-token validation is preserved. Without this variable, measurements use JavaScript and only the native cross-model case is skipped. A configured missing/incompatible module fails instead of silently falling back. The cross-model gate permits 10% growth over recorded text baselines. Claude counts use ctok reconstructions, not an official tokenizer; counts exclude provider framing. No native dependency is added to the CLI.
|
|
269
269
|
|
|
270
|
-
For a known resource, `dss agent contract --fields commands.actions.dataset` lists action names
|
|
270
|
+
For a known resource, `dss agent contract --fields commands.actions.dataset` lists only its action names, far smaller than the global index; for known writes, fetch the full action entry directly once rather than compact discovery followed by the full entry. `bun run test:tokens` pins the current figures. Use compact `usage,description,flags,examples` projections for reads when those fields suffice. This is selective disclosure, not lossless compression. Scoped discovery constructs only requested action entries and materializes schemas only when requested; action-name indexes avoid payload schemas, while full registry exports and recovery hints retain their existing content. Metadata-only paths defer SDK runtime/schema imports.
|
|
271
271
|
|
|
272
272
|
Boolean flags accept bare flags or explicit `=true`/`=false` values, including aliases. Invalid boolean values fail before dispatch. Direct, batch, and local commands share execution-mode resolution; `--plan --dry-run` returns a plan with `plannedAndDryRun:true` when both modes are supported. Unreadable JSON/text payload files produce `validation_failed` usage errors (exit 1) with the flag, path, and filesystem cause.
|
|
273
273
|
|
package/bin/dss.js
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
// disabled; `bunx --bun` enters Bun's Node-compatibility mode, which disables
|
|
5
5
|
// that loading before this module runs.
|
|
6
6
|
import { spawnSync, } from "node:child_process";
|
|
7
|
+
import { readFileSync, } from "node:fs";
|
|
7
8
|
import * as path from "node:path";
|
|
8
9
|
import { fileURLToPath, pathToFileURL, } from "node:url";
|
|
9
10
|
|
|
@@ -19,6 +20,10 @@ const bunNodeCompatibilityMode = runningUnderBun
|
|
|
19
20
|
);
|
|
20
21
|
const envFileAutoloadDisabled = process.execArgv.includes("--no-env-file",)
|
|
21
22
|
|| bunNodeCompatibilityMode;
|
|
23
|
+
// The one source of the minimum is package.json engines.bun (">=X.Y.Z").
|
|
24
|
+
const MINIMUM_BUN = JSON.parse(
|
|
25
|
+
readFileSync(fileURLToPath(new URL("../package.json", import.meta.url,),), "utf-8",),
|
|
26
|
+
).engines.bun.replace(/^>=/, "",);
|
|
22
27
|
|
|
23
28
|
if (!runningUnderBun) {
|
|
24
29
|
const result = spawnSync(
|
|
@@ -35,7 +40,7 @@ if (!runningUnderBun) {
|
|
|
35
40
|
code: "internal_error",
|
|
36
41
|
category: "internal",
|
|
37
42
|
exitCode: 2,
|
|
38
|
-
hint:
|
|
43
|
+
hint: `Install Bun >= ${MINIMUM_BUN} and ensure \`bun\` is on PATH.`,
|
|
39
44
|
},)
|
|
40
45
|
}\n`,);
|
|
41
46
|
process.exitCode = 2;
|
|
@@ -44,6 +49,19 @@ if (!runningUnderBun) {
|
|
|
44
49
|
} else {
|
|
45
50
|
process.exitCode = result.status ?? 1;
|
|
46
51
|
}
|
|
52
|
+
} else if (!Bun.semver.satisfies(Bun.version, `>=${MINIMUM_BUN}`,)) {
|
|
53
|
+
process.stdout.write(`${
|
|
54
|
+
JSON.stringify({
|
|
55
|
+
type: "error",
|
|
56
|
+
ok: false,
|
|
57
|
+
error: `Bun ${Bun.version} is older than the required ${MINIMUM_BUN}.`,
|
|
58
|
+
code: "internal_error",
|
|
59
|
+
category: "internal",
|
|
60
|
+
exitCode: 2,
|
|
61
|
+
hint: `Upgrade Bun to >= ${MINIMUM_BUN} (bun upgrade).`,
|
|
62
|
+
},)
|
|
63
|
+
}\n`,);
|
|
64
|
+
process.exitCode = 2;
|
|
47
65
|
} else if (!envFileAutoloadDisabled) {
|
|
48
66
|
process.stdout.write(`${
|
|
49
67
|
JSON.stringify({
|
|
@@ -61,7 +79,11 @@ if (!runningUnderBun) {
|
|
|
61
79
|
const here = import.meta.dir;
|
|
62
80
|
const distCliPath = path.resolve(here, "../dist/src/cli.js",);
|
|
63
81
|
const sourceCliPath = path.resolve(here, "../src/cli.ts",);
|
|
64
|
-
|
|
82
|
+
// A source checkout always runs its source, like bin/dss; a leftover dist/
|
|
83
|
+
// would otherwise silently shadow every edit. The published package ships
|
|
84
|
+
// no src/, so installs run dist.
|
|
85
|
+
const usesDistCli = !(await Bun.file(sourceCliPath,).exists())
|
|
86
|
+
&& await Bun.file(distCliPath,).exists();
|
|
65
87
|
const cliPath = usesDistCli ? distCliPath : sourceCliPath;
|
|
66
88
|
|
|
67
89
|
// Published dist carries dist/build-metadata.json with the revision it was
|
|
@@ -80,6 +102,10 @@ if (!runningUnderBun) {
|
|
|
80
102
|
} catch {
|
|
81
103
|
// Dist without build metadata: provenance still reports dist source.
|
|
82
104
|
}
|
|
105
|
+
} else {
|
|
106
|
+
// Provenance is the launcher's to assert; never trust inherited values.
|
|
107
|
+
delete process.env.DSS_LOAD_SOURCE;
|
|
108
|
+
delete process.env.DSS_BUILD_REVISION;
|
|
83
109
|
}
|
|
84
110
|
|
|
85
111
|
// Same process, same argv: the CLI sees process.argv.slice(2) exactly as before.
|
package/dist/build-metadata.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"format":1,"buildRevision":"
|
|
1
|
+
{"format":1,"buildRevision":"7a89c248d112072b3699f7f9d2774edca72ee0a9"}
|
package/dist/src/cli/coerce.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare function normalizeLineEndings(value: string): string;
|
|
|
10
10
|
export declare function splitCsvFlag(v: string | boolean | undefined): string[];
|
|
11
11
|
export declare function recipeInputDatasetsFromFlags(flags: Record<string, string | boolean>): string[] | undefined;
|
|
12
12
|
export declare function rewritePairsFromFlags(flags: Record<string, string | boolean>, flagName: string): Record<string, string>;
|
|
13
|
-
export declare function plainRecord(value: unknown): Record<string, unknown> | undefined;
|
|
14
13
|
export declare function requiredStringFlag(flags: Record<string, string | boolean>, name: string, usage: string): string;
|
|
15
14
|
export declare function optionalStringField(record: Record<string, unknown>, keys: string[]): string | undefined;
|
|
16
15
|
export declare function requiredStringArray(value: unknown, source: string): string[];
|
package/dist/src/cli/coerce.js
CHANGED
|
@@ -85,11 +85,6 @@ export function rewritePairsFromFlags(flags, flagName) {
|
|
|
85
85
|
}
|
|
86
86
|
return rewrites;
|
|
87
87
|
}
|
|
88
|
-
export function plainRecord(value) {
|
|
89
|
-
return value && typeof value === "object" && !Array.isArray(value)
|
|
90
|
-
? value
|
|
91
|
-
: undefined;
|
|
92
|
-
}
|
|
93
88
|
export function requiredStringFlag(flags, name, usage) {
|
|
94
89
|
const value = flags[name];
|
|
95
90
|
if (typeof value !== "string" || value.trim().length === 0) {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ClientValidationError, DataikuError, } from "../../errors.js";
|
|
2
2
|
import { projectIncarnationHash, } from "../../utils/project-incarnation.js";
|
|
3
|
-
import {
|
|
3
|
+
import { asRecord, } from "../../utils/records.js";
|
|
4
|
+
import { jsonInput, num, parseBooleanOption, requiredJsonInput, requiredStringFlag, stringField, } from "../coerce.js";
|
|
4
5
|
import { executionMode, } from "../flags.js";
|
|
5
6
|
import { appPermissionsHash, appPermissionsVerificationError, assertAppPermissionsSnapshotBinding, buildAppPermissionsSnapshot, diffAppPermissions, readAppPermissionsSnapshot, writeAppPermissionsSnapshot, } from "../helpers/app-permissions.js";
|
|
6
7
|
import { createSuccessorInstance, futureTargetIdentity, generatedInstanceKey, isDefinitiveRejection, preflightSuccessorInstance, requireAbsentProjectTarget, safeErrorSummary, verifyAppInstance, VISUAL_UI_GATE, } from "../helpers/app-successor.js";
|
|
@@ -180,7 +181,7 @@ export const appCommands = withUsage("app", {
|
|
|
180
181
|
...safeErrorSummary(error),
|
|
181
182
|
};
|
|
182
183
|
}
|
|
183
|
-
const instance =
|
|
184
|
+
const instance = asRecord(created);
|
|
184
185
|
if (!instance) {
|
|
185
186
|
return {
|
|
186
187
|
success: false,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { deepMerge, } from "../../utils/deep-merge.js";
|
|
2
|
+
import { isRecord, } from "../../utils/records.js";
|
|
2
3
|
import { compareStrings, stableHash, } from "../../utils/stable-hash.js";
|
|
3
4
|
import { jsonInput, num, schemaColumnsInput, unknownJsonInput, } from "../coerce.js";
|
|
4
5
|
import { executionMode, } from "../flags.js";
|
|
@@ -8,9 +9,6 @@ import { enqueueCliWarning, readIfExists, skipResult, } from "../output.js";
|
|
|
8
9
|
import { commandUsage, withUsage, } from "../syntax.js";
|
|
9
10
|
import { requireArgs, UsageError, } from "../usage.js";
|
|
10
11
|
const MAX_SCHEMA_DIFFERENCES = 50;
|
|
11
|
-
function isPlainObject(value) {
|
|
12
|
-
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
13
|
-
}
|
|
14
12
|
function appendSchemaPath(parent, key) {
|
|
15
13
|
return /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(key)
|
|
16
14
|
? (parent ? `${parent}.${key}` : key)
|
|
@@ -21,7 +19,7 @@ function collectSchemaDifferences(expected, actual, path, acc) {
|
|
|
21
19
|
// subtrees (any key order) match exactly and are never descended into.
|
|
22
20
|
if (stableHash(expected) === stableHash(actual))
|
|
23
21
|
return;
|
|
24
|
-
if (
|
|
22
|
+
if (isRecord(expected) && isRecord(actual)) {
|
|
25
23
|
const keys = [...new Set([...Object.keys(expected), ...Object.keys(actual),]),].sort(compareStrings);
|
|
26
24
|
for (const key of keys) {
|
|
27
25
|
const nextPath = appendSchemaPath(path, key);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { mkdir, writeFile, } from "node:fs/promises";
|
|
2
2
|
import { dirname, resolve, } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { asRecord, } from "../../utils/records.js";
|
|
4
|
+
import { jobBuildTargetTypeFromFlags, jobLogFilterFromFlag, maxLogLinesFromFlags, num, } from "../coerce.js";
|
|
4
5
|
import { executionMode, } from "../flags.js";
|
|
5
6
|
import { encodedProjectEndpoint, } from "../output.js";
|
|
6
7
|
import { commandUsage, withUsage, } from "../syntax.js";
|
|
@@ -11,7 +12,7 @@ import { requireArgs, UsageError, } from "../usage.js";
|
|
|
11
12
|
function nestedValue(value, path) {
|
|
12
13
|
let current = value;
|
|
13
14
|
for (const key of path) {
|
|
14
|
-
const record =
|
|
15
|
+
const record = asRecord(current);
|
|
15
16
|
if (!record)
|
|
16
17
|
return undefined;
|
|
17
18
|
current = record[key];
|
|
@@ -95,7 +96,7 @@ function collectWarningCounts(value, inActivity, counts) {
|
|
|
95
96
|
collectWarningCounts(item, inActivity, counts);
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
|
-
const record =
|
|
99
|
+
const record = asRecord(value);
|
|
99
100
|
if (!record)
|
|
100
101
|
return;
|
|
101
102
|
for (const [key, item,] of Object.entries(record)) {
|
package/dist/src/cli/contract.js
CHANGED
|
@@ -734,7 +734,7 @@ function inferSideEffect(resource, action) {
|
|
|
734
734
|
// LLM Mesh completions/embeddings invoke the LLM provider (cost-bearing,
|
|
735
735
|
// arbitrary-prompt execution); the verb shapes match no mutating pattern
|
|
736
736
|
// and would fall through to read, wrongly rejecting --plan. Knowledge-bank
|
|
737
|
-
// search stays
|
|
737
|
+
// search stays read: it only queries an existing index.
|
|
738
738
|
if (resource === "llm" && (action === "completions" || action === "embeddings")) {
|
|
739
739
|
return "write";
|
|
740
740
|
}
|
package/dist/src/cli/env.js
CHANGED
|
@@ -56,7 +56,8 @@ export function loadEnvFile() {
|
|
|
56
56
|
continue;
|
|
57
57
|
const key = trimmed.slice(0, eq).trim();
|
|
58
58
|
const val = trimmed.slice(eq + 1).trim().replace(/^['"]|['"]$/g, "");
|
|
59
|
-
|
|
59
|
+
// A variable set in the environment, even to "", wins over .env ("" clears it).
|
|
60
|
+
if (isAllowedEnvKey(key) && process.env[key] === undefined) {
|
|
60
61
|
process.env[key] = val;
|
|
61
62
|
(index === 0 ? projectEnvVars : installEnvVars).add(key);
|
|
62
63
|
}
|
package/dist/src/cli/flags.d.ts
CHANGED
package/dist/src/cli/flags.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
1
|
import { parseBooleanOption, } from "./coerce.js";
|
|
2
2
|
import { unsupportedHelpFlag, UsageError, } from "./usage.js";
|
|
3
3
|
/** Planning wins dispatch; dryRun remains set for combined plan metadata. */
|
|
4
|
-
const EXECUTION_MODES = [
|
|
5
|
-
Object.freeze({ plan: false, dryRun: false, }),
|
|
6
|
-
Object.freeze({ plan: false, dryRun: true, }),
|
|
7
|
-
Object.freeze({ plan: true, dryRun: false, }),
|
|
8
|
-
Object.freeze({ plan: true, dryRun: true, }),
|
|
9
|
-
];
|
|
10
4
|
export function executionMode(flags) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
return {
|
|
6
|
+
plan: parseBooleanOption(flags["plan"], "--plan") ?? false,
|
|
7
|
+
dryRun: parseBooleanOption(flags["dry-run"], "--dry-run") ?? false,
|
|
8
|
+
};
|
|
14
9
|
}
|
|
15
10
|
export const BOOLEAN_FLAGS = new Set([
|
|
16
11
|
"verbose",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as fs from "node:fs";
|
|
2
2
|
import { ClientValidationError, } from "../../errors.js";
|
|
3
3
|
import { canonicalDssUrl, } from "../../utils/dss-url.js";
|
|
4
|
+
import { asRecord, } from "../../utils/records.js";
|
|
4
5
|
import { compareStrings, } from "../../utils/stable-hash.js";
|
|
5
|
-
import { parseJsonObject,
|
|
6
|
+
import { parseJsonObject, stableHash, stableJson, } from "../coerce.js";
|
|
6
7
|
import { UsageError, } from "../usage.js";
|
|
7
8
|
/**
|
|
8
9
|
* Version 3 binds every snapshot to both its DSS server and the concrete project
|
|
@@ -124,7 +125,7 @@ export function parseAppPermissionsSnapshot(text, source) {
|
|
|
124
125
|
const capturedAt = requiredSnapshotString(record, "capturedAt", source);
|
|
125
126
|
const hash = requiredSnapshotString(record, "hash", source);
|
|
126
127
|
const permissionsHash = requiredSnapshotString(record, "permissionsHash", source);
|
|
127
|
-
const permissions =
|
|
128
|
+
const permissions = asRecord(record["permissions"]);
|
|
128
129
|
if (!permissions) {
|
|
129
130
|
throw new UsageError(`${source} is not an app permissions snapshot: "permissions" must be a JSON object.`, "validation_failed");
|
|
130
131
|
}
|
|
@@ -209,8 +210,8 @@ function pushDifference(out, path, backup, current) {
|
|
|
209
210
|
function collectDifferences(path, backup, current, out) {
|
|
210
211
|
if (stableJson(backup) === stableJson(current))
|
|
211
212
|
return;
|
|
212
|
-
const backupRecord =
|
|
213
|
-
const currentRecord =
|
|
213
|
+
const backupRecord = asRecord(backup);
|
|
214
|
+
const currentRecord = asRecord(current);
|
|
214
215
|
if (backupRecord && currentRecord) {
|
|
215
216
|
const keys = [...new Set([...Object.keys(backupRecord), ...Object.keys(currentRecord),]),]
|
|
216
217
|
.sort(compareStrings);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { readFileSync, } from "node:fs";
|
|
2
|
+
import { asRecord, } from "../../utils/records.js";
|
|
2
3
|
import { compareStrings, } from "../../utils/stable-hash.js";
|
|
3
|
-
import { finiteNumberField, jsonInput, optionalStringField, parseJsonObject,
|
|
4
|
+
import { finiteNumberField, jsonInput, optionalStringField, parseJsonObject, requiredStringArray, splitCsvFlag, } from "../coerce.js";
|
|
4
5
|
import { commandUsage, } from "../syntax.js";
|
|
5
6
|
import { UsageError, } from "../usage.js";
|
|
6
7
|
export function flowZoneId(value) {
|
|
@@ -107,7 +108,7 @@ export function flowZonePlanColor(value, source) {
|
|
|
107
108
|
export function flowZonePlanPosition(value, source) {
|
|
108
109
|
if (value === undefined)
|
|
109
110
|
return undefined;
|
|
110
|
-
const record =
|
|
111
|
+
const record = asRecord(value);
|
|
111
112
|
if (!record) {
|
|
112
113
|
throw new UsageError(`${source} must be an object with x and y.`, "validation_failed");
|
|
113
114
|
}
|
|
@@ -117,7 +118,7 @@ export function flowZonePlanPosition(value, source) {
|
|
|
117
118
|
};
|
|
118
119
|
}
|
|
119
120
|
export function flowZoneCurrentPosition(zone) {
|
|
120
|
-
const position =
|
|
121
|
+
const position = asRecord(zone.position);
|
|
121
122
|
if (!position)
|
|
122
123
|
return undefined;
|
|
123
124
|
const x = position.x;
|
|
@@ -134,7 +135,7 @@ export function flowZoneSamePosition(a, b) {
|
|
|
134
135
|
export function parseFlowZonePlanItem(value, source) {
|
|
135
136
|
if (typeof value === "string")
|
|
136
137
|
return parseFlowZoneObject(value);
|
|
137
|
-
const record =
|
|
138
|
+
const record = asRecord(value);
|
|
138
139
|
if (!record) {
|
|
139
140
|
throw new UsageError(`${source} must be TYPE:ID or an object.`, "validation_failed");
|
|
140
141
|
}
|
|
@@ -213,7 +214,7 @@ export function parseFlowZoneOrganizePlan(input) {
|
|
|
213
214
|
...(topologyFingerprint ? { topologyFingerprint, } : {}),
|
|
214
215
|
zones: zones.map((value, index) => {
|
|
215
216
|
const source = `zones[${index}]`;
|
|
216
|
-
const record =
|
|
217
|
+
const record = asRecord(value);
|
|
217
218
|
if (!record)
|
|
218
219
|
throw new UsageError(`${source} must be an object.`, "validation_failed");
|
|
219
220
|
const id = optionalStringField(record, ["id", "zoneId",]);
|
|
@@ -37,8 +37,6 @@ export interface CliVersionPayload {
|
|
|
37
37
|
buildRevision: string | null;
|
|
38
38
|
staleBuild: boolean;
|
|
39
39
|
}
|
|
40
|
-
/** Bun is the only supported runtime; the field is retained for payload stability. */
|
|
41
|
-
export declare function detectRuntime(): CliRuntime;
|
|
42
40
|
export declare function buildVersionPayload(input: {
|
|
43
41
|
packageVersion: string;
|
|
44
42
|
checkoutRevision: string | undefined;
|
package/dist/src/cli/version.js
CHANGED
|
@@ -182,10 +182,6 @@ export function sourceTreeNewerThanBuild(packageRoot) {
|
|
|
182
182
|
return false;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
/** Bun is the only supported runtime; the field is retained for payload stability. */
|
|
186
|
-
export function detectRuntime() {
|
|
187
|
-
return "bun";
|
|
188
|
-
}
|
|
189
185
|
export function buildVersionPayload(input) {
|
|
190
186
|
const isDist = input.loadSource === "dist";
|
|
191
187
|
// Source execution never claims a build revision, even if the environment
|
|
@@ -212,10 +208,11 @@ export const AGENT_CONTRACT_VERSION = 2;
|
|
|
212
208
|
export const JSON_SCHEMA_DRAFT = "https://json-schema.org/draft/2020-12/schema";
|
|
213
209
|
export const AGENT_CONTRACT_SCHEMA_ID = "https://clssck.github.io/dataiku-sdk/schemas/agent-contract-v2.json";
|
|
214
210
|
export function cliVersionResult() {
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
const
|
|
218
|
-
/* oxlint-
|
|
211
|
+
// Only code actually loaded from dist/ may report dist provenance; an
|
|
212
|
+
// inherited DSS_LOAD_SOURCE on a source run is ignored.
|
|
213
|
+
const loadSource = detectLoadSource();
|
|
214
|
+
/* oxlint-disable-next-line dss/no-direct-process-env -- launcher-injected build revision */
|
|
215
|
+
const envBuildRevision = loadSource === "dist" ? process.env["DSS_BUILD_REVISION"] : undefined;
|
|
219
216
|
return buildVersionPayload({
|
|
220
217
|
packageVersion: CLI_VERSION,
|
|
221
218
|
checkoutRevision: CLI_GIT_REVISION,
|
|
@@ -227,6 +224,6 @@ export function cliVersionResult() {
|
|
|
227
224
|
sourceNewerThanBuild: loadSource === "dist"
|
|
228
225
|
? sourceTreeNewerThanBuild(PACKAGE_ROOT)
|
|
229
226
|
: false,
|
|
230
|
-
runtime:
|
|
227
|
+
runtime: "bun",
|
|
231
228
|
});
|
|
232
229
|
}
|