@thinkingai/ae-cli 6.1.28 → 6.1.30
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 +24 -4
- package/README.zh.md +24 -4
- package/bin/ae-cli.js +5 -0
- package/bin/runtime-capabilities.json +5 -0
- package/cli-installation-guide.md +24 -3
- package/dist/{auth-NKD5Z5BQ.js → auth-ADZHUIJR.js} +30 -12
- package/dist/{automation-K32V2NKP.js → automation-FD2QZUP6.js} +6 -6
- package/dist/{capability-4CGSL7PK.js → capability-QXFRJYZD.js} +54 -26
- package/dist/{chunk-P6VFCH3P.js → chunk-2F64AZYH.js} +2 -2
- package/dist/{chunk-LMCYSVVA.js → chunk-4PSTYEG5.js} +50 -41
- package/dist/{chunk-KHS64JZQ.js → chunk-72NJKS7O.js} +4 -4
- package/dist/chunk-AVXDJAFC.js +132 -0
- package/dist/{chunk-GI5BMEZO.js → chunk-AWVZTN2B.js} +1 -1
- package/dist/chunk-CG773QXN.js +2289 -0
- package/dist/{chunk-UUD5RB36.js → chunk-E25OSZLJ.js} +3 -3
- package/dist/{chunk-UF244C5C.js → chunk-EUFP4M2A.js} +7 -7
- package/dist/{chunk-QW3R6O7L.js → chunk-HRUOV6EQ.js} +57 -15
- package/dist/{chunk-T44M3PLZ.js → chunk-JEUXDY3B.js} +1 -1
- package/dist/{chunk-2UWS5CUP.js → chunk-JSBLCLFE.js} +3 -3
- package/dist/{chunk-QSAR3GHY.js → chunk-OAWPT7VP.js} +2 -2
- package/dist/{chunk-2IYIYSUO.js → chunk-QVRIDN42.js} +2 -2
- package/dist/{chunk-P7KL7IOH.js → chunk-SOSFRU3O.js} +2 -2
- package/dist/{chunk-GTPWDLTE.js → chunk-TFORY6WY.js} +35 -14
- package/dist/{chunk-JJJIP2XQ.js → chunk-VDICGXCY.js} +2 -2
- package/dist/{chunk-UJ7UPRXK.js → chunk-Y3AM6LIO.js} +10 -8
- package/dist/chunk-YULUBP3R.js +222 -0
- package/dist/{chunk-X7DRLE62.js → chunk-YVG6QD3V.js} +1 -1
- package/dist/{chunk-ZW4VMY5H.js → chunk-Z3Q2AEIN.js} +152 -98
- package/dist/{community-report-client-S2K3A3Q6.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-HERBTQZN.js +32 -0
- package/dist/{config-ASSAAIOI.js → config-E3KANXMK.js} +38 -6
- package/dist/{context-6RWLVOM5.js → context-CDB5H5PD.js} +4 -4
- package/dist/{data-integration-EXSUPUDZ.js → data-integration-QE37EQ3A.js} +207 -24
- package/dist/{evaluation-5YT4QLCL.js → evaluation-LR4YDYWL.js} +4 -4
- package/dist/index.js +297 -70
- package/dist/{local-data-upload-client-7HCPGIS3.js → local-data-upload-client-KCMG6J62.js} +1 -1
- package/dist/{memory-VCYLVPMI.js → memory-SNFR5M23.js} +6 -6
- package/dist/{metadata-YGI5M6OF.js → metadata-EXQYDZTH.js} +16 -8
- package/dist/{model-DPJHSD73.js → model-KEVCEXWD.js} +4 -4
- package/dist/{personal-semantic-preference-76TBKAPY.js → personal-semantic-preference-ETY3KU2O.js} +7 -6
- package/dist/{project-semantic-XOEBO2Q5.js → project-semantic-UHRMVOJF.js} +11 -10
- package/dist/{sync-7PP6KQ75.js → sync-XKEBXESC.js} +8 -7
- package/dist/{te-agent-PJVAPKBD.js → te-agent-S6UQR4IE.js} +11 -7
- package/dist/{te-analysis-OX62G5VD.js → te-analysis-WOFFCIBC.js} +185 -33
- package/dist/{te-community-QN3WMPNT.js → te-community-R7B6QYOO.js} +720 -228
- package/dist/{te-dataops-UKD2XN3E.js → te-dataops-KPILYVHA.js} +6 -5
- package/dist/{te-engage-X3DIXPRA.js → te-engage-IAUM6ONX.js} +13 -12
- package/dist/{te-experiment-MEIIK3DP.js → te-experiment-TMLRA7B3.js} +55 -21
- package/dist/{te-kb-73EWDFDF.js → te-kb-GKWPSLSY.js} +409 -85
- package/dist/{te-system-IE7NCKC3.js → te-system-CYWSK3UN.js} +6 -6
- package/dist/{te-team-MGQ5CNRW.js → te-team-ISN52YNG.js} +7 -6
- package/dist/{things-4JIBCA55.js → things-DDQ52Z3Q.js} +7 -7
- package/dist/{update-AX66IFMJ.js → update-CTLNTX35.js} +11 -7
- package/dist/{workspace-Q5NMEKEN.js → workspace-2CKQX2XL.js} +6 -6
- package/package.json +17 -7
- package/skills/ae-agent/references/resource-package.md +4 -0
- package/skills/ae-analysis/SKILL.md +14 -10
- package/skills/ae-analysis/references/agent_review_preflight.md +52 -11
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +57 -25
- package/skills/ae-analysis/references/command_index.md +7 -3
- package/skills/ae-analysis/references/governance_recommendation_export.md +31 -17
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
- package/skills/ae-analysis/references/scenario_append.md +6 -0
- package/skills/ae-analysis/references/scenario_begin.md +11 -0
- package/skills/ae-analysis/references/scenario_collect.md +10 -2
- package/skills/ae-analysis/references/scenario_evaluation.md +6 -18
- package/skills/ae-analysis/references/scenario_get.md +15 -0
- package/skills/ae-analysis/references/scenario_list.md +64 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
- package/skills/ae-community/SKILL.md +77 -27
- package/skills/ae-community/references/community-analyzing-theme-comment.md +10 -8
- package/skills/ae-community/references/community-data-quality.md +68 -0
- package/skills/ae-community/references/community-query-evidence.md +85 -0
- package/skills/ae-community/references/community-scenario-capabilities.md +137 -0
- package/skills/ae-community/references/community-weekly-report.md +6 -3
- package/skills/ae-community/references/get_channel_info.md +7 -4
- package/skills/ae-community/references/get_comment_tag_analysis.md +3 -3
- package/skills/ae-community/references/get_comments_summary.md +4 -4
- package/skills/ae-community/references/get_corpus_tags.md +3 -3
- package/skills/ae-community/references/get_daily_summary.md +3 -3
- package/skills/ae-community/references/get_hot_topics.md +3 -3
- package/skills/ae-community/references/get_livestream_analysis.md +3 -3
- package/skills/ae-community/references/get_livestream_detail.md +4 -4
- package/skills/ae-community/references/get_livestream_list.md +3 -3
- package/skills/ae-community/references/get_livestream_overview.md +3 -3
- package/skills/ae-community/references/get_livestream_room_metrics.md +3 -3
- package/skills/ae-community/references/get_livestream_rooms.md +3 -3
- package/skills/ae-community/references/get_overview_metrics.md +3 -3
- package/skills/ae-community/references/get_post_detail.md +4 -4
- package/skills/ae-community/references/get_risk_content.md +5 -5
- package/skills/ae-community/references/get_sentiment_overview.md +4 -4
- package/skills/ae-community/references/get_tag_trends.md +3 -3
- package/skills/ae-community/references/get_topic_detail.md +3 -3
- package/skills/ae-community/references/list_sources.md +28 -0
- package/skills/ae-community/references/list_spaces.md +39 -0
- package/skills/ae-community/references/search_posts.md +21 -7
- package/skills/ae-data-integration/SKILL.md +6 -4
- package/skills/ae-data-integration/references/error-handling.md +1 -0
- package/skills/ae-data-integration/references/handoff.md +1 -1
- package/skills/ae-data-integration/references/sink-upload.md +11 -0
- package/skills/ae-data-integration/references/source-inspect.md +2 -1
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +1 -1
- package/skills/ae-experiment/SKILL.md +7 -1
- package/skills/ae-experiment/references/manage_experiment.md +18 -1
- package/skills/ae-experiment/references/query_experiment_detail.md +7 -0
- package/skills/ae-experiment/references/save_experiment.md +76 -2
- package/skills/ae-experiment/references/save_submit_experiment.md +7 -0
- package/skills/ae-kb/SKILL.md +37 -8
- package/skills/ae-kb/references/publication.md +81 -0
- package/skills/ae-kb/references/query-workflow.md +20 -6
- package/skills/ae-kb-discovery/SKILL.md +15 -6
- package/skills/ae-metadata/SKILL.md +2 -2
- package/skills/ae-metadata/references/metadata_data_table_get.md +35 -0
- package/dist/chunk-ELCR235M.js +0 -1429
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
utils,
|
|
9
9
|
validateAndFix,
|
|
10
10
|
validateDraft
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-72NJKS7O.js";
|
|
12
|
+
import "./chunk-QVRIDN42.js";
|
|
13
13
|
import {
|
|
14
14
|
require_archiver
|
|
15
|
-
} from "./chunk-
|
|
16
|
-
import "./chunk-
|
|
15
|
+
} from "./chunk-OAWPT7VP.js";
|
|
16
|
+
import "./chunk-JEUXDY3B.js";
|
|
17
17
|
import {
|
|
18
18
|
getConfigDir
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-4PSTYEG5.js";
|
|
20
20
|
import {
|
|
21
21
|
CliValidationError,
|
|
22
22
|
LocalDataUploadError,
|
|
23
23
|
__toESM
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
25
25
|
|
|
26
26
|
// src/commands/data-integration/inspect.ts
|
|
27
27
|
import { basename as basename3 } from "path";
|
|
@@ -35,7 +35,8 @@ var THROUGHPUT_BYTES_PER_SECOND = {
|
|
|
35
35
|
json: 8 * 1024 * 1024,
|
|
36
36
|
csv: 4 * 1024 * 1024,
|
|
37
37
|
tsv: 4 * 1024 * 1024,
|
|
38
|
-
xlsx: 2 * 1024 * 1024
|
|
38
|
+
xlsx: 2 * 1024 * 1024,
|
|
39
|
+
parquet: 8 * 1024 * 1024
|
|
39
40
|
};
|
|
40
41
|
var SLOW_ENCODINGS = /* @__PURE__ */ new Set(["gbk", "gb2312", "gb18030", "big5", "shift_jis", "euc-jp", "euc-kr"]);
|
|
41
42
|
function estimateProcessingSeconds(format, sizeBytes, encoding) {
|
|
@@ -72,6 +73,9 @@ function largeFileMemoryWarning(format) {
|
|
|
72
73
|
if (format === "json") {
|
|
73
74
|
return "Memory risk: a JSON root object or a very large record may be materialized in memory during inspection, so peak memory can substantially exceed the file size.";
|
|
74
75
|
}
|
|
76
|
+
if (format === "parquet") {
|
|
77
|
+
return "Memory risk: Parquet input is decoded whole-file into memory (the reader materializes the full table), so peak memory can be a multiple of the file size. Split large files by row group or partition.";
|
|
78
|
+
}
|
|
75
79
|
return null;
|
|
76
80
|
}
|
|
77
81
|
function assessFileSize(fileName, format, sizeBytes, encoding) {
|
|
@@ -641,6 +645,150 @@ function isStrongDateTime(value) {
|
|
|
641
645
|
return /^\d{4}[-/]\d{1,2}[-/]\d{1,2}(?:[ T]\d{1,2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?(?:Z|[+-]\d{2}:?\d{2})?)?$/.test(value.trim());
|
|
642
646
|
}
|
|
643
647
|
|
|
648
|
+
// src/commands/data-integration/parquet.ts
|
|
649
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
650
|
+
var TypeId = {
|
|
651
|
+
Int: 2,
|
|
652
|
+
Float: 3,
|
|
653
|
+
Binary: 4,
|
|
654
|
+
Utf8: 5,
|
|
655
|
+
Bool: 6,
|
|
656
|
+
Decimal: 7,
|
|
657
|
+
Date: 8,
|
|
658
|
+
Timestamp: 10,
|
|
659
|
+
List: 12,
|
|
660
|
+
Struct: 13,
|
|
661
|
+
FixedSizeBinary: 15,
|
|
662
|
+
FixedSizeList: 16,
|
|
663
|
+
Map: 17,
|
|
664
|
+
LargeBinary: 19,
|
|
665
|
+
LargeUtf8: 20,
|
|
666
|
+
LargeList: 21
|
|
667
|
+
};
|
|
668
|
+
function toJsValue(value, type) {
|
|
669
|
+
if (value === null || value === void 0) return null;
|
|
670
|
+
switch (type.typeId) {
|
|
671
|
+
case TypeId.Int:
|
|
672
|
+
return typeof value === "bigint" ? String(value) : value;
|
|
673
|
+
case TypeId.Float:
|
|
674
|
+
case TypeId.Bool:
|
|
675
|
+
case TypeId.Utf8:
|
|
676
|
+
case TypeId.LargeUtf8:
|
|
677
|
+
return value;
|
|
678
|
+
case TypeId.Binary:
|
|
679
|
+
case TypeId.LargeBinary:
|
|
680
|
+
case TypeId.FixedSizeBinary:
|
|
681
|
+
return Buffer.from(value).toString("hex");
|
|
682
|
+
case TypeId.Timestamp:
|
|
683
|
+
return toTimestampValue(value, type);
|
|
684
|
+
case TypeId.Date:
|
|
685
|
+
return toWallClockString(new Date(value));
|
|
686
|
+
case TypeId.Decimal:
|
|
687
|
+
return toDecimalValue(String(value), type.scale);
|
|
688
|
+
case TypeId.List:
|
|
689
|
+
case TypeId.LargeList:
|
|
690
|
+
case TypeId.FixedSizeList: {
|
|
691
|
+
const childType = type.children[0].type;
|
|
692
|
+
return Array.from(value, (item) => toJsValue(item, childType));
|
|
693
|
+
}
|
|
694
|
+
case TypeId.Struct: {
|
|
695
|
+
const row = value;
|
|
696
|
+
const out = {};
|
|
697
|
+
for (const child of type.children) out[child.name] = toJsValue(row[child.name], child.type);
|
|
698
|
+
return out;
|
|
699
|
+
}
|
|
700
|
+
case TypeId.Map: {
|
|
701
|
+
const valueType = type.children[0].type.children[1].type;
|
|
702
|
+
const out = {};
|
|
703
|
+
for (const [key, val] of value) {
|
|
704
|
+
out[String(key)] = toJsValue(val, valueType);
|
|
705
|
+
}
|
|
706
|
+
return out;
|
|
707
|
+
}
|
|
708
|
+
default:
|
|
709
|
+
return value;
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
function toTimestampValue(ms, type) {
|
|
713
|
+
const date = new Date(ms);
|
|
714
|
+
if (type.timezone) return date;
|
|
715
|
+
return toWallClockString(date);
|
|
716
|
+
}
|
|
717
|
+
function toWallClockString(date) {
|
|
718
|
+
const pad = (part, width = 2) => String(part).padStart(width, "0");
|
|
719
|
+
const ymd = `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())}`;
|
|
720
|
+
const hours = date.getUTCHours();
|
|
721
|
+
const minutes = date.getUTCMinutes();
|
|
722
|
+
const seconds = date.getUTCSeconds();
|
|
723
|
+
const ms = date.getUTCMilliseconds();
|
|
724
|
+
if (hours === 0 && minutes === 0 && seconds === 0 && ms === 0) return ymd;
|
|
725
|
+
const time = `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
726
|
+
return ms === 0 ? `${ymd} ${time}` : `${ymd} ${time}.${pad(ms, 3)}`;
|
|
727
|
+
}
|
|
728
|
+
function toDecimalValue(unscaled, scale) {
|
|
729
|
+
if (scale <= 0) return unscaled;
|
|
730
|
+
const negative = unscaled.startsWith("-");
|
|
731
|
+
const digits = negative ? unscaled.slice(1) : unscaled;
|
|
732
|
+
const padded = digits.padStart(scale + 1, "0");
|
|
733
|
+
const whole = padded.slice(0, padded.length - scale);
|
|
734
|
+
const fraction = padded.slice(padded.length - scale).replace(/0+$/, "");
|
|
735
|
+
const sign = negative ? "-" : "";
|
|
736
|
+
return fraction ? `${sign}${whole}.${fraction}` : `${sign}${whole}`;
|
|
737
|
+
}
|
|
738
|
+
async function readParquetSchema(filePath) {
|
|
739
|
+
const { readSchema, readMetadata } = await import("parquet-wasm");
|
|
740
|
+
const { tableFromIPC } = await import("apache-arrow");
|
|
741
|
+
try {
|
|
742
|
+
const bytes = new Uint8Array(readFileSync2(filePath));
|
|
743
|
+
const metadata = readMetadata(bytes);
|
|
744
|
+
const numRows = metadata.fileMetadata().numRows();
|
|
745
|
+
metadata.free();
|
|
746
|
+
const table = tableFromIPC(readSchema(bytes).intoIPCStream());
|
|
747
|
+
const columns = table.schema.fields.map((field) => ({ name: field.name, type: field.type.toString() }));
|
|
748
|
+
return {
|
|
749
|
+
columns,
|
|
750
|
+
signature: columns.map((column) => `${column.name}:${column.type}`).join("|"),
|
|
751
|
+
numRows
|
|
752
|
+
};
|
|
753
|
+
} catch {
|
|
754
|
+
throw new CliValidationError("The file could not be read as Parquet.", {
|
|
755
|
+
code: "LOCAL_DATA_PARQUET_INVALID",
|
|
756
|
+
hint: "Verify the file is a valid Parquet file and retry without changing the source file.",
|
|
757
|
+
location: { field: "input-file" }
|
|
758
|
+
});
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
async function streamParquet(filePath, onRow) {
|
|
762
|
+
const { readParquet } = await import("parquet-wasm");
|
|
763
|
+
const { tableFromIPC } = await import("apache-arrow");
|
|
764
|
+
let table;
|
|
765
|
+
try {
|
|
766
|
+
const bytes = new Uint8Array(readFileSync2(filePath));
|
|
767
|
+
const wasmTable = readParquet(bytes);
|
|
768
|
+
table = tableFromIPC(wasmTable.intoIPCStream());
|
|
769
|
+
} catch {
|
|
770
|
+
throw new CliValidationError("The file could not be read as Parquet.", {
|
|
771
|
+
code: "LOCAL_DATA_PARQUET_INVALID",
|
|
772
|
+
hint: "Verify the file is a valid Parquet file and retry without changing the source file.",
|
|
773
|
+
location: { field: "input-file" }
|
|
774
|
+
});
|
|
775
|
+
}
|
|
776
|
+
const fields = table.schema.fields;
|
|
777
|
+
const columns = fields.map((_, index) => table.getChildAt(index));
|
|
778
|
+
let count = 0;
|
|
779
|
+
for (let rowIndex = 0; rowIndex < table.numRows; rowIndex += 1) {
|
|
780
|
+
const row = {};
|
|
781
|
+
for (let columnIndex = 0; columnIndex < fields.length; columnIndex += 1) {
|
|
782
|
+
const column = columns[columnIndex];
|
|
783
|
+
if (!column) continue;
|
|
784
|
+
row[fields[columnIndex].name] = toJsValue(column.get(rowIndex), fields[columnIndex].type);
|
|
785
|
+
}
|
|
786
|
+
count += 1;
|
|
787
|
+
await onRow(row, count);
|
|
788
|
+
}
|
|
789
|
+
return count;
|
|
790
|
+
}
|
|
791
|
+
|
|
644
792
|
// src/commands/data-integration/input.ts
|
|
645
793
|
set_fs(nodeFs);
|
|
646
794
|
function resolveLocalDataInputMeta(filePath) {
|
|
@@ -664,7 +812,7 @@ function resolveLocalDataInputMeta(filePath) {
|
|
|
664
812
|
location: { field: "input-file" }
|
|
665
813
|
});
|
|
666
814
|
}
|
|
667
|
-
if (format !== "xls" && format !== "xlsx" && !encoding) {
|
|
815
|
+
if (format !== "xls" && format !== "xlsx" && format !== "parquet" && !encoding) {
|
|
668
816
|
encoding = detectEncoding(filePath);
|
|
669
817
|
}
|
|
670
818
|
return {
|
|
@@ -788,6 +936,8 @@ async function streamLocalDataRows(input, dataSet, onRow, options = {}) {
|
|
|
788
936
|
return await streamXlsx(input.filePath, dataSet.label, wrappedRow, opts);
|
|
789
937
|
case "xls":
|
|
790
938
|
return await streamXls(input.filePath, dataSet.label, wrappedRow, opts);
|
|
939
|
+
case "parquet":
|
|
940
|
+
return await streamParquet(input.filePath, wrappedRow);
|
|
791
941
|
}
|
|
792
942
|
} catch (error) {
|
|
793
943
|
if (error instanceof CliValidationError) throw error;
|
|
@@ -810,6 +960,7 @@ function resolveFormat(filePath) {
|
|
|
810
960
|
if (extension === "ndjson") return "jsonl";
|
|
811
961
|
if (extension === "xls") return "xls";
|
|
812
962
|
if (extension === "xlsx" || extension === "xlsm") return "xlsx";
|
|
963
|
+
if (extension === "parquet" || extension === "pq") return "parquet";
|
|
813
964
|
return "txt";
|
|
814
965
|
}
|
|
815
966
|
function sniffDelimiter(filePath, encoding) {
|
|
@@ -924,7 +1075,7 @@ function isNumeric(value) {
|
|
|
924
1075
|
return !Number.isNaN(Number(trimmed));
|
|
925
1076
|
}
|
|
926
1077
|
async function discoverDataSets(filePath, format) {
|
|
927
|
-
if (format === "csv" || format === "tsv" || format === "jsonl") {
|
|
1078
|
+
if (format === "csv" || format === "tsv" || format === "jsonl" || format === "parquet") {
|
|
928
1079
|
return { visible: [{ id: "$", kind: "file", label: basename(filePath), selector: "$" }], hidden: [] };
|
|
929
1080
|
}
|
|
930
1081
|
if (format === "xls") {
|
|
@@ -1685,7 +1836,7 @@ async function firstNonWhitespaceCharacter(filePath, encoding) {
|
|
|
1685
1836
|
}
|
|
1686
1837
|
|
|
1687
1838
|
// src/commands/data-integration/mapping.ts
|
|
1688
|
-
import { readFileSync as
|
|
1839
|
+
import { readFileSync as readFileSync3 } from "fs";
|
|
1689
1840
|
|
|
1690
1841
|
// src/commands/data-integration/types.ts
|
|
1691
1842
|
var MAPPING_VERSION = "ae-data-integration-mapping/v1";
|
|
@@ -1706,7 +1857,7 @@ function readLocalDataMapping(raw, options) {
|
|
|
1706
1857
|
text = trimmed;
|
|
1707
1858
|
} else {
|
|
1708
1859
|
const filePath = trimmed.startsWith("@") ? trimmed.slice(1) : trimmed;
|
|
1709
|
-
text =
|
|
1860
|
+
text = readFileSync3(filePath, "utf8");
|
|
1710
1861
|
}
|
|
1711
1862
|
} catch {
|
|
1712
1863
|
throw new CliValidationError("The local-data mapping could not be read.", {
|
|
@@ -1731,7 +1882,7 @@ function validateMapping(value, options) {
|
|
|
1731
1882
|
throw mappingError(`Mapping version must be ${MAPPING_VERSION}.`);
|
|
1732
1883
|
}
|
|
1733
1884
|
const sha256Valid = typeof value.source?.sha256 === "string" && (options?.sourceWildcard ? value.source.sha256 === "*" || /^[a-f0-9]{64}$/i.test(value.source.sha256) : /^[a-f0-9]{64}$/i.test(value.source.sha256));
|
|
1734
|
-
if (!isRecord(value.source) || !sha256Valid || !["csv", "tsv", "json", "jsonl", "xls", "xlsx"].includes(String(value.source.format)) || typeof value.source.data_set !== "string" || !value.source.data_set) {
|
|
1885
|
+
if (!isRecord(value.source) || !sha256Valid || !["csv", "tsv", "json", "jsonl", "xls", "xlsx", "parquet"].includes(String(value.source.format)) || typeof value.source.data_set !== "string" || !value.source.data_set) {
|
|
1735
1886
|
throw mappingError("Mapping source fingerprint and data set are required.");
|
|
1736
1887
|
}
|
|
1737
1888
|
if (value.mode !== "track" && value.mode !== "user_set" && value.mode !== "mixed") {
|
|
@@ -2949,9 +3100,9 @@ var dataIntegrationInspect = {
|
|
|
2949
3100
|
service: "data-integration",
|
|
2950
3101
|
command: "inspect",
|
|
2951
3102
|
usesAeHost: false,
|
|
2952
|
-
description: "Stream one or more local CSV, TSV, TXT, JSON, JSONL, XLS, or
|
|
3103
|
+
description: "Stream one or more local CSV, TSV, TXT, JSON, JSONL, XLS, XLSX, or Parquet files and recommend a UE mapping.",
|
|
2953
3104
|
flags: [
|
|
2954
|
-
{ name: "input-file", type: "string", required: true, sensitive: true, variadic: true, desc: "Local CSV, TSV, TXT, JSON, JSONL, XLS, or
|
|
3105
|
+
{ name: "input-file", type: "string", required: true, sensitive: true, variadic: true, desc: "Local CSV, TSV, TXT, JSON, JSONL, XLS, XLSX, or Parquet file. Repeat for multiple files." },
|
|
2955
3106
|
{ name: "data-set", type: "string", sensitive: true, desc: "Sheet or JSON Path ID returned by a discovery-only inspection." },
|
|
2956
3107
|
{ name: "source-timezone", type: "string", default: "Asia/Shanghai", desc: "IANA timezone used to interpret source times without an offset." },
|
|
2957
3108
|
{ name: "headers", type: "string", sensitive: true, desc: "Comma-separated explicit column names for a headerless file; the first row is data." },
|
|
@@ -3039,6 +3190,10 @@ var dataIntegrationInspect = {
|
|
|
3039
3190
|
};
|
|
3040
3191
|
}
|
|
3041
3192
|
const files = [];
|
|
3193
|
+
if (inputFiles.every((file) => resolveLocalDataInputMeta(file).format === "parquet")) {
|
|
3194
|
+
const checked = await inspectParquetFiles(inputFiles, sourceTimezone);
|
|
3195
|
+
if (checked) return checked;
|
|
3196
|
+
}
|
|
3042
3197
|
for (const inputFile of inputFiles) {
|
|
3043
3198
|
const input = await inspectLocalDataInput(inputFile);
|
|
3044
3199
|
const dataSet = selectDataSet(input);
|
|
@@ -3073,6 +3228,34 @@ var dataIntegrationInspect = {
|
|
|
3073
3228
|
};
|
|
3074
3229
|
}
|
|
3075
3230
|
};
|
|
3231
|
+
async function inspectParquetFiles(inputFiles, sourceTimezone) {
|
|
3232
|
+
const firstPath = inputFiles[0];
|
|
3233
|
+
const firstSchema = await readParquetSchema(firstPath);
|
|
3234
|
+
const first = await inspectLocalDataInput(firstPath);
|
|
3235
|
+
const profile = await profileLocalData(first, selectDataSet(first), sourceTimezone, {
|
|
3236
|
+
collectSamples: true,
|
|
3237
|
+
collectNestedTree: true
|
|
3238
|
+
});
|
|
3239
|
+
const files = [];
|
|
3240
|
+
let totalRowCount = 0;
|
|
3241
|
+
let totalSizeBytes = 0;
|
|
3242
|
+
for (const inputFile of inputFiles) {
|
|
3243
|
+
const meta = resolveLocalDataInputMeta(inputFile);
|
|
3244
|
+
const schema = inputFile === firstPath ? firstSchema : await readParquetSchema(inputFile);
|
|
3245
|
+
if (schema.signature !== firstSchema.signature) return void 0;
|
|
3246
|
+
files.push({ file: basename3(inputFile), row_count: schema.numRows, size_bytes: meta.sizeBytes });
|
|
3247
|
+
totalRowCount += schema.numRows;
|
|
3248
|
+
totalSizeBytes += meta.sizeBytes;
|
|
3249
|
+
}
|
|
3250
|
+
return {
|
|
3251
|
+
version: "ae-local-data-profile/v1",
|
|
3252
|
+
schema_checked: true,
|
|
3253
|
+
representative: { file: basename3(firstPath), profile },
|
|
3254
|
+
files,
|
|
3255
|
+
total_row_count: totalRowCount,
|
|
3256
|
+
total_size_bytes: totalSizeBytes
|
|
3257
|
+
};
|
|
3258
|
+
}
|
|
3076
3259
|
function summarizeExcludedSheets(input) {
|
|
3077
3260
|
const excluded = input.excludedDataSets ?? [];
|
|
3078
3261
|
if (excluded.length === 0) return {};
|
|
@@ -3331,7 +3514,7 @@ import {
|
|
|
3331
3514
|
existsSync,
|
|
3332
3515
|
mkdirSync,
|
|
3333
3516
|
readdirSync,
|
|
3334
|
-
readFileSync as
|
|
3517
|
+
readFileSync as readFileSync4,
|
|
3335
3518
|
renameSync,
|
|
3336
3519
|
statSync as statSync2,
|
|
3337
3520
|
unlinkSync,
|
|
@@ -3699,7 +3882,7 @@ function readZoneOffset(row, field) {
|
|
|
3699
3882
|
function readSalvageRowNumbers(path) {
|
|
3700
3883
|
let text;
|
|
3701
3884
|
try {
|
|
3702
|
-
text =
|
|
3885
|
+
text = readFileSync4(path, "utf8");
|
|
3703
3886
|
} catch {
|
|
3704
3887
|
throw new CliValidationError("The salvage file could not be read.", {
|
|
3705
3888
|
code: "LOCAL_DATA_SALVAGE_INVALID",
|
|
@@ -4101,7 +4284,7 @@ var dataIntegrationConvert = {
|
|
|
4101
4284
|
};
|
|
4102
4285
|
|
|
4103
4286
|
// src/commands/data-integration/upload.ts
|
|
4104
|
-
import { createReadStream as createReadStream4, readFileSync as
|
|
4287
|
+
import { createReadStream as createReadStream4, readFileSync as readFileSync5, statSync as statSync3 } from "fs";
|
|
4105
4288
|
import { basename as basename5, dirname, resolve as resolve2 } from "path";
|
|
4106
4289
|
import { createInterface as createInterface3 } from "readline";
|
|
4107
4290
|
var DEFAULT_BATCH_SIZE = 500;
|
|
@@ -4335,7 +4518,7 @@ async function prepareUpload(ctx, enforceReady) {
|
|
|
4335
4518
|
function readManifest(path) {
|
|
4336
4519
|
let value;
|
|
4337
4520
|
try {
|
|
4338
|
-
value = JSON.parse(
|
|
4521
|
+
value = JSON.parse(readFileSync5(path, "utf8"));
|
|
4339
4522
|
} catch {
|
|
4340
4523
|
throw new CliValidationError("The local-data manifest could not be read as JSON.", {
|
|
4341
4524
|
code: "LOCAL_DATA_MANIFEST_INVALID",
|
|
@@ -4447,7 +4630,7 @@ function isRecord3(value) {
|
|
|
4447
4630
|
|
|
4448
4631
|
// src/commands/data-integration/handoff.ts
|
|
4449
4632
|
import { createHash as createHash3 } from "crypto";
|
|
4450
|
-
import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, mkdtempSync, readFileSync as
|
|
4633
|
+
import { chmodSync as chmodSync2, mkdirSync as mkdirSync2, mkdtempSync, readFileSync as readFileSync6, renameSync as renameSync2, rmSync, writeFileSync as writeFileSync2 } from "fs";
|
|
4451
4634
|
import { dirname as dirname2, join as join3, resolve as resolve3 } from "path";
|
|
4452
4635
|
import { tmpdir } from "os";
|
|
4453
4636
|
|
|
@@ -5379,7 +5562,7 @@ function buildHandoffPackage(outDir, mapping, planFile) {
|
|
|
5379
5562
|
function readHandoffIndex(path) {
|
|
5380
5563
|
let raw;
|
|
5381
5564
|
try {
|
|
5382
|
-
raw =
|
|
5565
|
+
raw = readFileSync6(path, "utf8");
|
|
5383
5566
|
} catch {
|
|
5384
5567
|
return { version: HANDOFF_INDEX_VERSION, entries: [] };
|
|
5385
5568
|
}
|
|
@@ -5403,7 +5586,7 @@ function readHandoffIndex(path) {
|
|
|
5403
5586
|
function readPlanFile(path) {
|
|
5404
5587
|
let raw;
|
|
5405
5588
|
try {
|
|
5406
|
-
raw =
|
|
5589
|
+
raw = readFileSync6(path, "utf8");
|
|
5407
5590
|
} catch {
|
|
5408
5591
|
throw new CliValidationError("The tracking-plan file could not be read.", {
|
|
5409
5592
|
code: "LOCAL_DATA_HANDOFF_PLAN_NOT_FOUND",
|
|
@@ -5611,7 +5794,7 @@ function stageScopedPackage(outDir, mappingDirs, entries, relayFiles) {
|
|
|
5611
5794
|
for (const rel of mappingDirFiles(dirName, planFile)) {
|
|
5612
5795
|
const dest = join3(staging, rel);
|
|
5613
5796
|
mkdirSync2(dirname2(dest), { recursive: true, mode: 448 });
|
|
5614
|
-
writeFileSync2(dest,
|
|
5797
|
+
writeFileSync2(dest, readFileSync6(join3(outDir, rel), "utf8"), { encoding: "utf8", mode: 384 });
|
|
5615
5798
|
chmodSync2(dest, 384);
|
|
5616
5799
|
}
|
|
5617
5800
|
}
|
|
@@ -5619,7 +5802,7 @@ function stageScopedPackage(outDir, mappingDirs, entries, relayFiles) {
|
|
|
5619
5802
|
}
|
|
5620
5803
|
|
|
5621
5804
|
// src/commands/data-integration/reuse.ts
|
|
5622
|
-
import { readFileSync as
|
|
5805
|
+
import { readFileSync as readFileSync7 } from "fs";
|
|
5623
5806
|
import { dirname as dirname4, join as join5, resolve as resolve5 } from "path";
|
|
5624
5807
|
|
|
5625
5808
|
// src/commands/data-integration/handoff-root.ts
|
|
@@ -5678,7 +5861,7 @@ function detectReuse(mapping, outDir) {
|
|
|
5678
5861
|
function readFrozenEventName(path) {
|
|
5679
5862
|
let value;
|
|
5680
5863
|
try {
|
|
5681
|
-
value = JSON.parse(
|
|
5864
|
+
value = JSON.parse(readFileSync7(path, "utf8"));
|
|
5682
5865
|
} catch {
|
|
5683
5866
|
return {};
|
|
5684
5867
|
}
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
evalDownloadFile,
|
|
5
5
|
evalRequest,
|
|
6
6
|
resolveEvaluationHost
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-YVG6QD3V.js";
|
|
8
8
|
import {
|
|
9
9
|
getCliToken
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SOSFRU3O.js";
|
|
11
11
|
import {
|
|
12
12
|
isAeSandboxRuntime
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-4PSTYEG5.js";
|
|
14
14
|
import {
|
|
15
15
|
CliValidationError,
|
|
16
16
|
externalCliTokenRequestOptions
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
18
18
|
|
|
19
19
|
// src/core/eval-session.ts
|
|
20
20
|
var SESSION_PATH = "/api/sandbox/agent/evaluation/session";
|