@holistics/cli-core 2.1.16 → 2.2.1
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.js +241 -192
- package/package.json +1 -1
package/dist/commands.js
CHANGED
|
@@ -27399,7 +27399,7 @@ var require_dist3 = __commonJS((exports2) => {
|
|
|
27399
27399
|
exports2.default = deferred;
|
|
27400
27400
|
});
|
|
27401
27401
|
// package.json
|
|
27402
|
-
var version = "2.1
|
|
27402
|
+
var version = "2.2.1";
|
|
27403
27403
|
|
|
27404
27404
|
// ../../node_modules/.pnpm/@commander-js+extra-typings@13.1.0_commander@13.1.0/node_modules/@commander-js/extra-typings/esm.mjs
|
|
27405
27405
|
var import__ = __toESM(require_extra_typings(), 1);
|
|
@@ -40051,6 +40051,7 @@ var LOG_RETENTION_DAYS = 30;
|
|
|
40051
40051
|
var LOG_FILE_PREFIX = "cli-error-";
|
|
40052
40052
|
var LOG_FILE_SUFFIX = ".log";
|
|
40053
40053
|
var runLogPath;
|
|
40054
|
+
var invokedCommand = process.argv.slice(2).join(" ");
|
|
40054
40055
|
var c = {
|
|
40055
40056
|
reset: "\x1B[0m",
|
|
40056
40057
|
bold: "\x1B[1m",
|
|
@@ -40108,7 +40109,7 @@ function truncateLog(s) {
|
|
|
40108
40109
|
function removeStackTraceLogArgs(...args) {
|
|
40109
40110
|
if (args.some((arg) => arg instanceof Error)) {
|
|
40110
40111
|
const noStackTraceMsg = args.map((arg) => arg instanceof Error ? `${arg.name}: ${arg.message}` : String(arg)).join(" ");
|
|
40111
|
-
return noStackTraceMsg;
|
|
40112
|
+
return [noStackTraceMsg];
|
|
40112
40113
|
}
|
|
40113
40114
|
return args;
|
|
40114
40115
|
}
|
|
@@ -40116,7 +40117,7 @@ async function logErrorToFile(...args) {
|
|
|
40116
40117
|
return new Promise((resolve) => {
|
|
40117
40118
|
try {
|
|
40118
40119
|
const message = args.map((arg) => arg instanceof Error ? formatError2(arg) : String(arg)).join(" ");
|
|
40119
|
-
const line = `[${new Date().toISOString()}] ${message}
|
|
40120
|
+
const line = `[${new Date().toISOString()}] [${invokedCommand}] ${message}
|
|
40120
40121
|
`;
|
|
40121
40122
|
fs2.appendFile(getRunLogPath(), line, { mode: 384 }, () => resolve());
|
|
40122
40123
|
} catch {
|
|
@@ -40128,7 +40129,7 @@ function log(...args) {
|
|
|
40128
40129
|
console.log(...args);
|
|
40129
40130
|
}
|
|
40130
40131
|
async function logErr(...args) {
|
|
40131
|
-
console.error(removeStackTraceLogArgs(...args));
|
|
40132
|
+
console.error(...removeStackTraceLogArgs(...args));
|
|
40132
40133
|
await logErrorToFile(...args);
|
|
40133
40134
|
}
|
|
40134
40135
|
async function logErrWithTruncate(s) {
|
|
@@ -42794,13 +42795,13 @@ For agents:
|
|
|
42794
42795
|
var auth_default = command3;
|
|
42795
42796
|
|
|
42796
42797
|
// src/commands/aml/compile.ts
|
|
42797
|
-
import * as
|
|
42798
|
-
import * as
|
|
42798
|
+
import * as fs14 from "fs";
|
|
42799
|
+
import * as path11 from "path";
|
|
42799
42800
|
|
|
42800
42801
|
// src/commands/aml/common.ts
|
|
42801
42802
|
var import_fast_glob = __toESM(require_out4(), 1);
|
|
42802
|
-
import
|
|
42803
|
-
import
|
|
42803
|
+
import fs12 from "fs";
|
|
42804
|
+
import path8 from "path";
|
|
42804
42805
|
|
|
42805
42806
|
// ../../node_modules/.pnpm/@holistics+aml@7.4.3/node_modules/@holistics/aml/dist/aml.es.js
|
|
42806
42807
|
var exports_aml_es = {};
|
|
@@ -65141,7 +65142,7 @@ Type GoToUrlAction {
|
|
|
65141
65142
|
|
|
65142
65143
|
Type VizAction = GoToUrlAction
|
|
65143
65144
|
` };
|
|
65144
|
-
function
|
|
65145
|
+
function Ne3(e) {
|
|
65145
65146
|
return e?.replace(/::/g, ".");
|
|
65146
65147
|
}
|
|
65147
65148
|
function xl2(e) {
|
|
@@ -65149,7 +65150,7 @@ function xl2(e) {
|
|
|
65149
65150
|
throw new Error("Expect an object");
|
|
65150
65151
|
return {
|
|
65151
65152
|
id: e.id,
|
|
65152
|
-
name:
|
|
65153
|
+
name: Ne3(e.__fqn__ || e.uname || e.name) ?? "",
|
|
65153
65154
|
label: e.label || e.title,
|
|
65154
65155
|
data_models: (e.data_models || e.dataModels || []).map((t) => {
|
|
65155
65156
|
const n = t.dimensions ?? [], o = t.measures ?? [], r3 = t.params ?? [], i2 = t.fields ?? [].concat(n).concat(o).concat(r3);
|
|
@@ -65177,7 +65178,7 @@ function xl2(e) {
|
|
|
65177
65178
|
};
|
|
65178
65179
|
}
|
|
65179
65180
|
function Cm2(e) {
|
|
65180
|
-
return typeof e == "string" ? e :
|
|
65181
|
+
return typeof e == "string" ? e : Ne3(e.__fqn__ || e.name);
|
|
65181
65182
|
}
|
|
65182
65183
|
function Pm2(e, t) {
|
|
65183
65184
|
const n = Cm2(t);
|
|
@@ -67070,7 +67071,7 @@ function vb2(e) {
|
|
|
67070
67071
|
return { color: e };
|
|
67071
67072
|
if (e.__type__ === "LabeledColor")
|
|
67072
67073
|
return import_lodash.omitBy({
|
|
67073
|
-
_id: e.__fqn__ ?
|
|
67074
|
+
_id: e.__fqn__ ? Ne3(e.__fqn__) : undefined,
|
|
67074
67075
|
label: e.label,
|
|
67075
67076
|
color: e.color
|
|
67076
67077
|
}, import_lodash.isUndefined);
|
|
@@ -67081,20 +67082,20 @@ function wb2(e) {
|
|
|
67081
67082
|
return;
|
|
67082
67083
|
const t = Array.isArray(e.colors) ? e.colors.map((n) => vb2(n)).filter(Boolean) : [];
|
|
67083
67084
|
return {
|
|
67084
|
-
...e.__fqn__ && { _id:
|
|
67085
|
+
...e.__fqn__ && { _id: Ne3(e.__fqn__) },
|
|
67085
67086
|
colors: t
|
|
67086
67087
|
};
|
|
67087
67088
|
}
|
|
67088
67089
|
function Wm2(e = {}) {
|
|
67089
67090
|
return import_lodash.omitBy({
|
|
67090
|
-
_id:
|
|
67091
|
+
_id: Ne3(e.__fqn__),
|
|
67091
67092
|
title: e.title,
|
|
67092
67093
|
categorical: wb2(e.categorical)
|
|
67093
67094
|
}, import_lodash.isUndefined);
|
|
67094
67095
|
}
|
|
67095
67096
|
function Bl2(e) {
|
|
67096
67097
|
if (!import_lodash.isNil(e))
|
|
67097
|
-
return e.__fqn__ ?
|
|
67098
|
+
return e.__fqn__ ? Ne3(e.__fqn__) : Wm2(e);
|
|
67098
67099
|
}
|
|
67099
67100
|
var Fl2 = {
|
|
67100
67101
|
"pastel-1": -1,
|
|
@@ -75166,7 +75167,7 @@ function DS2(e, t) {
|
|
|
75166
75167
|
function Fh2(e) {
|
|
75167
75168
|
if (!import_lodash.isNil(e))
|
|
75168
75169
|
return import_lodash.omitBy({
|
|
75169
|
-
_id:
|
|
75170
|
+
_id: Ne3(e.__fqn__),
|
|
75170
75171
|
data: Bl2(e.data)
|
|
75171
75172
|
}, import_lodash.isUndefined);
|
|
75172
75173
|
}
|
|
@@ -75197,7 +75198,7 @@ function tc2(e) {
|
|
|
75197
75198
|
};
|
|
75198
75199
|
}
|
|
75199
75200
|
return {
|
|
75200
|
-
_id:
|
|
75201
|
+
_id: Ne3(e.__fqn__),
|
|
75201
75202
|
top: At3(e.top),
|
|
75202
75203
|
left: At3(e.left),
|
|
75203
75204
|
bottom: At3(e.bottom),
|
|
@@ -75217,7 +75218,7 @@ function BS2(e) {
|
|
|
75217
75218
|
};
|
|
75218
75219
|
}
|
|
75219
75220
|
return {
|
|
75220
|
-
_id:
|
|
75221
|
+
_id: Ne3(e.__fqn__),
|
|
75221
75222
|
top_left: At3(e.top_left),
|
|
75222
75223
|
top_right: At3(e.top_right),
|
|
75223
75224
|
bottom_left: At3(e.bottom_left),
|
|
@@ -75233,7 +75234,7 @@ function co2(e, t) {
|
|
|
75233
75234
|
t[e.font_family] = e.font_source;
|
|
75234
75235
|
}
|
|
75235
75236
|
return import_lodash.omitBy({
|
|
75236
|
-
_id:
|
|
75237
|
+
_id: Ne3(e.__fqn__),
|
|
75237
75238
|
font_family: e.font_family,
|
|
75238
75239
|
font_source: e.font_source,
|
|
75239
75240
|
font_size: Lt3(e.font_size),
|
|
@@ -75257,7 +75258,7 @@ var Mh2 = {
|
|
|
75257
75258
|
function fo2(e) {
|
|
75258
75259
|
if (!import_lodash.isNil(e))
|
|
75259
75260
|
return import_lodash.omitBy({
|
|
75260
|
-
_id:
|
|
75261
|
+
_id: Ne3(e.__fqn__),
|
|
75261
75262
|
bg_color: e.bg_color,
|
|
75262
75263
|
bg_image: e.bg_image,
|
|
75263
75264
|
bg_repeat: Mh2[String(e.bg_repeat)],
|
|
@@ -75267,7 +75268,7 @@ function fo2(e) {
|
|
|
75267
75268
|
function zh2(e) {
|
|
75268
75269
|
if (!import_lodash.isNil(e))
|
|
75269
75270
|
return import_lodash.omitBy({
|
|
75270
|
-
_id:
|
|
75271
|
+
_id: Ne3(e.__fqn__),
|
|
75271
75272
|
border_width: tc2(e.border_width),
|
|
75272
75273
|
border_radius: BS2(e.border_radius),
|
|
75273
75274
|
border_color: e.border_color,
|
|
@@ -75277,7 +75278,7 @@ function zh2(e) {
|
|
|
75277
75278
|
function FS2(e) {
|
|
75278
75279
|
if (!import_lodash.isNil(e))
|
|
75279
75280
|
return import_lodash.omitBy({
|
|
75280
|
-
_id:
|
|
75281
|
+
_id: Ne3(e.__fqn__),
|
|
75281
75282
|
outer: !!e.outer,
|
|
75282
75283
|
vertical: !!e.vertical,
|
|
75283
75284
|
horizontal: !!e.horizontal,
|
|
@@ -75335,7 +75336,7 @@ function MS2(e) {
|
|
|
75335
75336
|
line: import_lodash.isEmpty(g2) ? undefined : g2,
|
|
75336
75337
|
column: import_lodash.isEmpty(A) ? undefined : A
|
|
75337
75338
|
}, import_lodash.isUndefined), v2 = {
|
|
75338
|
-
_id:
|
|
75339
|
+
_id: Ne3(e.__fqn__),
|
|
75339
75340
|
general: l,
|
|
75340
75341
|
border: c2,
|
|
75341
75342
|
header: u,
|
|
@@ -75350,7 +75351,7 @@ function MS2(e) {
|
|
|
75350
75351
|
function En3(e, t) {
|
|
75351
75352
|
if (!import_lodash.isNil(e))
|
|
75352
75353
|
return import_lodash.omitBy({
|
|
75353
|
-
_id:
|
|
75354
|
+
_id: Ne3(e.__fqn__),
|
|
75354
75355
|
label: co2(e.label, t),
|
|
75355
75356
|
text: co2(e.text, t),
|
|
75356
75357
|
border: zh2(e.border),
|
|
@@ -75363,7 +75364,7 @@ function En3(e, t) {
|
|
|
75363
75364
|
function Ih2(e) {
|
|
75364
75365
|
if (!import_lodash.isNil(e))
|
|
75365
75366
|
return import_lodash.omitBy({
|
|
75366
|
-
_id:
|
|
75367
|
+
_id: Ne3(e.__fqn__),
|
|
75367
75368
|
border: zh2(e.border),
|
|
75368
75369
|
background: fo2(e.background),
|
|
75369
75370
|
shadow: e.shadow,
|
|
@@ -75390,7 +75391,7 @@ function zS2(e, t) {
|
|
|
75390
75391
|
neutral: fs10(r3.neutral, t)
|
|
75391
75392
|
}, import_lodash.isEmpty) : undefined;
|
|
75392
75393
|
return import_lodash.omitBy({
|
|
75393
|
-
_id:
|
|
75394
|
+
_id: Ne3(e.__fqn__),
|
|
75394
75395
|
alignment: e.alignment,
|
|
75395
75396
|
label: co2(e.label, t),
|
|
75396
75397
|
value: co2(e.value, t),
|
|
@@ -75401,7 +75402,7 @@ function zS2(e, t) {
|
|
|
75401
75402
|
function Oh2(e, t) {
|
|
75402
75403
|
if (!import_lodash.isNil(e))
|
|
75403
75404
|
return import_lodash.omitBy({
|
|
75404
|
-
_id:
|
|
75405
|
+
_id: Ne3(e.__fqn__),
|
|
75405
75406
|
color: Fh2(e.color),
|
|
75406
75407
|
table: MS2(e.table),
|
|
75407
75408
|
metric_kpi: zS2(e.metric_kpi, t)
|
|
@@ -75422,7 +75423,7 @@ function IS2(e, t) {
|
|
|
75422
75423
|
`), `.${uy2}`).trim();
|
|
75423
75424
|
if (!(!t && !o))
|
|
75424
75425
|
return import_lodash.omitBy({
|
|
75425
|
-
_id:
|
|
75426
|
+
_id: Ne3(t?.__fqn__),
|
|
75426
75427
|
original: t?.content,
|
|
75427
75428
|
final: o
|
|
75428
75429
|
}, import_lodash.isUndefined);
|
|
@@ -75432,7 +75433,7 @@ function Rh2(e) {
|
|
|
75432
75433
|
return;
|
|
75433
75434
|
const t = {};
|
|
75434
75435
|
return import_lodash.omitBy({
|
|
75435
|
-
_id:
|
|
75436
|
+
_id: Ne3(e.__fqn__),
|
|
75436
75437
|
title: e.title,
|
|
75437
75438
|
background: fo2(e.background),
|
|
75438
75439
|
canvas: Ih2(e.canvas),
|
|
@@ -75902,7 +75903,7 @@ function jh2(e) {
|
|
|
75902
75903
|
});
|
|
75903
75904
|
const o = e.template.content, r3 = e.template.name;
|
|
75904
75905
|
return {
|
|
75905
|
-
_id:
|
|
75906
|
+
_id: Ne3(e.__fqn__),
|
|
75906
75907
|
label: e.label ?? "Untitled",
|
|
75907
75908
|
description: e.description,
|
|
75908
75909
|
icon: e.icon,
|
|
@@ -75929,7 +75930,7 @@ var aE2 = (e, t) => {
|
|
|
75929
75930
|
settings: r3
|
|
75930
75931
|
}, { custom_chart: a, custom_chart_id: s2 } = e;
|
|
75931
75932
|
if (a)
|
|
75932
|
-
a.__fqn__ ? i2.custom_chart_id =
|
|
75933
|
+
a.__fqn__ ? i2.custom_chart_id = Ne3(a.__fqn__) : i2.custom_chart_def = jh2(a);
|
|
75933
75934
|
else if (s2)
|
|
75934
75935
|
i2.custom_chart_id = s2;
|
|
75935
75936
|
else
|
|
@@ -78106,7 +78107,7 @@ function r$(e) {
|
|
|
78106
78107
|
return !!o && ml2.includes(o);
|
|
78107
78108
|
}
|
|
78108
78109
|
function i$(e) {
|
|
78109
|
-
const { value: t,
|
|
78110
|
+
const { value: t, fqn: n } = e, o = Ne3(n) ?? e.name.replace(/::/g, "."), r3 = t.__decorators__.template, {
|
|
78110
78111
|
funcType: i2,
|
|
78111
78112
|
title: a,
|
|
78112
78113
|
description: s2,
|
|
@@ -78639,7 +78640,7 @@ function gD(e, t) {
|
|
|
78639
78640
|
const se3 = i2[be3] || {}, Ye3 = ae3.columns || [];
|
|
78640
78641
|
if (Ye3.length === 0)
|
|
78641
78642
|
return "";
|
|
78642
|
-
const de3 = !!se3.show_stack_total, De2 = !!se3.reversed_stack, He3 = !!se3.show_group_total, N = !!se3.group_long_tail, S3 = Number(se3.maximum_groups), ve3 = !!se3.show_data_label, Me2 = !!se3.show_series_percentage,
|
|
78643
|
+
const de3 = !!se3.show_stack_total, De2 = !!se3.reversed_stack, He3 = !!se3.show_group_total, N = !!se3.group_long_tail, S3 = Number(se3.maximum_groups), ve3 = !!se3.show_data_label, Me2 = !!se3.show_series_percentage, Ve3 = !!se3.stack_series, C = se3.stack_type, $2 = vn3(se3.min), ht3 = vn3(se3.max), xe2 = !!se3.hidden, Ge2 = se3.align !== undefined && se3.align !== Ml2 ? `alignment: ${y(se3.align)}` : "", Le2 = se3.scale_type !== undefined && se3.scale_type !== zl2 ? `scale: ${y(se3.scale_type)}` : "", wt3 = $2 !== undefined ? `axis_min: ${$2}` : "", Jt2 = ht3 !== undefined ? `axis_max: ${ht3}` : "", An3 = de3 ? `show_stack_total: ${de3}` : "", Gn3 = De2 ? `reverse_stack: ${De2}` : "", qt3 = He3 ? `show_total_in_tooltip: ${He3}` : "", re3 = N && S3 ? `group_values_into: ${S3}` : "", Kn3 = ve3 ? `show_data_label_by: ${y(Me2 ? "percentage" : "value")}` : "", Ri2 = Ve3 ? `stack_series_by: ${y(C === "percent" ? "percentage" : "value")}` : "", z2 = xe2 ? `hidden: ${xe2}` : "", Ee3 = [
|
|
78643
78644
|
Ge2,
|
|
78644
78645
|
Le2,
|
|
78645
78646
|
wt3,
|
|
@@ -78690,14 +78691,14 @@ function gD(e, t) {
|
|
|
78690
78691
|
${Vc2}
|
|
78691
78692
|
}` : "";
|
|
78692
78693
|
}).filter(Boolean).join(`
|
|
78693
|
-
`),
|
|
78694
|
+
`), je2 = [
|
|
78694
78695
|
M2,
|
|
78695
78696
|
ie3,
|
|
78696
78697
|
Ce3
|
|
78697
78698
|
].filter(Boolean).join(`
|
|
78698
78699
|
`);
|
|
78699
|
-
return
|
|
78700
|
-
${
|
|
78700
|
+
return je2 ? ` y_axis {
|
|
78701
|
+
${je2}
|
|
78701
78702
|
}` : "";
|
|
78702
78703
|
}).filter(Boolean).join(`
|
|
78703
78704
|
`) : "", K2 = vo3(a, t), te3 = K2 ? `tooltips: ${K2}` : "";
|
|
@@ -78732,14 +78733,14 @@ function _D(e, t) {
|
|
|
78732
78733
|
const te3 = K2.series_settings || {}, Ue3 = te3.color && te3.color !== "auto" ? te3.color : K2.color, ae3 = Ue3 !== undefined && Ue3 !== "auto" ? `color: ${y(Ue3)}` : "", be3 = Kg2(te3);
|
|
78733
78734
|
let se3 = "";
|
|
78734
78735
|
typeof te3.series_hash == "object" && !import_lodash.isEmpty(te3.series_hash) && (se3 = Object.entries(te3.series_hash).map(([He3, N]) => {
|
|
78735
|
-
const S3 = `value: ${y(He3)}`, ve3 = N.color !== undefined && N.color !== "auto" ? `color: ${y(N.color)}` : "", Me2 = N.hidden === true ? `hidden: ${N.hidden}` : "",
|
|
78736
|
+
const S3 = `value: ${y(He3)}`, ve3 = N.color !== undefined && N.color !== "auto" ? `color: ${y(N.color)}` : "", Me2 = N.hidden === true ? `hidden: ${N.hidden}` : "", Ve3 = [
|
|
78736
78737
|
S3,
|
|
78737
78738
|
ve3,
|
|
78738
78739
|
Me2
|
|
78739
78740
|
].filter(Boolean).join(`
|
|
78740
78741
|
`);
|
|
78741
|
-
return !ve3 && !Me2 || !
|
|
78742
|
-
${
|
|
78742
|
+
return !ve3 && !Me2 || !Ve3 ? "" : ` point {
|
|
78743
|
+
${Ve3}
|
|
78743
78744
|
}`;
|
|
78744
78745
|
}).filter(Boolean).join(`
|
|
78745
78746
|
`));
|
|
@@ -80509,7 +80510,7 @@ function Mi2({
|
|
|
80509
80510
|
}));
|
|
80510
80511
|
return [...s2, ...u, ...l];
|
|
80511
80512
|
}
|
|
80512
|
-
function
|
|
80513
|
+
function qe3({
|
|
80513
80514
|
amlPropName: e,
|
|
80514
80515
|
amlPropType: t,
|
|
80515
80516
|
propDiffToAml: n = ({ diff: i2 }) => i2.newValue,
|
|
@@ -80543,8 +80544,8 @@ var pB = {
|
|
|
80543
80544
|
filter: me3
|
|
80544
80545
|
};
|
|
80545
80546
|
var mB = {
|
|
80546
|
-
label:
|
|
80547
|
-
description:
|
|
80547
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80548
|
+
description: qe3({ amlPropName: "description", amlPropType: "text" }),
|
|
80548
80549
|
theme({ diff: e, astPath: t }) {
|
|
80549
80550
|
const n = kn3(e.newValue), o = n ? H2("theme", n) : undefined;
|
|
80550
80551
|
return [Se3({
|
|
@@ -80591,8 +80592,8 @@ var hB = {
|
|
|
80591
80592
|
viz: me3
|
|
80592
80593
|
};
|
|
80593
80594
|
var gB = {
|
|
80594
|
-
label:
|
|
80595
|
-
description:
|
|
80595
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80596
|
+
description: qe3({ amlPropName: "description", amlPropType: "text" }),
|
|
80596
80597
|
theme({ diff: e, astPath: t }) {
|
|
80597
80598
|
const n = kn3(e.newValue), o = n ? H2("theme", n) : undefined;
|
|
80598
80599
|
return [Se3({
|
|
@@ -80648,7 +80649,7 @@ var bB = {
|
|
|
80648
80649
|
}` : undefined
|
|
80649
80650
|
})];
|
|
80650
80651
|
},
|
|
80651
|
-
content:
|
|
80652
|
+
content: qe3({
|
|
80652
80653
|
amlPropName: "content",
|
|
80653
80654
|
propDiffToAml: ({ diff: e }) => `@md ${ot3(e.newValue || "", {
|
|
80654
80655
|
sanitizeHeredocTermination: true,
|
|
@@ -80669,8 +80670,8 @@ var wB = {
|
|
|
80669
80670
|
pop: me3
|
|
80670
80671
|
};
|
|
80671
80672
|
var kB = {
|
|
80672
|
-
label:
|
|
80673
|
-
description:
|
|
80673
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80674
|
+
description: qe3({ amlPropName: "description", amlPropType: "text" }),
|
|
80674
80675
|
theme({ diff: e, astPath: t }) {
|
|
80675
80676
|
const n = kn3(e.newValue), o = n ? H2("theme", n) : undefined;
|
|
80676
80677
|
return [Se3({
|
|
@@ -80710,8 +80711,8 @@ var xB = {
|
|
|
80710
80711
|
date_drill: me3
|
|
80711
80712
|
};
|
|
80712
80713
|
var TB = {
|
|
80713
|
-
label:
|
|
80714
|
-
description:
|
|
80714
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80715
|
+
description: qe3({ amlPropName: "description", amlPropType: "text" }),
|
|
80715
80716
|
theme({ diff: e, astPath: t }) {
|
|
80716
80717
|
const n = kn3(e.newValue), o = n ? H2("theme", n) : undefined;
|
|
80717
80718
|
return [Se3({
|
|
@@ -80754,8 +80755,8 @@ var CB = {
|
|
|
80754
80755
|
theme: So3
|
|
80755
80756
|
};
|
|
80756
80757
|
var PB = {
|
|
80757
|
-
label:
|
|
80758
|
-
prompt:
|
|
80758
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80759
|
+
prompt: qe3({
|
|
80759
80760
|
amlPropName: "prompt",
|
|
80760
80761
|
propDiffToAml: ({ diff: e }) => `@md ${ot3(e.newValue || "", EB)};;`
|
|
80761
80762
|
}),
|
|
@@ -80860,7 +80861,7 @@ var aF = (e) => ("fieldsDiff" in e.diff) ? Hn3({
|
|
|
80860
80861
|
context: e.context,
|
|
80861
80862
|
astPath: [...e.astPath, "mobile"],
|
|
80862
80863
|
generator: {
|
|
80863
|
-
mode:
|
|
80864
|
+
mode: qe3({ amlPropName: "mode", amlPropType: "text" }),
|
|
80864
80865
|
blocks: ({ diff: t, astPath: n, context: o }) => Mi2({
|
|
80865
80866
|
diff: t,
|
|
80866
80867
|
astPath: [...n, "block"],
|
|
@@ -80877,14 +80878,14 @@ var aF = (e) => ("fieldsDiff" in e.diff) ? Hn3({
|
|
|
80877
80878
|
text: r_2(e.diff.newValue)
|
|
80878
80879
|
})];
|
|
80879
80880
|
var sF = {
|
|
80880
|
-
label:
|
|
80881
|
-
width:
|
|
80881
|
+
label: qe3({ amlPropName: "label", amlPropType: "text" }),
|
|
80882
|
+
width: qe3({
|
|
80882
80883
|
amlPropName: "width",
|
|
80883
80884
|
amlPropType: "number",
|
|
80884
80885
|
propDiffToAml: ({ diff: e }) => a_2(e.newValue),
|
|
80885
80886
|
prependPropName: false
|
|
80886
80887
|
}),
|
|
80887
|
-
height:
|
|
80888
|
+
height: qe3({
|
|
80888
80889
|
amlPropName: "height",
|
|
80889
80890
|
amlPropType: "number",
|
|
80890
80891
|
propDiffToAml: ({ diff: e }) => s_2(e.newValue),
|
|
@@ -80911,16 +80912,16 @@ var sF = {
|
|
|
80911
80912
|
text: o
|
|
80912
80913
|
})];
|
|
80913
80914
|
},
|
|
80914
|
-
grid_size:
|
|
80915
|
+
grid_size: qe3({
|
|
80915
80916
|
amlPropName: "grid_size",
|
|
80916
80917
|
amlPropType: "number",
|
|
80917
80918
|
propDiffToAml: ({ diff: e }) => l_2(e.newValue),
|
|
80918
80919
|
prependPropName: false
|
|
80919
80920
|
}),
|
|
80920
|
-
auto_expand_vertically:
|
|
80921
|
-
auto_expand_horizontally:
|
|
80921
|
+
auto_expand_vertically: qe3({ amlPropName: "auto_expand_vertically", amlPropType: "boolean" }),
|
|
80922
|
+
auto_expand_horizontally: qe3({ amlPropName: "auto_expand_horizontally", amlPropType: "boolean" }),
|
|
80922
80923
|
mobile: aF,
|
|
80923
|
-
default_zoom:
|
|
80924
|
+
default_zoom: qe3({
|
|
80924
80925
|
amlPropName: "default_zoom",
|
|
80925
80926
|
propDiffToAml: ({ diff: e }) => i_2(e.newValue),
|
|
80926
80927
|
prependPropName: false
|
|
@@ -80941,7 +80942,7 @@ var lF = ({ diff: e, astPath: t, context: n }) => ("fieldsDiff" in e) ? k_2({
|
|
|
80941
80942
|
text: `tab ${e.newValue.uname}: ${Ao3(e.newValue)}`
|
|
80942
80943
|
})];
|
|
80943
80944
|
var cF = {
|
|
80944
|
-
label:
|
|
80945
|
+
label: qe3({
|
|
80945
80946
|
amlPropName: "label",
|
|
80946
80947
|
amlPropType: "text",
|
|
80947
80948
|
propDiffToAml: ({ diff: e }) => e.newValue
|
|
@@ -80970,11 +80971,11 @@ var dF = ({ diff: e, astPath: t, context: n }) => ("fieldsDiff" in e) ? e.newVal
|
|
|
80970
80971
|
text: `view: ${Ao3(e.newValue)}`
|
|
80971
80972
|
})];
|
|
80972
80973
|
var mF = {
|
|
80973
|
-
title:
|
|
80974
|
+
title: qe3({
|
|
80974
80975
|
amlPropName: "title",
|
|
80975
80976
|
amlPropType: "text"
|
|
80976
80977
|
}),
|
|
80977
|
-
description:
|
|
80978
|
+
description: qe3({
|
|
80978
80979
|
amlPropName: "description",
|
|
80979
80980
|
propDiffToAml: ({ diff: e }) => rn2(e.newValue)
|
|
80980
80981
|
}),
|
|
@@ -82568,6 +82569,87 @@ var A1 = (e, t = {}) => (e.options.childIdxForDynamicProp = true, e.registerCust
|
|
|
82568
82569
|
e.setDefinitionAtPath(r.create(`/modules/${fc2}/${n}`), o);
|
|
82569
82570
|
}), PM(e, t), e);
|
|
82570
82571
|
|
|
82572
|
+
// src/api/amlStudioApi.ts
|
|
82573
|
+
import os6 from "os";
|
|
82574
|
+
|
|
82575
|
+
// src/commands/code_sync/file_ops.ts
|
|
82576
|
+
import crypto3 from "crypto";
|
|
82577
|
+
import fs11 from "fs/promises";
|
|
82578
|
+
import path7 from "path";
|
|
82579
|
+
var MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
82580
|
+
async function getFileSize(basePath, relativePath) {
|
|
82581
|
+
const stat = await fs11.stat(path7.join(basePath, relativePath));
|
|
82582
|
+
return stat.size;
|
|
82583
|
+
}
|
|
82584
|
+
function computeGitHash(content) {
|
|
82585
|
+
const buf2 = Buffer.from(content, "utf-8");
|
|
82586
|
+
const header = `blob ${buf2.length}\x00`;
|
|
82587
|
+
return crypto3.createHash("sha1").update(header).update(buf2).digest("hex");
|
|
82588
|
+
}
|
|
82589
|
+
async function readFileContent(basePath, relativePath) {
|
|
82590
|
+
return fs11.readFile(path7.join(basePath, relativePath), "utf-8");
|
|
82591
|
+
}
|
|
82592
|
+
async function writeFileContent(basePath, relativePath, content) {
|
|
82593
|
+
const fullPath = path7.join(basePath, relativePath);
|
|
82594
|
+
await fs11.mkdir(path7.dirname(fullPath), { recursive: true });
|
|
82595
|
+
await fs11.writeFile(fullPath, content, "utf-8");
|
|
82596
|
+
}
|
|
82597
|
+
async function deleteLocalFile(basePath, relativePath) {
|
|
82598
|
+
try {
|
|
82599
|
+
await fs11.unlink(path7.join(basePath, relativePath));
|
|
82600
|
+
} catch (err) {
|
|
82601
|
+
if (err.code !== "ENOENT")
|
|
82602
|
+
throw err;
|
|
82603
|
+
}
|
|
82604
|
+
}
|
|
82605
|
+
|
|
82606
|
+
// src/api/amlStudioApi.ts
|
|
82607
|
+
var BASE_API = "/api/v2/aml_studio";
|
|
82608
|
+
var CLI_METADATA = {
|
|
82609
|
+
origin: "cli",
|
|
82610
|
+
hostname: os6.hostname().replace(/\.local$/, "")
|
|
82611
|
+
};
|
|
82612
|
+
async function fetchProjects() {
|
|
82613
|
+
const data = await get(`${BASE_API}/projects`, {}, "Failed to fetch projects");
|
|
82614
|
+
return data.data;
|
|
82615
|
+
}
|
|
82616
|
+
async function fetchAmlRuntimeEnv(projectId) {
|
|
82617
|
+
const resp = await getJson(`${BASE_API}/projects/aml_runtime_env`, { project_id: projectId }, "Failed to fetch AML runtime environment");
|
|
82618
|
+
return resp.runtime_env;
|
|
82619
|
+
}
|
|
82620
|
+
async function fetchRepoStatus(projectId, gitFetch) {
|
|
82621
|
+
const data = await getJson(`${BASE_API}/projects/${projectId}/repositories/status`, { git_fetch: gitFetch }, "Failed to fetch repository status");
|
|
82622
|
+
return data.data;
|
|
82623
|
+
}
|
|
82624
|
+
async function fetchBackedFilesMeta(projectId) {
|
|
82625
|
+
const data = await get(`${BASE_API}/projects/${projectId}/repositories/all_files`, {}, "Failed to fetch backend files");
|
|
82626
|
+
const inner = data.data;
|
|
82627
|
+
return inner.files ?? inner;
|
|
82628
|
+
}
|
|
82629
|
+
async function pushFiles(projectId, files) {
|
|
82630
|
+
const accepted = [];
|
|
82631
|
+
for (const f2 of files) {
|
|
82632
|
+
const size = Buffer.byteLength(f2.content, "utf-8");
|
|
82633
|
+
if (size > MAX_FILE_SIZE_BYTES) {
|
|
82634
|
+
log(fmt.yellow(` ⚠ Skipping ${f2.file_path}: exceeds ${MAX_FILE_SIZE_BYTES} byte limit (${size} bytes)`));
|
|
82635
|
+
continue;
|
|
82636
|
+
}
|
|
82637
|
+
accepted.push(f2);
|
|
82638
|
+
}
|
|
82639
|
+
if (accepted.length === 0) {
|
|
82640
|
+
return { status: "ok", data: { success: [], failure: [] } };
|
|
82641
|
+
}
|
|
82642
|
+
const data = await postJson(`${BASE_API}/repositories/write_files_with_status`, { project_id: projectId, files: accepted, metadata: CLI_METADATA }, "Failed to push files");
|
|
82643
|
+
return data;
|
|
82644
|
+
}
|
|
82645
|
+
async function pullFiles(projectId, filePaths) {
|
|
82646
|
+
const data = await postJson(`${BASE_API}/projects/${projectId}/repositories/batch_read_file`, { file_paths: filePaths }, "Failed to pull files");
|
|
82647
|
+
return data.data.files;
|
|
82648
|
+
}
|
|
82649
|
+
async function removeFile(projectId, filePath) {
|
|
82650
|
+
await postJson(`${BASE_API}/projects/${projectId}/repositories/remove`, { file_path: filePath, metadata: CLI_METADATA }, "Failed to remove file");
|
|
82651
|
+
}
|
|
82652
|
+
|
|
82571
82653
|
// src/commands/aml/userAttributes.ts
|
|
82572
82654
|
var SUPPORTED_TYPES = [
|
|
82573
82655
|
"date",
|
|
@@ -82633,6 +82715,40 @@ function buildUserAttributes(custom = []) {
|
|
|
82633
82715
|
custom.forEach(({ name, type: type2 }) => byName.set(name, { name, type: type2 }));
|
|
82634
82716
|
return Array.from(byName.values());
|
|
82635
82717
|
}
|
|
82718
|
+
async function fetchUserAttributes() {
|
|
82719
|
+
const projects = await fetchProjects();
|
|
82720
|
+
const project = projects[0];
|
|
82721
|
+
if (!project)
|
|
82722
|
+
throw new Error("No Holistics project found");
|
|
82723
|
+
const runtimeEnv = await fetchAmlRuntimeEnv(project.id);
|
|
82724
|
+
return Object.entries(runtimeEnv.current_user).map(([name, [value, type2]]) => ({ name, type: type2, value }));
|
|
82725
|
+
}
|
|
82726
|
+
async function loadServerUserAttributes(inputUserAttributes) {
|
|
82727
|
+
const existing = readAuthConfig();
|
|
82728
|
+
if (!hasStoredAuth(existing)) {
|
|
82729
|
+
return;
|
|
82730
|
+
}
|
|
82731
|
+
let fetchedUserAttributes = [];
|
|
82732
|
+
try {
|
|
82733
|
+
fetchedUserAttributes = await fetchUserAttributes();
|
|
82734
|
+
} catch (error) {
|
|
82735
|
+
logErr(`Warning: failed to fetch user attributes from server: ${error.message}. Skipping.`);
|
|
82736
|
+
return;
|
|
82737
|
+
}
|
|
82738
|
+
const inputNames = new Set(inputUserAttributes.map((ua3) => ua3.name));
|
|
82739
|
+
const addedUserAttributes = [];
|
|
82740
|
+
fetchedUserAttributes.filter((ua3) => !inputNames.has(ua3.name)).forEach((ua3) => {
|
|
82741
|
+
if (!SUPPORTED_TYPES.includes(ua3.type)) {
|
|
82742
|
+
logErr(`Warning: skipping user attribute "${ua3.name}" from config — unsupported type "${ua3.type}". Supported types: ${SUPPORTED_TYPES.join(", ")}.`);
|
|
82743
|
+
return;
|
|
82744
|
+
}
|
|
82745
|
+
inputUserAttributes.push({ name: ua3.name, type: ua3.type, value: ua3.value });
|
|
82746
|
+
addedUserAttributes.push(ua3);
|
|
82747
|
+
});
|
|
82748
|
+
if (addedUserAttributes.length > 0) {
|
|
82749
|
+
logErr(fmt.dim(`Use ${addedUserAttributes.length} user attribute(s) on server: ${addedUserAttributes.map((ua3) => ua3.name).join(", ")}`));
|
|
82750
|
+
}
|
|
82751
|
+
}
|
|
82636
82752
|
|
|
82637
82753
|
// src/commands/aml/common.ts
|
|
82638
82754
|
var program2;
|
|
@@ -82642,7 +82758,7 @@ function getProgram() {
|
|
|
82642
82758
|
async function expandPaths(paths) {
|
|
82643
82759
|
const expansions = paths.map(async (p2) => {
|
|
82644
82760
|
try {
|
|
82645
|
-
const stat =
|
|
82761
|
+
const stat = fs12.statSync(p2);
|
|
82646
82762
|
if (stat.isFile()) {
|
|
82647
82763
|
return [p2];
|
|
82648
82764
|
}
|
|
@@ -82667,7 +82783,7 @@ function readAmlFiles(rootPath) {
|
|
|
82667
82783
|
const files = import_fast_glob.default.sync(`${rootPath}/**/*.aml`, { onlyFiles: true, dot: true });
|
|
82668
82784
|
return files.map((filePath) => ({
|
|
82669
82785
|
filePath,
|
|
82670
|
-
content:
|
|
82786
|
+
content: fs12.readFileSync(filePath, "utf-8")
|
|
82671
82787
|
}));
|
|
82672
82788
|
}
|
|
82673
82789
|
function initAMLProgram(rootPath, userAttributes) {
|
|
@@ -82676,7 +82792,7 @@ function initAMLProgram(rootPath, userAttributes) {
|
|
|
82676
82792
|
try {
|
|
82677
82793
|
const amlFiles = readAmlFiles(rootPath);
|
|
82678
82794
|
amlFiles.forEach(({ filePath, content }) => {
|
|
82679
|
-
const relativePath =
|
|
82795
|
+
const relativePath = path8.relative(rootPath, filePath);
|
|
82680
82796
|
program2.setFileContent(r.create(relativePath), content);
|
|
82681
82797
|
});
|
|
82682
82798
|
} catch {
|
|
@@ -82692,7 +82808,7 @@ function compileAMLFiles(files, options2) {
|
|
|
82692
82808
|
const filteredFiles = files.filter((file) => file.endsWith(".aml"));
|
|
82693
82809
|
const interpretStart = performance.now();
|
|
82694
82810
|
const interpretedFiles = filteredFiles.map((file, index) => {
|
|
82695
|
-
const result = program2.interpretFile(r.create(
|
|
82811
|
+
const result = program2.interpretFile(r.create(path8.relative(rootPath, file)));
|
|
82696
82812
|
renderProgressBar(index + 1, filteredFiles.length, "Compiling AML", interpretStart);
|
|
82697
82813
|
return result;
|
|
82698
82814
|
});
|
|
@@ -82723,7 +82839,7 @@ function compileAMLFiles(files, options2) {
|
|
|
82723
82839
|
}
|
|
82724
82840
|
|
|
82725
82841
|
// src/commands/aml/validators/pipeline.ts
|
|
82726
|
-
import
|
|
82842
|
+
import path9 from "path";
|
|
82727
82843
|
|
|
82728
82844
|
// ../amql/dist/amql.es.js
|
|
82729
82845
|
var import_lodash2 = __toESM(require_lodash(), 1);
|
|
@@ -84366,7 +84482,7 @@ function _03() {
|
|
|
84366
84482
|
["partial", Vn3],
|
|
84367
84483
|
["partialRight", Qt3],
|
|
84368
84484
|
["rearg", kt4]
|
|
84369
|
-
], mt4 = "[object Arguments]", we4 = "[object Array]", Ff3 = "[object AsyncFunction]", jt4 = "[object Boolean]", ne2 = "[object Date]", Wf3 = "[object DOMException]", me4 = "[object Error]", Ce3 = "[object Function]", Lu3 = "[object GeneratorFunction]", Mn4 = "[object Map]", te3 = "[object Number]", Hf3 = "[object Null]", $n4 = "[object Object]", wu3 = "[object Promise]", Xf3 = "[object Proxy]", ee3 = "[object RegExp]", Nn3 = "[object Set]", re3 = "[object String]", xe2 = "[object Symbol]", Kf3 = "[object Undefined]", ie3 = "[object WeakMap]", Vf3 = "[object WeakSet]", ue4 = "[object ArrayBuffer]", Ct4 = "[object DataView]", wr4 = "[object Float32Array]", mr4 = "[object Float64Array]", Cr3 = "[object Int8Array]", xr4 = "[object Int16Array]", Mr4 = "[object Int32Array]", Nr5 = "[object Uint8Array]", br3 = "[object Uint8ClampedArray]", Br4 = "[object Uint16Array]", Ur4 = "[object Uint32Array]", Yf3 = /\b__p \+= '';/g, $f3 = /\b(__p \+=) '' \+/g, zf3 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, mu3 = /&(?:amp|lt|gt|quot|#39);/g, Cu3 = /[&<>"']/g, qf3 = RegExp(mu3.source), Zf3 = RegExp(Cu3.source), Jf3 = /<%-([\s\S]+?)%>/g, Qf3 = /<%([\s\S]+?)%>/g, xu3 = /<%=([\s\S]+?)%>/g, kf3 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jf3 = /^\w*$/, ns3 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Dr4 = /[\\^$.*+?()[\]{}|]/g, ts3 = RegExp(Dr4.source), Gr4 = /^\s+/, es3 = /\s/, rs3 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, is3 = /\{\n\/\* \[wrapped with (.+)\] \*/, us3 = /,? & /,
|
|
84485
|
+
], mt4 = "[object Arguments]", we4 = "[object Array]", Ff3 = "[object AsyncFunction]", jt4 = "[object Boolean]", ne2 = "[object Date]", Wf3 = "[object DOMException]", me4 = "[object Error]", Ce3 = "[object Function]", Lu3 = "[object GeneratorFunction]", Mn4 = "[object Map]", te3 = "[object Number]", Hf3 = "[object Null]", $n4 = "[object Object]", wu3 = "[object Promise]", Xf3 = "[object Proxy]", ee3 = "[object RegExp]", Nn3 = "[object Set]", re3 = "[object String]", xe2 = "[object Symbol]", Kf3 = "[object Undefined]", ie3 = "[object WeakMap]", Vf3 = "[object WeakSet]", ue4 = "[object ArrayBuffer]", Ct4 = "[object DataView]", wr4 = "[object Float32Array]", mr4 = "[object Float64Array]", Cr3 = "[object Int8Array]", xr4 = "[object Int16Array]", Mr4 = "[object Int32Array]", Nr5 = "[object Uint8Array]", br3 = "[object Uint8ClampedArray]", Br4 = "[object Uint16Array]", Ur4 = "[object Uint32Array]", Yf3 = /\b__p \+= '';/g, $f3 = /\b(__p \+=) '' \+/g, zf3 = /(__e\(.*?\)|\b__t\)) \+\n'';/g, mu3 = /&(?:amp|lt|gt|quot|#39);/g, Cu3 = /[&<>"']/g, qf3 = RegExp(mu3.source), Zf3 = RegExp(Cu3.source), Jf3 = /<%-([\s\S]+?)%>/g, Qf3 = /<%([\s\S]+?)%>/g, xu3 = /<%=([\s\S]+?)%>/g, kf3 = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, jf3 = /^\w*$/, ns3 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Dr4 = /[\\^$.*+?()[\]{}|]/g, ts3 = RegExp(Dr4.source), Gr4 = /^\s+/, es3 = /\s/, rs3 = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, is3 = /\{\n\/\* \[wrapped with (.+)\] \*/, us3 = /,? & /, os7 = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, Mu3 = /[()=,{}\[\]\/\s]/, as3 = /\\(\\)?/g, fs13 = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, Nu3 = /\w*$/, ss3 = /^[-+]0x[0-9a-f]+$/i, cs3 = /^0b[01]+$/i, ls3 = /^\[object .+?Constructor\]$/, _s3 = /^0o[0-7]+$/i, hs3 = /^(?:0|[1-9]\d*)$/, ps3 = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, Me2 = /($^)/, gs3 = /['\n\r\u2028\u2029\\]/g, Ne4 = "\\ud800-\\udfff", ds3 = "\\u0300-\\u036f", Es3 = "\\ufe20-\\ufe2f", vs2 = "\\u20d0-\\u20ff", bu3 = ds3 + Es3 + vs2, Bu3 = "\\u2700-\\u27bf", Uu3 = "a-z\\xdf-\\xf6\\xf8-\\xff", Ts3 = "\\xac\\xb1\\xd7\\xf7", As2 = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", Ss3 = "\\u2000-\\u206f", Os2 = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", Du3 = "A-Z\\xc0-\\xd6\\xd8-\\xde", Gu3 = "\\ufe0e\\ufe0f", Fu3 = Ts3 + As2 + Ss3 + Os2, Fr4 = "['’]", Rs2 = "[" + Ne4 + "]", Wu3 = "[" + Fu3 + "]", be3 = "[" + bu3 + "]", Hu3 = "\\d+", ys3 = "[" + Bu3 + "]", Xu3 = "[" + Uu3 + "]", Ku3 = "[^" + Ne4 + Fu3 + Hu3 + Bu3 + Uu3 + Du3 + "]", Wr4 = "\\ud83c[\\udffb-\\udfff]", Ps3 = "(?:" + be3 + "|" + Wr4 + ")", Vu3 = "[^" + Ne4 + "]", Hr4 = "(?:\\ud83c[\\udde6-\\uddff]){2}", Xr4 = "[\\ud800-\\udbff][\\udc00-\\udfff]", xt4 = "[" + Du3 + "]", Yu3 = "\\u200d", $u3 = "(?:" + Xu3 + "|" + Ku3 + ")", Is2 = "(?:" + xt4 + "|" + Ku3 + ")", zu3 = "(?:" + Fr4 + "(?:d|ll|m|re|s|t|ve))?", qu3 = "(?:" + Fr4 + "(?:D|LL|M|RE|S|T|VE))?", Zu3 = Ps3 + "?", Ju3 = "[" + Gu3 + "]?", Ls2 = "(?:" + Yu3 + "(?:" + [Vu3, Hr4, Xr4].join("|") + ")" + Ju3 + Zu3 + ")*", ws2 = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", ms3 = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", Qu3 = Ju3 + Zu3 + Ls2, Cs3 = "(?:" + [ys3, Hr4, Xr4].join("|") + ")" + Qu3, xs2 = "(?:" + [Vu3 + be3 + "?", be3, Hr4, Xr4, Rs2].join("|") + ")", Ms2 = RegExp(Fr4, "g"), Ns2 = RegExp(be3, "g"), Kr4 = RegExp(Wr4 + "(?=" + Wr4 + ")|" + xs2 + Qu3, "g"), bs3 = RegExp([
|
|
84370
84486
|
xt4 + "?" + Xu3 + "+" + zu3 + "(?=" + [Wu3, xt4, "$"].join("|") + ")",
|
|
84371
84487
|
Is2 + "+" + qu3 + "(?=" + [Wu3, xt4 + $u3, "$"].join("|") + ")",
|
|
84372
84488
|
xt4 + "?" + $u3 + "+" + zu3,
|
|
@@ -84375,7 +84491,7 @@ function _03() {
|
|
|
84375
84491
|
ws2,
|
|
84376
84492
|
Hu3,
|
|
84377
84493
|
Cs3
|
|
84378
|
-
].join("|"), "g"), Bs2 = RegExp("[" + Yu3 +
|
|
84494
|
+
].join("|"), "g"), Bs2 = RegExp("[" + Yu3 + Ne4 + bu3 + Gu3 + "]"), Us2 = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, Ds3 = [
|
|
84379
84495
|
"Array",
|
|
84380
84496
|
"Buffer",
|
|
84381
84497
|
"DataView",
|
|
@@ -84712,7 +84828,7 @@ function _03() {
|
|
|
84712
84828
|
return g2.split("");
|
|
84713
84829
|
}
|
|
84714
84830
|
function Qs3(g2) {
|
|
84715
|
-
return g2.match(
|
|
84831
|
+
return g2.match(os7) || [];
|
|
84716
84832
|
}
|
|
84717
84833
|
function ao3(g2, T2, v2) {
|
|
84718
84834
|
var I3;
|
|
@@ -85249,7 +85365,7 @@ function _03() {
|
|
|
85249
85365
|
return e = !!t(i2, a, s2), e;
|
|
85250
85366
|
}), e;
|
|
85251
85367
|
}
|
|
85252
|
-
function
|
|
85368
|
+
function je2(n, t, e) {
|
|
85253
85369
|
for (var i2 = -1, a = n.length;++i2 < a; ) {
|
|
85254
85370
|
var s2 = n[i2], h = t(s2);
|
|
85255
85371
|
if (h != null && (p2 === r3 ? h === h && !Sn4(h) : e(h, p2)))
|
|
@@ -87594,7 +87710,7 @@ function _03() {
|
|
|
87594
87710
|
if (Mu3.test(m2))
|
|
87595
87711
|
throw new N(L2);
|
|
87596
87712
|
});
|
|
87597
|
-
var p2, d, A = 0, S3 = t.interpolate || Me2, y2 = "__p += '", P2 = ti2((t.escape || Me2).source + "|" + S3.source + "|" + (S3 === xu3 ?
|
|
87713
|
+
var p2, d, A = 0, S3 = t.interpolate || Me2, y2 = "__p += '", P2 = ti2((t.escape || Me2).source + "|" + S3.source + "|" + (S3 === xu3 ? fs13 : Me2).source + "|" + (t.evaluate || Me2).source + "|$", "g"), w2 = "//# sourceURL=" + (X3.call(t, "sourceURL") ? (t.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Gs3 + "]") + `
|
|
87598
87714
|
`;
|
|
87599
87715
|
n.replace(P2, function(m2, G4, W2, On4, _n5, Rn4) {
|
|
87600
87716
|
return W2 || (W2 = On4), y2 += n.slice(A, Rn4).replace(gs3, ic3), G4 && (p2 = true, y2 += `' +
|
|
@@ -87830,10 +87946,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
87830
87946
|
return n / t;
|
|
87831
87947
|
}, 1), cd3 = yi3("floor");
|
|
87832
87948
|
function ld3(n) {
|
|
87833
|
-
return n && n.length ?
|
|
87949
|
+
return n && n.length ? je2(n, dn4, si2) : r3;
|
|
87834
87950
|
}
|
|
87835
87951
|
function _d3(n, t) {
|
|
87836
|
-
return n && n.length ?
|
|
87952
|
+
return n && n.length ? je2(n, x(t, 2), si2) : r3;
|
|
87837
87953
|
}
|
|
87838
87954
|
function hd3(n) {
|
|
87839
87955
|
return so3(n, dn4);
|
|
@@ -87842,10 +87958,10 @@ function print() { __p += __j.call(arguments, '') }
|
|
|
87842
87958
|
return so3(n, x(t, 2));
|
|
87843
87959
|
}
|
|
87844
87960
|
function gd3(n) {
|
|
87845
|
-
return n && n.length ?
|
|
87961
|
+
return n && n.length ? je2(n, dn4, hi3) : r3;
|
|
87846
87962
|
}
|
|
87847
87963
|
function dd3(n, t) {
|
|
87848
|
-
return n && n.length ?
|
|
87964
|
+
return n && n.length ? je2(n, x(t, 2), hi3) : r3;
|
|
87849
87965
|
}
|
|
87850
87966
|
var Ed3 = or3(function(n, t) {
|
|
87851
87967
|
return n * t;
|
|
@@ -125536,7 +125652,7 @@ function Ee3(e10, ...t) {
|
|
|
125536
125652
|
if (t.length > 0 && !t.includes(e10.length))
|
|
125537
125653
|
throw Error("Uint8Array expected of length " + t + ", got length=" + e10.length);
|
|
125538
125654
|
}
|
|
125539
|
-
function
|
|
125655
|
+
function je2(e10, t = true) {
|
|
125540
125656
|
if (e10.destroyed)
|
|
125541
125657
|
throw Error("Hash instance has been destroyed");
|
|
125542
125658
|
if (t && e10.finished)
|
|
@@ -125599,7 +125715,7 @@ var gr4 = class extends Rr5 {
|
|
|
125599
125715
|
super(), this.finished = false, this.length = 0, this.pos = 0, this.destroyed = false, this.blockLen = e10, this.outputLen = t, this.padOffset = n, this.isLE = r3, this.buffer = new Uint8Array(e10), this.view = _e4(this.buffer);
|
|
125600
125716
|
}
|
|
125601
125717
|
update(e10) {
|
|
125602
|
-
|
|
125718
|
+
je2(this), e10 = en3(e10), Ee3(e10);
|
|
125603
125719
|
let { view: t, buffer: n, blockLen: r3 } = this, i3 = e10.length;
|
|
125604
125720
|
for (let a = 0;a < i3; ) {
|
|
125605
125721
|
let s3 = Math.min(r3 - this.pos, i3 - a);
|
|
@@ -125614,7 +125730,7 @@ var gr4 = class extends Rr5 {
|
|
|
125614
125730
|
return this.length += e10.length, this.roundClean(), this;
|
|
125615
125731
|
}
|
|
125616
125732
|
digestInto(e10) {
|
|
125617
|
-
|
|
125733
|
+
je2(this), pr3(e10, this), this.finished = true;
|
|
125618
125734
|
let { buffer: t, view: n, blockLen: r3, isLE: i3 } = this, { pos: a } = this;
|
|
125619
125735
|
t[a++] = 128, qe4(this.buffer.subarray(a)), this.padOffset > r3 - a && (this.process(n, 0), a = 0);
|
|
125620
125736
|
for (let e11 = a;e11 < r3; e11++)
|
|
@@ -127457,7 +127573,7 @@ var Xo3 = {
|
|
|
127457
127573
|
operationOverrides: An3,
|
|
127458
127574
|
transformers: vo4
|
|
127459
127575
|
};
|
|
127460
|
-
function
|
|
127576
|
+
function Ne4(e10) {
|
|
127461
127577
|
return e10.toString().toLowerCase().trim();
|
|
127462
127578
|
}
|
|
127463
127579
|
function mt4(e10) {
|
|
@@ -127492,10 +127608,10 @@ var Ho3 = /* @__PURE__ */ new Map([
|
|
|
127492
127608
|
])],
|
|
127493
127609
|
[o.DATETIME_ADD, (e10, t) => t.opSql(o.DATE_ADD, e10)],
|
|
127494
127610
|
[o.DATETIME_SUB, (e10, t) => t.opSql(o.DATE_SUB, e10)],
|
|
127495
|
-
[o.DATE_DIFF_DEFAULT, ([e10, t, n]) => `DATEDIFF(${
|
|
127611
|
+
[o.DATE_DIFF_DEFAULT, ([e10, t, n]) => `DATEDIFF(${Ne4(e10)}, ${t}, ${n})`],
|
|
127496
127612
|
[o.DATE_DIFF_MILLISECOND, ([, e10, t]) => `DATEDIFF(millisecond, ${e10}, ${t})`],
|
|
127497
127613
|
[o.DATE_DIFF_SECOND, ([, e10, t]) => `DATEDIFF(second, ${e10}, ${t})`],
|
|
127498
|
-
[o.DATE_PART_DEFAULT, ([e10, t]) => `DATE_PART('${
|
|
127614
|
+
[o.DATE_PART_DEFAULT, ([e10, t]) => `DATE_PART('${Ne4(e10)}', ${t})`],
|
|
127499
127615
|
[o.APPROX_COUNT_DISTINCT, ([e10]) => `HLL_CARDINALITY(HLL_CREATE_SKETCH(${e10}))`],
|
|
127500
127616
|
[o.COVAR_POP, ([e10, t]) => `(SUM(${e10} * ${t}) - SUM(${e10}) * SUM(${t}) / NULLIF(COUNT(${t} * ${e10}), 0)) / NULLIF(COUNT(${t} * ${e10}), 0)`],
|
|
127501
127617
|
[o.CORR, ([e10, t], n) => `${n.opSql(o.COVAR_POP, [t, e10])} / NULLIF(${n.opSql(o.STDEVP, [e10])} * ${n.opSql(o.STDEVP, [t])}, 0)`],
|
|
@@ -127519,7 +127635,7 @@ var Ho3 = /* @__PURE__ */ new Map([
|
|
|
127519
127635
|
let i3 = pt4(t.toString()), a = r3.opSql(o.NORMALIZE_TEXT_VALUE, [i3]);
|
|
127520
127636
|
return `TO_CHAR(${r3.opSql(o.TO_WALLCLOCK, [e10, n])}, ${a})`;
|
|
127521
127637
|
}],
|
|
127522
|
-
[o.LAST_DAY, ([e10, t, n], r3) =>
|
|
127638
|
+
[o.LAST_DAY, ([e10, t, n], r3) => Ne4(t) === "month" ? `LAST_DAY(${r3.opSql(o.CAST_DB_TYPE, [e10, "date"])})` : r3.opBaseSql(o.LAST_DAY, [
|
|
127523
127639
|
e10,
|
|
127524
127640
|
t,
|
|
127525
127641
|
n
|
|
@@ -128033,7 +128149,7 @@ var rs3 = {
|
|
|
128033
128149
|
function It5(e10) {
|
|
128034
128150
|
return e10.replace(/(%[YyqmBbAadHIMSpLf%])?([^%]*)/g, '$1"$2"').replace(/""/g, "").replace(/%Y/g, "yyyy").replace(/%y/g, "yy").replace(/%q/g, '"q"').replace(/%m/g, "MM").replace(/%B/g, "MMMM").replace(/%b/g, "MMM").replace(/%A/g, "dddd").replace(/%a/g, "ddd").replace(/%d/g, "dd").replace(/%H/g, "HH").replace(/%I/g, "hh").replace(/%M/g, "mm").replace(/%S/g, "ss").replace(/%p/g, "tt").replace(/%L/g, "fff").replace(/%f/g, "ffffff");
|
|
128035
128151
|
}
|
|
128036
|
-
var
|
|
128152
|
+
var os7 = /* @__PURE__ */ new Map([
|
|
128037
128153
|
[o.TO_WINDOWS_TIMEZONE, ([e10]) => rs3[e10?.toString() ?? ""] ?? e10?.toString() ?? ""],
|
|
128038
128154
|
[o.ADD_TIME_ZONE, ([e10, t], n) => {
|
|
128039
128155
|
let r3 = n.opSql(o.TO_WINDOWS_TIMEZONE, [t]);
|
|
@@ -128396,7 +128512,7 @@ var ds3 = (e10, t) => {
|
|
|
128396
128512
|
${D3([...new Set(r3)].join(`,
|
|
128397
128513
|
`))}`;
|
|
128398
128514
|
};
|
|
128399
|
-
var
|
|
128515
|
+
var fs13 = {
|
|
128400
128516
|
dataSource: "sqlserver",
|
|
128401
128517
|
col: (e10) => `[${e10}]`,
|
|
128402
128518
|
hTypeToDbType: ss3,
|
|
@@ -128410,7 +128526,7 @@ var fs12 = {
|
|
|
128410
128526
|
orderByClause: Ts3,
|
|
128411
128527
|
limitClause: () => "",
|
|
128412
128528
|
datetimeFormat: "yyyy-MM-dd HH:mm:ss.ffffff",
|
|
128413
|
-
operationOverrides:
|
|
128529
|
+
operationOverrides: os7,
|
|
128414
128530
|
transformers: is3
|
|
128415
128531
|
};
|
|
128416
128532
|
function J3(e10) {
|
|
@@ -128594,7 +128710,7 @@ var Is2 = /* @__PURE__ */ new Map([
|
|
|
128594
128710
|
["oracledb", ns3],
|
|
128595
128711
|
["prestodb", Xo3],
|
|
128596
128712
|
["redshift", zo3],
|
|
128597
|
-
["sqlserver",
|
|
128713
|
+
["sqlserver", fs13],
|
|
128598
128714
|
["snowflake", $s3]
|
|
128599
128715
|
]);
|
|
128600
128716
|
function We4(e10) {
|
|
@@ -130552,7 +130668,7 @@ function parseValidatorsOption(value) {
|
|
|
130552
130668
|
function interpretFiles(program3, files, rootPath) {
|
|
130553
130669
|
const service = new E_;
|
|
130554
130670
|
service.program = program3;
|
|
130555
|
-
return files.filter((file) => file.endsWith(".aml")).map((file) =>
|
|
130671
|
+
return files.filter((file) => file.endsWith(".aml")).map((file) => path9.relative(rootPath, file)).flatMap((file) => {
|
|
130556
130672
|
const result = program3.interpretFileJson(r.create(file));
|
|
130557
130673
|
if (!result.isOk())
|
|
130558
130674
|
return [];
|
|
@@ -130589,7 +130705,7 @@ function runValidators(program3, files, rootPath, option, config) {
|
|
|
130589
130705
|
}
|
|
130590
130706
|
|
|
130591
130707
|
// src/commands/aml/validators/format.ts
|
|
130592
|
-
import * as
|
|
130708
|
+
import * as path10 from "node:path";
|
|
130593
130709
|
import { pathToFileURL } from "node:url";
|
|
130594
130710
|
var AQL_ERR_REF_LINK = "https://docs.holistics.io/reference/aql/error-reference";
|
|
130595
130711
|
var BADGE_TEXT_WIDTH = "WARNING-1234".length;
|
|
@@ -130766,11 +130882,11 @@ function renderChildList(node, childPrefix, hasMore = false) {
|
|
|
130766
130882
|
return blocks2.flatMap((block, i3) => i3 === 0 ? block : [spacer, ...block]);
|
|
130767
130883
|
}
|
|
130768
130884
|
function fileHyperlink(filePath) {
|
|
130769
|
-
const abs =
|
|
130885
|
+
const abs = path10.resolve(filePath);
|
|
130770
130886
|
return hyperlink(pathToFileURL(abs).href, paint(COLORS.filepath, filePath));
|
|
130771
130887
|
}
|
|
130772
130888
|
function fileBreakdownLink(filePath) {
|
|
130773
|
-
const abs =
|
|
130889
|
+
const abs = path10.resolve(filePath);
|
|
130774
130890
|
return hyperlink(pathToFileURL(abs).href, filePath);
|
|
130775
130891
|
}
|
|
130776
130892
|
function truncateMessage(msg, width) {
|
|
@@ -130936,6 +131052,7 @@ function formatSummarizeReport(reports) {
|
|
|
130936
131052
|
|
|
130937
131053
|
// src/commands/aml/compile.ts
|
|
130938
131054
|
async function compile2(paths, rootPath, outDir, userAttributes = [], validation = {}) {
|
|
131055
|
+
await loadServerUserAttributes(userAttributes);
|
|
130939
131056
|
const filePaths = await expandPaths(paths);
|
|
130940
131057
|
const interpretedFiles = compileAMLFiles(filePaths, {
|
|
130941
131058
|
userAttributes,
|
|
@@ -130943,16 +131060,16 @@ async function compile2(paths, rootPath, outDir, userAttributes = [], validation
|
|
|
130943
131060
|
});
|
|
130944
131061
|
if (outDir) {
|
|
130945
131062
|
const cwd = rootPath ?? process.cwd();
|
|
130946
|
-
const dir =
|
|
130947
|
-
if (!
|
|
130948
|
-
|
|
131063
|
+
const dir = path11.resolve(outDir);
|
|
131064
|
+
if (!fs14.existsSync(dir)) {
|
|
131065
|
+
fs14.mkdirSync(dir, { recursive: true });
|
|
130949
131066
|
}
|
|
130950
131067
|
Object.entries(interpretedFiles).forEach(([filePath, content]) => {
|
|
130951
|
-
const relativePath =
|
|
130952
|
-
const outPath =
|
|
131068
|
+
const relativePath = path11.relative(cwd, `${filePath}.json`);
|
|
131069
|
+
const outPath = path11.join(outDir, relativePath);
|
|
130953
131070
|
consolePrint.log(`Writing to ${relativePath}`);
|
|
130954
|
-
|
|
130955
|
-
|
|
131071
|
+
fs14.mkdirSync(path11.dirname(outPath), { recursive: true });
|
|
131072
|
+
fs14.writeFileSync(outPath, JSON.stringify(content, null, 2));
|
|
130956
131073
|
});
|
|
130957
131074
|
} else {
|
|
130958
131075
|
consolePrint.log(JSON.stringify(interpretedFiles, null, 2));
|
|
@@ -130975,6 +131092,7 @@ var compile_default = command4;
|
|
|
130975
131092
|
|
|
130976
131093
|
// src/commands/aml/validate.ts
|
|
130977
131094
|
async function validate2(paths, rootPath, userAttributes = [], validation = {}) {
|
|
131095
|
+
await loadServerUserAttributes(userAttributes);
|
|
130978
131096
|
const filePaths = await expandPaths(paths);
|
|
130979
131097
|
compileAMLFiles(filePaths, { rootPath, userAttributes });
|
|
130980
131098
|
const reports = runValidators(getProgram(), filePaths, rootPath ?? process.cwd(), { userAttributes }, validation);
|
|
@@ -131005,29 +131123,29 @@ var command6 = new Command("aml").description("AML-related commands").addCommand
|
|
|
131005
131123
|
var aml_default = command6;
|
|
131006
131124
|
|
|
131007
131125
|
// src/commands/mcp.ts
|
|
131008
|
-
import
|
|
131009
|
-
import
|
|
131126
|
+
import fs16 from "fs";
|
|
131127
|
+
import path14 from "path";
|
|
131010
131128
|
|
|
131011
131129
|
// src/commands/code_sync/lock_state.ts
|
|
131012
|
-
import
|
|
131013
|
-
import
|
|
131130
|
+
import crypto4 from "crypto";
|
|
131131
|
+
import fs15 from "fs";
|
|
131014
131132
|
import fsp from "fs/promises";
|
|
131015
|
-
import
|
|
131016
|
-
import
|
|
131017
|
-
var STATE_DIR_ROOT =
|
|
131133
|
+
import os8 from "os";
|
|
131134
|
+
import path12 from "path";
|
|
131135
|
+
var STATE_DIR_ROOT = path12.join(os8.homedir(), ".holistics", "sync");
|
|
131018
131136
|
function getStateDir(repoPath) {
|
|
131019
|
-
const resolved =
|
|
131020
|
-
const hash =
|
|
131021
|
-
return
|
|
131137
|
+
const resolved = path12.resolve(repoPath);
|
|
131138
|
+
const hash = crypto4.createHash("sha256").update(resolved).digest("hex").slice(0, 16);
|
|
131139
|
+
return path12.join(STATE_DIR_ROOT, hash);
|
|
131022
131140
|
}
|
|
131023
131141
|
function getPidPath(repoPath) {
|
|
131024
|
-
return
|
|
131142
|
+
return path12.join(getStateDir(repoPath), "sync.pid");
|
|
131025
131143
|
}
|
|
131026
131144
|
function getStatePath(repoPath) {
|
|
131027
|
-
return
|
|
131145
|
+
return path12.join(getStateDir(repoPath), "state.json");
|
|
131028
131146
|
}
|
|
131029
131147
|
function getLogPath(repoPath) {
|
|
131030
|
-
return
|
|
131148
|
+
return path12.join(getStateDir(repoPath), "sync.log");
|
|
131031
131149
|
}
|
|
131032
131150
|
async function ensureStateDir(repoPath) {
|
|
131033
131151
|
const dir = getStateDir(repoPath);
|
|
@@ -131047,7 +131165,7 @@ function isPidAlive(pid) {
|
|
|
131047
131165
|
function readPid(repoPath) {
|
|
131048
131166
|
const file = getPidPath(repoPath);
|
|
131049
131167
|
try {
|
|
131050
|
-
const raw =
|
|
131168
|
+
const raw = fs15.readFileSync(file, "utf-8").trim();
|
|
131051
131169
|
const pid = parseInt(raw);
|
|
131052
131170
|
return Number.isFinite(pid) && pid > 0 ? pid : null;
|
|
131053
131171
|
} catch (err) {
|
|
@@ -131171,7 +131289,7 @@ async function checkHealth(repoPath, thresholdMs = DEFAULT_STALENESS_THRESHOLD_M
|
|
|
131171
131289
|
}
|
|
131172
131290
|
|
|
131173
131291
|
// src/commands/code_sync/status.ts
|
|
131174
|
-
import
|
|
131292
|
+
import path13 from "path";
|
|
131175
131293
|
var DEFAULT_STATUS_WAIT_TIMEOUT_MS = parseInt(process.env.CODE_SYNC_STATUS_WAIT_TIMEOUT_MS || "30000");
|
|
131176
131294
|
var DEFAULT_STATUS_WAIT_POLL_MS = 200;
|
|
131177
131295
|
function formatAge(iso) {
|
|
@@ -131242,7 +131360,7 @@ async function waitForFreshCycle(resolvedPath, out = log, options2 = {}) {
|
|
|
131242
131360
|
return 1;
|
|
131243
131361
|
}
|
|
131244
131362
|
async function runSyncStatus(repoPath, options2 = {}) {
|
|
131245
|
-
const resolvedPath =
|
|
131363
|
+
const resolvedPath = path13.resolve(repoPath);
|
|
131246
131364
|
if (options2.wait) {
|
|
131247
131365
|
return waitForFreshCycle(resolvedPath);
|
|
131248
131366
|
}
|
|
@@ -131339,7 +131457,7 @@ async function printToolSchema(toolName, env) {
|
|
|
131339
131457
|
}
|
|
131340
131458
|
async function ensureSyncFresh() {
|
|
131341
131459
|
const cwd = process.cwd();
|
|
131342
|
-
if (!
|
|
131460
|
+
if (!fs16.existsSync(path14.join(cwd, ".git"))) {
|
|
131343
131461
|
consolePrint.warn(`⚠ Not inside a git repo (${cwd}); cannot verify whether cloud reflects local code.`);
|
|
131344
131462
|
consolePrint.warn(" cd into your Holistics project before running mcp to enable sync checks.");
|
|
131345
131463
|
return;
|
|
@@ -131419,83 +131537,6 @@ var mcp_default = command7;
|
|
|
131419
131537
|
// src/commands/code_sync/sync.ts
|
|
131420
131538
|
import path21 from "path";
|
|
131421
131539
|
|
|
131422
|
-
// src/commands/code_sync/api.ts
|
|
131423
|
-
import os8 from "os";
|
|
131424
|
-
|
|
131425
|
-
// src/commands/code_sync/file_ops.ts
|
|
131426
|
-
import crypto4 from "crypto";
|
|
131427
|
-
import fs16 from "fs/promises";
|
|
131428
|
-
import path14 from "path";
|
|
131429
|
-
var MAX_FILE_SIZE_BYTES = 5 * 1024 * 1024;
|
|
131430
|
-
async function getFileSize(basePath, relativePath) {
|
|
131431
|
-
const stat = await fs16.stat(path14.join(basePath, relativePath));
|
|
131432
|
-
return stat.size;
|
|
131433
|
-
}
|
|
131434
|
-
function computeGitHash(content) {
|
|
131435
|
-
const buf2 = Buffer.from(content, "utf-8");
|
|
131436
|
-
const header = `blob ${buf2.length}\x00`;
|
|
131437
|
-
return crypto4.createHash("sha1").update(header).update(buf2).digest("hex");
|
|
131438
|
-
}
|
|
131439
|
-
async function readFileContent(basePath, relativePath) {
|
|
131440
|
-
return fs16.readFile(path14.join(basePath, relativePath), "utf-8");
|
|
131441
|
-
}
|
|
131442
|
-
async function writeFileContent(basePath, relativePath, content) {
|
|
131443
|
-
const fullPath = path14.join(basePath, relativePath);
|
|
131444
|
-
await fs16.mkdir(path14.dirname(fullPath), { recursive: true });
|
|
131445
|
-
await fs16.writeFile(fullPath, content, "utf-8");
|
|
131446
|
-
}
|
|
131447
|
-
async function deleteLocalFile(basePath, relativePath) {
|
|
131448
|
-
try {
|
|
131449
|
-
await fs16.unlink(path14.join(basePath, relativePath));
|
|
131450
|
-
} catch (err) {
|
|
131451
|
-
if (err.code !== "ENOENT")
|
|
131452
|
-
throw err;
|
|
131453
|
-
}
|
|
131454
|
-
}
|
|
131455
|
-
|
|
131456
|
-
// src/commands/code_sync/api.ts
|
|
131457
|
-
var BASE_API = "/api/v2/aml_studio";
|
|
131458
|
-
var CLI_METADATA = {
|
|
131459
|
-
origin: "cli",
|
|
131460
|
-
hostname: os8.hostname().replace(/\.local$/, "")
|
|
131461
|
-
};
|
|
131462
|
-
async function fetchProjects() {
|
|
131463
|
-
const data = await get(`${BASE_API}/projects`, {}, "Failed to fetch projects");
|
|
131464
|
-
return data.data;
|
|
131465
|
-
}
|
|
131466
|
-
async function fetchRepoStatus(projectId, gitFetch) {
|
|
131467
|
-
const data = await getJson(`${BASE_API}/projects/${projectId}/repositories/status`, { git_fetch: gitFetch }, "Failed to fetch repository status");
|
|
131468
|
-
return data.data;
|
|
131469
|
-
}
|
|
131470
|
-
async function fetchBackedFilesMeta(projectId) {
|
|
131471
|
-
const data = await get(`${BASE_API}/projects/${projectId}/repositories/all_files`, {}, "Failed to fetch backend files");
|
|
131472
|
-
const inner = data.data;
|
|
131473
|
-
return inner.files ?? inner;
|
|
131474
|
-
}
|
|
131475
|
-
async function pushFiles(projectId, files) {
|
|
131476
|
-
const accepted = [];
|
|
131477
|
-
for (const f3 of files) {
|
|
131478
|
-
const size = Buffer.byteLength(f3.content, "utf-8");
|
|
131479
|
-
if (size > MAX_FILE_SIZE_BYTES) {
|
|
131480
|
-
log(fmt.yellow(` ⚠ Skipping ${f3.file_path}: exceeds ${MAX_FILE_SIZE_BYTES} byte limit (${size} bytes)`));
|
|
131481
|
-
continue;
|
|
131482
|
-
}
|
|
131483
|
-
accepted.push(f3);
|
|
131484
|
-
}
|
|
131485
|
-
if (accepted.length === 0) {
|
|
131486
|
-
return { status: "ok", data: { success: [], failure: [] } };
|
|
131487
|
-
}
|
|
131488
|
-
const data = await postJson(`${BASE_API}/repositories/write_files_with_status`, { project_id: projectId, files: accepted, metadata: CLI_METADATA }, "Failed to push files");
|
|
131489
|
-
return data;
|
|
131490
|
-
}
|
|
131491
|
-
async function pullFiles(projectId, filePaths) {
|
|
131492
|
-
const data = await postJson(`${BASE_API}/projects/${projectId}/repositories/batch_read_file`, { file_paths: filePaths }, "Failed to pull files");
|
|
131493
|
-
return data.data.files;
|
|
131494
|
-
}
|
|
131495
|
-
async function removeFile(projectId, filePath) {
|
|
131496
|
-
await postJson(`${BASE_API}/projects/${projectId}/repositories/remove`, { file_path: filePath, metadata: CLI_METADATA }, "Failed to remove file");
|
|
131497
|
-
}
|
|
131498
|
-
|
|
131499
131540
|
// src/commands/code_sync/hash_ledger.ts
|
|
131500
131541
|
class HashLedger {
|
|
131501
131542
|
map = new Map;
|
|
@@ -136864,6 +136905,14 @@ var command8 = new Command("sync-code").description("Sync local AML code with Ho
|
|
|
136864
136905
|
var sync_default = command8;
|
|
136865
136906
|
|
|
136866
136907
|
// src/commands.ts
|
|
136908
|
+
process.on("uncaughtException", async (err) => {
|
|
136909
|
+
await logErr(err);
|
|
136910
|
+
process.exit(1);
|
|
136911
|
+
});
|
|
136912
|
+
process.on("unhandledRejection", async (reason) => {
|
|
136913
|
+
await logErr(reason instanceof Error ? reason : new Error(String(reason)));
|
|
136914
|
+
process.exit(1);
|
|
136915
|
+
});
|
|
136867
136916
|
function addDocumentationHelp(command9) {
|
|
136868
136917
|
command9.addHelpText("after", `
|
|
136869
136918
|
See documentation at: https://docs.holistics.io/docs/cli`);
|