@thinkingai/ae-cli 6.1.17 → 6.1.19
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 +2 -0
- package/README.zh.md +6 -0
- package/dist/{auth-77BUFLGC.js → auth-QPEVVBKT.js} +20 -15
- package/dist/auth-UMJAA72O.js +15 -0
- package/dist/{capability-72DTW5M2.js → capability-ASI62I4A.js} +53 -15
- package/dist/{chunk-UW5UN47B.js → chunk-533JK3YX.js} +2 -0
- package/dist/{chunk-UOUS37JQ.js → chunk-6QK7SYYY.js} +5 -4
- package/dist/{chunk-TUKQZTMI.js → chunk-7K24F7T2.js} +2 -0
- package/dist/{chunk-OO6XR6LK.js → chunk-AMBFK2K3.js} +2 -0
- package/dist/{sync-DAVKYVMW.js → chunk-B5HMQAOM.js} +31 -540
- package/dist/{chunk-VR3LCBHW.js → chunk-DKEXH6Q5.js} +6 -5
- package/dist/{chunk-VTWMIC5L.js → chunk-E2JKXMVO.js} +2 -0
- package/dist/{chunk-LYVNONC4.js → chunk-FR2EDAQM.js} +36 -0
- package/dist/{chunk-ILIU36SU.js → chunk-GJXRF7Y6.js} +6 -5
- package/dist/{chunk-DWO43OIB.js → chunk-JQ3ENZZH.js} +2 -0
- package/dist/chunk-JYMGHGCE.js +191 -0
- package/dist/{chunk-GT46FPXN.js → chunk-KEWVSO64.js} +18 -8
- package/dist/chunk-KZ6ZHF5J.js +294 -0
- package/dist/chunk-O6K2ODUE.js +318 -0
- package/dist/chunk-QL6R6TSK.js +25215 -0
- package/dist/{chunk-4SGZG4XY.js → chunk-RWXIXOZG.js} +28 -13
- package/dist/{chunk-YA6SMTXG.js → chunk-S5PONFBM.js} +5 -4
- package/dist/{chunk-4NN5IWVN.js → chunk-T6OSFQZD.js} +2 -0
- package/dist/{chunk-PTE56QPL.js → chunk-TKHSULJT.js} +6 -0
- package/dist/{chunk-6EIJSNBD.js → chunk-Y74WTIKJ.js} +2 -0
- package/dist/{client-TKG4WBHN.js → client-N7NGZUNI.js} +6 -4
- package/dist/{community-report-client-FI4LNVYS.js → community-report-client-6OL6GBQW.js} +3 -3
- package/dist/{config-RE6CMGPK.js → config-XNMACCKX.js} +10 -8
- package/dist/{data-integration-XQYB4X4F.js → data-integration-4NZGZ45E.js} +2502 -272
- package/dist/index.js +137 -1245
- package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-EFHDLXFG.js} +3 -3
- package/dist/{memory-YK33G4T7.js → memory-HBJQ2GC5.js} +8 -7
- package/dist/{metadata-UILXHBWF.js → metadata-62EWBEIG.js} +12 -11
- package/dist/{model-NR3JHFSJ.js → model-BHLJ2QMT.js} +10 -9
- package/dist/personal-semantic-preference-JBVMAI7L.js +240 -0
- package/dist/project-semantic-BQ4MPUS5.js +1115 -0
- package/dist/sync-MUWPRM5I.js +522 -0
- package/dist/{te-agent-4BKBODMF.js → te-agent-WQZTMEK4.js} +12 -10
- package/dist/{te-analysis-O6DCO6BS.js → te-analysis-MNCG65LU.js} +534 -48
- package/dist/{te-community-HLC43QKH.js → te-community-BNE6KREL.js} +8 -7
- package/dist/{te-dataops-EJP56W3K.js → te-dataops-TXLKM2W6.js} +469 -68
- package/dist/{te-engage-FGBGQ4IY.js → te-engage-TPKLRVTL.js} +84 -10
- package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BYKTCY7.js} +303 -12
- package/dist/{te-kb-SQCLHG6X.js → te-kb-BUD6N3NI.js} +312 -25
- package/dist/{te-system-YARIK4S5.js → te-system-44LZJDTQ.js} +573 -37
- package/dist/{te-team-EFKWYKMK.js → te-team-XMP47YXE.js} +10 -7
- package/dist/{update-OGPSZM5A.js → update-UODFOZ4P.js} +9 -7
- package/package.json +18 -9
- package/skills/ae-agent/SKILL.md +3 -4
- package/skills/ae-agent/references/edit-skill.md +3 -0
- package/skills/ae-agent/references/get-skill-content.md +1 -1
- package/skills/ae-agent/references/rescan-skills.md +15 -13
- package/skills/ae-agent/references/upload-skill.md +7 -4
- package/skills/ae-analysis/SKILL.md +45 -4
- package/skills/ae-analysis/metadata_resolution.md +38 -4
- package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +1 -1
- package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
- package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
- package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
- package/skills/ae-analysis/references/audience_models.md +18 -0
- package/skills/ae-analysis/references/command_index.md +19 -11
- package/skills/ae-analysis/references/dashboard_get.md +18 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -0
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
- package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
- package/skills/ae-analysis/references/project_timezone_update.md +13 -4
- package/skills/ae-analysis/references/property_create.md +2 -0
- package/skills/ae-analysis/references/super_metadata_batch_create.md +2 -0
- package/skills/ae-analysis/references/user_cluster_models.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +8 -4
- package/skills/ae-analysis/references/user_tag_create.md +7 -1
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-data-integration/SKILL.md +24 -4
- package/skills/ae-data-integration/references/custom-layer.md +93 -0
- package/skills/ae-data-integration/references/error-handling.md +145 -0
- package/skills/ae-data-integration/references/handoff.md +77 -18
- package/skills/ae-data-integration/references/local-analysis.md +1 -1
- package/skills/ae-data-integration/references/reuse.md +9 -5
- package/skills/ae-data-integration/references/sink-upload.md +1 -1
- package/skills/ae-data-integration/references/source-inspect.md +35 -13
- package/skills/ae-data-integration/references/tracking-plan.md +7 -5
- package/skills/ae-data-integration/references/transform.md +12 -10
- package/skills/ae-data-integration/references/ue-mapping.md +33 -11
- package/skills/ae-data-integration/references/ue-routing.md +23 -0
- package/skills/ae-dataops/SKILL.md +11 -1
- package/skills/ae-dataops/references/dataops-backfill.md +135 -0
- package/skills/ae-engage/SKILL.md +5 -0
- package/skills/ae-engage/references/build-task-save-guide.md +14 -1
- package/skills/ae-engage/references/save-flow.md +37 -1
- package/skills/ae-engage/references/save-task.md +88 -0
- package/skills/ae-experiment/SKILL.md +14 -4
- package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
- package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
- package/skills/ae-experiment/references/save_experiment.md +1 -1
- package/skills/ae-experiment/references/save_metric.md +20 -8
- package/skills/ae-kb/SKILL.md +121 -10
- package/skills/ae-project-semantic/SKILL.md +193 -0
- package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
- package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
- package/skills/ae-system/SKILL.md +28 -30
- package/skills/ae-system/references/channel-management.md +303 -0
- package/dist/auth-2WTQOP77.js +0 -14
- package/dist/capability-PJHNI4GJ.js +0 -315
- package/dist/chunk-4KVPKXFX.js +0 -98
- package/dist/chunk-C4MGVGJW.js +0 -13
- package/dist/chunk-P3FGXJTU.js +0 -349
- package/dist/chunk-QGM4M3NI.js +0 -37
- package/dist/chunk-RGKJGKT7.js +0 -71
- package/dist/chunk-SAU3QFIQ.js +0 -556
- package/dist/chunk-VPKZ7I72.js +0 -509
- package/dist/chunk-ZZUOD757.js +0 -598
- package/dist/memory-CHRU2F7W.js +0 -893
- package/dist/metadata-XXR34N5P.js +0 -339
- package/dist/model-K3KLWIW6.js +0 -139
- package/dist/sync-FCKOVWWS.js +0 -10261
- package/dist/te-agent-HLW4VTQK.js +0 -3893
- package/dist/te-analysis-ZMNGOVNW.js +0 -8958
- package/dist/te-community-6HPBWJUZ.js +0 -1859
- package/dist/te-dataops-HDRUXY4K.js +0 -2208
- package/dist/te-engage-RAK5PESW.js +0 -4898
- package/dist/te-experiment-VZF7BT6G.js +0 -770
- package/dist/te-system-Z77IKZFN.js +0 -2213
|
@@ -1,339 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
withAsyncArtifactLifecycle
|
|
3
|
-
} from "./chunk-SAU3QFIQ.js";
|
|
4
|
-
import {
|
|
5
|
-
createCapabilityCommand
|
|
6
|
-
} from "./chunk-RGKJGKT7.js";
|
|
7
|
-
import {
|
|
8
|
-
registerCapabilityGatewayRoute
|
|
9
|
-
} from "./chunk-PTE56QPL.js";
|
|
10
|
-
import "./chunk-GT46FPXN.js";
|
|
11
|
-
import "./chunk-P3FGXJTU.js";
|
|
12
|
-
import "./chunk-C4MGVGJW.js";
|
|
13
|
-
import "./chunk-4SGZG4XY.js";
|
|
14
|
-
import "./chunk-ZZUOD757.js";
|
|
15
|
-
import "./chunk-UW5UN47B.js";
|
|
16
|
-
import "./chunk-LYVNONC4.js";
|
|
17
|
-
import "./chunk-QGM4M3NI.js";
|
|
18
|
-
|
|
19
|
-
// src/commands/metadata/shared.ts
|
|
20
|
-
function createCapabilityCommand2(config) {
|
|
21
|
-
const { asyncArtifact, ...coreConfig } = config;
|
|
22
|
-
const command = createCapabilityCommand({
|
|
23
|
-
...coreConfig,
|
|
24
|
-
cliService: coreConfig.cliService ?? "metadata"
|
|
25
|
-
});
|
|
26
|
-
return asyncArtifact ? withAsyncArtifactLifecycle(command) : command;
|
|
27
|
-
}
|
|
28
|
-
function optionalString(ctx, name) {
|
|
29
|
-
const value = ctx.str(name);
|
|
30
|
-
return value === "" ? void 0 : value;
|
|
31
|
-
}
|
|
32
|
-
function optionalNumber(ctx, name) {
|
|
33
|
-
const value = ctx.str(name);
|
|
34
|
-
return value === "" ? void 0 : Number(value);
|
|
35
|
-
}
|
|
36
|
-
function optionalBoolean(ctx, name) {
|
|
37
|
-
const value = ctx.str(name);
|
|
38
|
-
return value === "" ? void 0 : ctx.bool(name);
|
|
39
|
-
}
|
|
40
|
-
function optionalJson(ctx, name) {
|
|
41
|
-
const value = ctx.str(name);
|
|
42
|
-
return value === "" ? void 0 : ctx.json(name);
|
|
43
|
-
}
|
|
44
|
-
function optionalDataTableColumns(ctx, name, kind) {
|
|
45
|
-
const value = optionalJson(ctx, name);
|
|
46
|
-
return value === void 0 ? void 0 : normalizeDataTableColumns(value, kind);
|
|
47
|
-
}
|
|
48
|
-
function requiredDataTableColumns(ctx, name, kind) {
|
|
49
|
-
return normalizeDataTableColumns(ctx.json(name), kind);
|
|
50
|
-
}
|
|
51
|
-
function normalizeDataTableColumns(value, kind) {
|
|
52
|
-
if (!Array.isArray(value)) {
|
|
53
|
-
return value;
|
|
54
|
-
}
|
|
55
|
-
return value.map((item) => {
|
|
56
|
-
if (item == null || typeof item !== "object" || Array.isArray(item)) {
|
|
57
|
-
return item;
|
|
58
|
-
}
|
|
59
|
-
const column = { ...item };
|
|
60
|
-
if (column.column_name === void 0 && column.name !== void 0) {
|
|
61
|
-
column.column_name = column.name;
|
|
62
|
-
}
|
|
63
|
-
if (column.column_desc === void 0) {
|
|
64
|
-
column.column_desc = column.display_name ?? column.description;
|
|
65
|
-
}
|
|
66
|
-
if (kind === "csv") {
|
|
67
|
-
if (column.select_type === void 0 && column.type !== void 0) {
|
|
68
|
-
column.select_type = column.type;
|
|
69
|
-
}
|
|
70
|
-
} else if (column.column_type === void 0 && column.type !== void 0) {
|
|
71
|
-
column.column_type = column.type;
|
|
72
|
-
}
|
|
73
|
-
delete column.name;
|
|
74
|
-
delete column.type;
|
|
75
|
-
delete column.display_name;
|
|
76
|
-
delete column.description;
|
|
77
|
-
return column;
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
// src/commands/metadata/data-table/csv-delete.ts
|
|
82
|
-
var dataTableCsvDelete = createCapabilityCommand2({
|
|
83
|
-
resource: "data-table",
|
|
84
|
-
command: "csv-delete",
|
|
85
|
-
capabilityId: "metadata.data_table.csv_delete",
|
|
86
|
-
description: "Delete a CSV-backed metadata data table.",
|
|
87
|
-
flags: [
|
|
88
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
89
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." }
|
|
90
|
-
],
|
|
91
|
-
risk: "high-risk-write",
|
|
92
|
-
buildInput: (ctx) => ({
|
|
93
|
-
project_id: ctx.num("project-id"),
|
|
94
|
-
data_table_id: ctx.num("data-table-id")
|
|
95
|
-
})
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
// src/commands/metadata/data-table/csv-write.ts
|
|
99
|
-
var dataTableCsvWrite = createCapabilityCommand2({
|
|
100
|
-
resource: "data-table",
|
|
101
|
-
command: "csv-write",
|
|
102
|
-
capabilityId: "metadata.data_table.csv_write",
|
|
103
|
-
description: "Create or update a CSV-backed metadata data table from an uploaded input file.",
|
|
104
|
-
flags: [
|
|
105
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
106
|
-
{ name: "operation", type: "string", required: true, desc: "Write operation: create, incremental_update, or replace_update." },
|
|
107
|
-
{ name: "input-file-id", type: "string", required: true, desc: "Uploaded input file ID, for example ifile_<32 lowercase hex>." },
|
|
108
|
-
{ name: "data-table-id", type: "number", required: false, desc: "Existing data table ID for update operations." },
|
|
109
|
-
{ name: "data-table-name", type: "string", required: false, desc: "Optional technical data table name. If supplied, use datatable_<project_id>_<name>." },
|
|
110
|
-
{ name: "display-name", type: "string", required: false, desc: "Human-readable data table name." },
|
|
111
|
-
{ name: "description", type: "string", required: false, desc: "Data table description." },
|
|
112
|
-
{ name: "columns", type: "json", required: false, desc: "Column definitions JSON array. Use column_name/select_type/column_desc, or name/type/display_name aliases." }
|
|
113
|
-
],
|
|
114
|
-
risk: "write",
|
|
115
|
-
buildInput: (ctx) => ({
|
|
116
|
-
project_id: ctx.num("project-id"),
|
|
117
|
-
operation: ctx.str("operation"),
|
|
118
|
-
data_table_id: optionalNumber(ctx, "data-table-id"),
|
|
119
|
-
input_file_id: ctx.str("input-file-id"),
|
|
120
|
-
data_table_name: optionalString(ctx, "data-table-name"),
|
|
121
|
-
display_name: optionalString(ctx, "display-name"),
|
|
122
|
-
description: optionalString(ctx, "description"),
|
|
123
|
-
columns: optionalDataTableColumns(ctx, "columns", "csv")
|
|
124
|
-
})
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
// src/commands/metadata/data-table/download.ts
|
|
128
|
-
var dataTableDownload = createCapabilityCommand2({
|
|
129
|
-
resource: "data-table",
|
|
130
|
-
command: "download",
|
|
131
|
-
capabilityId: "metadata.data_table.download",
|
|
132
|
-
asyncArtifact: true,
|
|
133
|
-
description: "Download a metadata data table export artifact.",
|
|
134
|
-
flags: [
|
|
135
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
136
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." },
|
|
137
|
-
{ name: "request-id", type: "string", required: false, desc: "Optional request ID. Format: cli_<32 lowercase hex>." },
|
|
138
|
-
{ name: "timeout-seconds", type: "number", required: false, desc: "Export timeout seconds. Default and max: 21600 (6 hours).", min: 1, max: 21600 }
|
|
139
|
-
],
|
|
140
|
-
risk: "read",
|
|
141
|
-
buildInput: (ctx) => ({
|
|
142
|
-
project_id: ctx.num("project-id"),
|
|
143
|
-
data_table_id: ctx.num("data-table-id"),
|
|
144
|
-
request_id: optionalString(ctx, "request-id"),
|
|
145
|
-
timeout_seconds: optionalNumber(ctx, "timeout-seconds")
|
|
146
|
-
})
|
|
147
|
-
});
|
|
148
|
-
|
|
149
|
-
// src/commands/metadata/data-table/get.ts
|
|
150
|
-
var dataTableGet = createCapabilityCommand2({
|
|
151
|
-
resource: "data-table",
|
|
152
|
-
command: "get",
|
|
153
|
-
capabilityId: "metadata.data_table.get",
|
|
154
|
-
description: "Get one metadata data table detail. Requires metadata view permission.",
|
|
155
|
-
flags: [
|
|
156
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
157
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." },
|
|
158
|
-
{ name: "include-preview", type: "boolean", required: false, desc: "Whether to include preview rows." }
|
|
159
|
-
],
|
|
160
|
-
risk: "read",
|
|
161
|
-
buildInput: (ctx) => ({
|
|
162
|
-
project_id: ctx.num("project-id"),
|
|
163
|
-
data_table_id: ctx.num("data-table-id"),
|
|
164
|
-
include_preview: optionalBoolean(ctx, "include-preview")
|
|
165
|
-
})
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
// src/commands/metadata/data-table/list.ts
|
|
169
|
-
var dataTableList = createCapabilityCommand2({
|
|
170
|
-
resource: "data-table",
|
|
171
|
-
command: "list",
|
|
172
|
-
capabilityId: "metadata.data_table.list",
|
|
173
|
-
description: "List metadata data tables in a project. Requires metadata view permission.",
|
|
174
|
-
flags: [
|
|
175
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
176
|
-
{ name: "limit", type: "number", required: false, desc: "Page size. Default: 50, max: 200.", alias: "l", min: 1, max: 200 },
|
|
177
|
-
{ name: "offset", type: "number", required: false, desc: "Zero-based page offset. Default: 0.", alias: "o", min: 0 }
|
|
178
|
-
],
|
|
179
|
-
risk: "read",
|
|
180
|
-
buildInput: (ctx) => ({
|
|
181
|
-
project_id: ctx.num("project-id"),
|
|
182
|
-
limit: optionalNumber(ctx, "limit"),
|
|
183
|
-
offset: optionalNumber(ctx, "offset")
|
|
184
|
-
})
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
// src/commands/metadata/data-table/property-bindings-update.ts
|
|
188
|
-
var dataTablePropertyBindingsUpdate = createCapabilityCommand2({
|
|
189
|
-
resource: "data-table",
|
|
190
|
-
command: "property-bindings-update",
|
|
191
|
-
capabilityId: "metadata.data_table.property_bindings_update",
|
|
192
|
-
description: "Update property bindings for an existing metadata data table.",
|
|
193
|
-
flags: [
|
|
194
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
195
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." },
|
|
196
|
-
{ name: "bind-properties", type: "json", required: false, desc: "Properties to bind JSON array. Each item includes property_name and property_scope." },
|
|
197
|
-
{ name: "unbind-properties", type: "json", required: false, desc: "Properties to unbind JSON array. Each item includes property_name and property_scope." }
|
|
198
|
-
],
|
|
199
|
-
risk: "write",
|
|
200
|
-
buildInput: (ctx) => ({
|
|
201
|
-
project_id: ctx.num("project-id"),
|
|
202
|
-
data_table_id: ctx.num("data-table-id"),
|
|
203
|
-
bind_properties: optionalJson(ctx, "bind-properties"),
|
|
204
|
-
unbind_properties: optionalJson(ctx, "unbind-properties")
|
|
205
|
-
})
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
// src/commands/metadata/data-table/sql-delete.ts
|
|
209
|
-
var dataTableSqlDelete = createCapabilityCommand2({
|
|
210
|
-
resource: "data-table",
|
|
211
|
-
command: "sql-delete",
|
|
212
|
-
capabilityId: "metadata.data_table.sql_delete",
|
|
213
|
-
description: "Delete a SQL-backed metadata data table.",
|
|
214
|
-
flags: [
|
|
215
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
216
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." }
|
|
217
|
-
],
|
|
218
|
-
risk: "high-risk-write",
|
|
219
|
-
buildInput: (ctx) => ({
|
|
220
|
-
project_id: ctx.num("project-id"),
|
|
221
|
-
data_table_id: ctx.num("data-table-id")
|
|
222
|
-
})
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
// src/commands/metadata/data-table/sql-write.ts
|
|
226
|
-
var SQL_DATATABLE_QP_EXAMPLE = `{"taSqlVo":{"sql":"select '1' as id","sqlVoParams":[]},"taSqlView":{}}`;
|
|
227
|
-
var dataTableSqlWrite = createCapabilityCommand2({
|
|
228
|
-
resource: "data-table",
|
|
229
|
-
command: "sql-write",
|
|
230
|
-
capabilityId: "metadata.data_table.sql_write",
|
|
231
|
-
description: "Create or update a SQL-backed metadata data table.",
|
|
232
|
-
flags: [
|
|
233
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
234
|
-
{ name: "operation", type: "string", required: true, desc: "Write operation: create or update." },
|
|
235
|
-
{ name: "columns", type: "json", required: true, desc: "Column definitions JSON array. Use column_name/column_type/column_desc, or name/type/display_name aliases. Must match SQL output columns." },
|
|
236
|
-
{ name: "qp", type: "json", required: true, desc: `SqlDatatableDef JSON object with taSqlVo.sql (required) and taSqlView (use {} when empty). Do not pass a top-level sql field. Create example: ${SQL_DATATABLE_QP_EXAMPLE}` },
|
|
237
|
-
{ name: "data-table-id", type: "number", required: false, desc: "Existing data table ID for update operations." },
|
|
238
|
-
{ name: "table-name", type: "string", required: false, desc: "Technical data table name for create. Use datatable_<project_id>_<name>." },
|
|
239
|
-
{ name: "display-name", type: "string", required: false, desc: "Human-readable data table name." },
|
|
240
|
-
{ name: "remarks", type: "string", required: false, desc: "Data table remarks." },
|
|
241
|
-
{ name: "zone-offset", type: "number", required: false, desc: "Time zone offset in hours used by the query plan. For example, UTC+8 is 8 and UTC-5 is -5. Valid range: -12 to 14." },
|
|
242
|
-
{ name: "strategy", type: "string", required: false, desc: "Write strategy: overwrite or insert." },
|
|
243
|
-
{ name: "update-cron", type: "string", required: false, desc: "Cron expression for scheduled updates." }
|
|
244
|
-
],
|
|
245
|
-
risk: "write",
|
|
246
|
-
buildInput: (ctx) => ({
|
|
247
|
-
project_id: ctx.num("project-id"),
|
|
248
|
-
operation: ctx.str("operation"),
|
|
249
|
-
data_table_id: optionalNumber(ctx, "data-table-id"),
|
|
250
|
-
table_name: optionalString(ctx, "table-name"),
|
|
251
|
-
display_name: optionalString(ctx, "display-name"),
|
|
252
|
-
remarks: optionalString(ctx, "remarks"),
|
|
253
|
-
columns: requiredDataTableColumns(ctx, "columns", "sql"),
|
|
254
|
-
qp: ctx.json("qp"),
|
|
255
|
-
zone_offset: optionalNumber(ctx, "zone-offset"),
|
|
256
|
-
strategy: optionalString(ctx, "strategy"),
|
|
257
|
-
update_cron: optionalString(ctx, "update-cron")
|
|
258
|
-
})
|
|
259
|
-
});
|
|
260
|
-
|
|
261
|
-
// src/commands/metadata/property/dimension-table/bind-existing.ts
|
|
262
|
-
var propertyDimensionTableBindExisting = createCapabilityCommand2({
|
|
263
|
-
resource: "property",
|
|
264
|
-
command: "bind-existing-dimension-table",
|
|
265
|
-
capabilityId: "metadata.property.bind_existing_dimension_table",
|
|
266
|
-
description: "Bind an existing dimension data table to a metadata property.",
|
|
267
|
-
flags: [
|
|
268
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
269
|
-
{ name: "property-name", type: "string", required: true, desc: "Property technical name." },
|
|
270
|
-
{ name: "property-scope", type: "string", required: true, desc: "Property owner table, for example event or user." },
|
|
271
|
-
{ name: "data-table-id", type: "number", required: true, desc: "Existing dimension data table ID." },
|
|
272
|
-
{ name: "timestamp-join-format", type: "string", required: false, desc: "Optional timestamp join format." },
|
|
273
|
-
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array. String entries are normalized to column_name objects." }
|
|
274
|
-
],
|
|
275
|
-
risk: "write",
|
|
276
|
-
buildInput: (ctx) => {
|
|
277
|
-
const dictColumns = optionalJson(ctx, "dict-columns");
|
|
278
|
-
return {
|
|
279
|
-
project_id: ctx.num("project-id"),
|
|
280
|
-
property_name: ctx.str("property-name"),
|
|
281
|
-
property_scope: ctx.str("property-scope"),
|
|
282
|
-
data_table_id: ctx.num("data-table-id"),
|
|
283
|
-
timestamp_join_format: optionalString(ctx, "timestamp-join-format"),
|
|
284
|
-
dict_columns: Array.isArray(dictColumns) ? dictColumns.map((column) => typeof column === "string" ? { column_name: column } : column) : dictColumns
|
|
285
|
-
};
|
|
286
|
-
}
|
|
287
|
-
});
|
|
288
|
-
|
|
289
|
-
// src/commands/metadata/property/dimension-table/create-and-bind-csv.ts
|
|
290
|
-
var propertyDimensionTableCreateAndBindCsv = createCapabilityCommand2({
|
|
291
|
-
resource: "property",
|
|
292
|
-
command: "create-and-bind-csv-dimension-table",
|
|
293
|
-
capabilityId: "metadata.property.create_and_bind_csv_dimension_table",
|
|
294
|
-
description: "Create a CSV-backed dimension data table and bind it to a metadata property.",
|
|
295
|
-
flags: [
|
|
296
|
-
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
297
|
-
{ name: "property-name", type: "string", required: true, desc: "Property technical name." },
|
|
298
|
-
{ name: "property-scope", type: "string", required: true, desc: "Property owner table, for example event or user." },
|
|
299
|
-
{ name: "input-file-id", type: "string", required: true, desc: "Uploaded input file ID, for example ifile_<32 lowercase hex>." },
|
|
300
|
-
{ name: "data-table-name", type: "string", required: false, desc: "Optional technical data table name. If supplied, use datatable_<project_id>_<name>." },
|
|
301
|
-
{ name: "display-name", type: "string", required: false, desc: "Human-readable data table name." },
|
|
302
|
-
{ name: "description", type: "string", required: false, desc: "Data table description." },
|
|
303
|
-
{ name: "columns", type: "json", required: false, desc: "Column definitions JSON array. Use column_name/select_type/column_desc, or name/type/display_name aliases." },
|
|
304
|
-
{ name: "timestamp-join-format", type: "string", required: false, desc: "Optional timestamp join format." },
|
|
305
|
-
{ name: "dict-columns", type: "json", required: false, desc: "Optional dictionary column names JSON array." }
|
|
306
|
-
],
|
|
307
|
-
risk: "write",
|
|
308
|
-
buildInput: (ctx) => ({
|
|
309
|
-
project_id: ctx.num("project-id"),
|
|
310
|
-
property_name: ctx.str("property-name"),
|
|
311
|
-
property_scope: ctx.str("property-scope"),
|
|
312
|
-
input_file_id: ctx.str("input-file-id"),
|
|
313
|
-
data_table_name: optionalString(ctx, "data-table-name"),
|
|
314
|
-
display_name: optionalString(ctx, "display-name"),
|
|
315
|
-
description: optionalString(ctx, "description"),
|
|
316
|
-
columns: optionalDataTableColumns(ctx, "columns", "csv"),
|
|
317
|
-
timestamp_join_format: optionalString(ctx, "timestamp-join-format"),
|
|
318
|
-
dict_columns: optionalJson(ctx, "dict-columns")
|
|
319
|
-
})
|
|
320
|
-
});
|
|
321
|
-
|
|
322
|
-
// src/commands/metadata/index.ts
|
|
323
|
-
registerCapabilityGatewayRoute("metadata", { gatewayDomain: "analysis" });
|
|
324
|
-
var commands = [
|
|
325
|
-
dataTableList,
|
|
326
|
-
dataTableGet,
|
|
327
|
-
dataTableCsvWrite,
|
|
328
|
-
dataTableSqlWrite,
|
|
329
|
-
dataTableCsvDelete,
|
|
330
|
-
dataTableSqlDelete,
|
|
331
|
-
dataTableDownload,
|
|
332
|
-
dataTablePropertyBindingsUpdate,
|
|
333
|
-
propertyDimensionTableBindExisting,
|
|
334
|
-
propertyDimensionTableCreateAndBindCsv
|
|
335
|
-
];
|
|
336
|
-
var metadata_default = commands;
|
|
337
|
-
export {
|
|
338
|
-
metadata_default as default
|
|
339
|
-
};
|
package/dist/model-K3KLWIW6.js
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCurrentWorkspace
|
|
3
|
-
} from "./chunk-DWO43OIB.js";
|
|
4
|
-
import {
|
|
5
|
-
MultiselectCancelled,
|
|
6
|
-
promptSingleCheckboxSelect
|
|
7
|
-
} from "./chunk-TUKQZTMI.js";
|
|
8
|
-
import {
|
|
9
|
-
TeAgentApiError,
|
|
10
|
-
TeAgentCredentialsError,
|
|
11
|
-
getClaudeConfigDir,
|
|
12
|
-
getSandboxModels,
|
|
13
|
-
postSandboxModelSelection
|
|
14
|
-
} from "./chunk-UOUS37JQ.js";
|
|
15
|
-
import "./chunk-C4MGVGJW.js";
|
|
16
|
-
import "./chunk-4SGZG4XY.js";
|
|
17
|
-
import "./chunk-ZZUOD757.js";
|
|
18
|
-
import "./chunk-UW5UN47B.js";
|
|
19
|
-
import "./chunk-LYVNONC4.js";
|
|
20
|
-
import "./chunk-QGM4M3NI.js";
|
|
21
|
-
|
|
22
|
-
// src/commands/model/index.ts
|
|
23
|
-
import { existsSync, readFileSync } from "fs";
|
|
24
|
-
import { join } from "path";
|
|
25
|
-
function readCurrentModelSelection() {
|
|
26
|
-
const settingsPath = join(getClaudeConfigDir(), "settings.json");
|
|
27
|
-
if (!existsSync(settingsPath)) return { routingModelId: null, providerModelId: null };
|
|
28
|
-
try {
|
|
29
|
-
const raw = readFileSync(settingsPath, "utf8");
|
|
30
|
-
const parsed = JSON.parse(raw);
|
|
31
|
-
if (!parsed || typeof parsed !== "object") {
|
|
32
|
-
return { routingModelId: null, providerModelId: null };
|
|
33
|
-
}
|
|
34
|
-
const env = parsed.env && typeof parsed.env === "object" ? parsed.env : {};
|
|
35
|
-
const headers = typeof env.ANTHROPIC_CUSTOM_HEADERS === "string" ? env.ANTHROPIC_CUSTOM_HEADERS : void 0;
|
|
36
|
-
const routingModelId = extractModelIdHeader(headers);
|
|
37
|
-
const providerModelId = typeof parsed.model === "string" && parsed.model ? parsed.model : typeof env.ANTHROPIC_MODEL === "string" && env.ANTHROPIC_MODEL ? env.ANTHROPIC_MODEL : null;
|
|
38
|
-
return { routingModelId, providerModelId };
|
|
39
|
-
} catch {
|
|
40
|
-
return { routingModelId: null, providerModelId: null };
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
function extractModelIdHeader(headers) {
|
|
44
|
-
if (!headers) return null;
|
|
45
|
-
for (const line of headers.split(/\r?\n/)) {
|
|
46
|
-
const match = line.match(/^\s*model-id\s*:\s*(.+?)\s*$/);
|
|
47
|
-
if (match?.[1]) {
|
|
48
|
-
return match[1];
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
function isCurrentModel(model, current) {
|
|
54
|
-
if (current.routingModelId) return model.id === current.routingModelId;
|
|
55
|
-
return model.scope === "system" && Boolean(current.providerModelId) && model.modelId === current.providerModelId;
|
|
56
|
-
}
|
|
57
|
-
async function runModelPicker() {
|
|
58
|
-
const current = readCurrentModelSelection();
|
|
59
|
-
const models = await getSandboxModels();
|
|
60
|
-
if (models.length === 0) {
|
|
61
|
-
process.stderr.write("No models visible to the current user\n");
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
const sorted = models.slice().sort((a, b) => {
|
|
65
|
-
const scopeOrder = {
|
|
66
|
-
system: 0,
|
|
67
|
-
company: 1,
|
|
68
|
-
personal: 2
|
|
69
|
-
};
|
|
70
|
-
const scopeDiff = scopeOrder[a.scope] - scopeOrder[b.scope];
|
|
71
|
-
return scopeDiff !== 0 ? scopeDiff : a.name.localeCompare(b.name);
|
|
72
|
-
});
|
|
73
|
-
const picked = await promptSingleCheckboxSelect({
|
|
74
|
-
title: "Select a model to use",
|
|
75
|
-
items: sorted.map((model) => {
|
|
76
|
-
const isCurrent = isCurrentModel(model, current);
|
|
77
|
-
return {
|
|
78
|
-
value: model,
|
|
79
|
-
label: `${model.name} ${model.scope}`,
|
|
80
|
-
hint: isCurrent ? "(current)" : void 0,
|
|
81
|
-
preselected: isCurrent
|
|
82
|
-
};
|
|
83
|
-
})
|
|
84
|
-
});
|
|
85
|
-
const workspace = getCurrentWorkspace();
|
|
86
|
-
if (!workspace) {
|
|
87
|
-
process.stderr.write("Please run ae-cli model from within a te-agent workspace directory\n");
|
|
88
|
-
process.exitCode = 1;
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
|
-
if (isCurrentModel(picked, current)) {
|
|
92
|
-
process.stdout.write("This model is already active\n");
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
await postSandboxModelSelection({
|
|
96
|
-
workspacePath: workspace.name,
|
|
97
|
-
modelId: picked.id
|
|
98
|
-
});
|
|
99
|
-
process.stdout.write(`Switched to ${picked.name}
|
|
100
|
-
`);
|
|
101
|
-
}
|
|
102
|
-
function registerModel(program) {
|
|
103
|
-
program.command("model").description("Choose and switch the current workspace model (te-agent sandbox only)").action(async () => {
|
|
104
|
-
try {
|
|
105
|
-
await runModelPicker();
|
|
106
|
-
} catch (err) {
|
|
107
|
-
handleError(err);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
function handleError(err) {
|
|
112
|
-
if (err instanceof MultiselectCancelled) {
|
|
113
|
-
process.stderr.write("Cancelled\n");
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (err instanceof TeAgentCredentialsError) {
|
|
117
|
-
process.stderr.write(`\u2717 ${err.message}
|
|
118
|
-
`);
|
|
119
|
-
if (err.hint) process.stderr.write(` ${err.hint}
|
|
120
|
-
`);
|
|
121
|
-
process.exitCode = 1;
|
|
122
|
-
return;
|
|
123
|
-
}
|
|
124
|
-
if (err instanceof TeAgentApiError) {
|
|
125
|
-
process.stderr.write(`\u2717 Main app error (${err.status}${err.code ? " " + err.code : ""}): ${err.message}
|
|
126
|
-
`);
|
|
127
|
-
process.exitCode = 1;
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const msg = err instanceof Error ? err.message : String(err);
|
|
131
|
-
process.stderr.write(`\u2717 ${msg}
|
|
132
|
-
`);
|
|
133
|
-
process.exitCode = 1;
|
|
134
|
-
}
|
|
135
|
-
export {
|
|
136
|
-
extractModelIdHeader,
|
|
137
|
-
readCurrentModelSelection,
|
|
138
|
-
registerModel
|
|
139
|
-
};
|