@thinkingai/ae-cli 6.1.27 → 6.1.29
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 +52 -6
- package/README.zh.md +52 -6
- package/bin/ae-cli.js +5 -0
- package/bin/runtime-capabilities.json +5 -0
- package/cli-installation-guide.md +24 -3
- package/dist/{auth-WA7YGGRT.js → auth-OBQ5KVQM.js} +175 -45
- package/dist/{automation-VAAQBM7Y.js → automation-NAR5DDGL.js} +94 -38
- package/dist/{capability-GAAYJ3IQ.js → capability-LFSVNI5B.js} +57 -28
- package/dist/chunk-2UW3Y463.js +2289 -0
- package/dist/{chunk-VZZNLV3I.js → chunk-3SDHJOCR.js} +68 -18
- package/dist/chunk-6HAUVWOQ.js +132 -0
- package/dist/{chunk-5XJYLEVC.js → chunk-72NJKS7O.js} +4 -4
- package/dist/{chunk-Q5US7JC5.js → chunk-7JAVT5TK.js} +3 -3
- package/dist/{chunk-7KU2WNQE.js → chunk-CVCTFLSO.js} +37 -15
- package/dist/{chunk-GHXZK54S.js → chunk-H3K5UGYC.js} +41 -13
- package/dist/{chunk-OP44TT4H.js → chunk-IN7KKL6K.js} +4 -2
- package/dist/{chunk-S6M42KND.js → chunk-JEUXDY3B.js} +1 -1
- package/dist/{chunk-ZL7SGNIA.js → chunk-JNVVJ273.js} +58 -46
- package/dist/chunk-N6XBLRB7.js +105 -0
- package/dist/{chunk-AP7YP2NX.js → chunk-OAWPT7VP.js} +2 -2
- package/dist/{chunk-AQJPNWZF.js → chunk-PWXDWMCW.js} +7 -7
- package/dist/{chunk-CT7QDJS6.js → chunk-QVRIDN42.js} +2 -2
- package/dist/chunk-QZLRHGVH.js +222 -0
- package/dist/{chunk-RPBOAQQQ.js → chunk-QZUVLFNR.js} +1 -1
- package/dist/{chunk-3YVEAZUN.js → chunk-RJHGDWSC.js} +32 -21
- package/dist/{chunk-MWIA43UJ.js → chunk-VCZE3IWO.js} +10 -8
- package/dist/chunk-YVG6QD3V.js +233 -0
- package/dist/{chunk-WNGFSIOB.js → chunk-Z3Q2AEIN.js} +237 -86
- package/dist/{community-report-client-PEERQCX2.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-CII6B74E.js +32 -0
- package/dist/{config-JOD5DOPE.js → config-YZ6O2UQ2.js} +40 -7
- package/dist/{context-NGVFPCBK.js → context-F6FCGTF3.js} +4 -4
- package/dist/{data-integration-BCLQFTGU.js → data-integration-6UAZO4GG.js} +207 -24
- package/dist/evaluation-4LO2O4AF.js +3714 -0
- package/dist/index.js +352 -81
- package/dist/{local-data-upload-client-TWMHFLUA.js → local-data-upload-client-KCMG6J62.js} +1 -1
- package/dist/{memory-CQKH2JAV.js → memory-HHPX3NF2.js} +6 -6
- package/dist/{metadata-NR3PHR23.js → metadata-TIFY24LW.js} +17 -9
- package/dist/{model-VX5M2CJ6.js → model-7UHGWYVR.js} +4 -4
- package/dist/{personal-semantic-preference-2RAI36P3.js → personal-semantic-preference-WKJEGPTM.js} +7 -6
- package/dist/{project-semantic-3BUGP3ZM.js → project-semantic-EIQVZNHW.js} +11 -10
- package/dist/{sync-RZIAV37C.js → sync-RV3OPCTI.js} +8 -7
- package/dist/{te-agent-AORRE2FM.js → te-agent-5ENVZJUH.js} +757 -94
- package/dist/{te-analysis-GP7DSQ7Q.js → te-analysis-USIK6ZZG.js} +584 -100
- package/dist/{te-community-42M7ICDO.js → te-community-WE2UU4XV.js} +722 -228
- package/dist/{te-dataops-BNKNZ4F2.js → te-dataops-XNMO7MBF.js} +9 -6
- package/dist/{te-engage-2CO6LRCX.js → te-engage-6C3HCFQR.js} +13 -12
- package/dist/{te-experiment-652CLXMU.js → te-experiment-LVTRI3QK.js} +55 -21
- package/dist/{te-kb-ULATOTQ3.js → te-kb-TUPGMVBY.js} +409 -85
- package/dist/{te-system-UGHVKBVV.js → te-system-YM657FKO.js} +6 -6
- package/dist/{te-team-YA6SNOJ3.js → te-team-G4VEJJNL.js} +64 -41
- package/dist/{things-DTCOQIQB.js → things-22KQWC23.js} +7 -7
- package/dist/{update-ESNYKUVR.js → update-XX4ILU7X.js} +11 -7
- package/dist/{workspace-JEOHKFPX.js → workspace-LYDAP647.js} +6 -6
- package/package.json +26 -11
- package/skills/ae-agent/SKILL.md +22 -3
- package/skills/ae-agent/references/command_index.md +8 -0
- package/skills/ae-agent/references/resource-package.md +57 -0
- package/skills/ae-analysis/SKILL.md +23 -10
- package/skills/ae-analysis/references/adhoc_export.md +1 -1
- package/skills/ae-analysis/references/agent_review_preflight.md +55 -10
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +60 -24
- package/skills/ae-analysis/references/ai_models/event.md +58 -2
- package/skills/ae-analysis/references/ai_models/rank_list.md +1 -0
- package/skills/ae-analysis/references/ai_models/retention.md +2 -0
- package/skills/ae-analysis/references/ai_models/revenue.md +2 -0
- package/skills/ae-analysis/references/analysis_data_export.md +11 -1
- package/skills/ae-analysis/references/asset_batch_info_export.md +2 -2
- package/skills/ae-analysis/references/asset_batch_sql_export.md +2 -2
- package/skills/ae-analysis/references/asset_export.md +1 -1
- package/skills/ae-analysis/references/bi_panel_page_data_export.md +1 -1
- package/skills/ae-analysis/references/check_export.md +1 -1
- package/skills/ae-analysis/references/command_index.md +39 -26
- package/skills/ae-analysis/references/dashboard_report_data_export.md +2 -0
- package/skills/ae-analysis/references/dashboard_report_get.md +6 -2
- package/skills/ae-analysis/references/dashboard_report_update.md +24 -5
- package/skills/ae-analysis/references/feedback_submit.md +1 -1
- package/skills/ae-analysis/references/governance_recommendation_export.md +40 -18
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
- package/skills/ae-analysis/references/live_data_export.md +1 -1
- package/skills/ae-analysis/references/metric_create.md +29 -0
- package/skills/ae-analysis/references/metric_get.md +2 -0
- package/skills/ae-analysis/references/metric_update.md +2 -0
- package/skills/ae-analysis/references/operation_record_export.md +1 -1
- package/skills/ae-analysis/references/plan_change_log_export.md +1 -1
- package/skills/ae-analysis/references/plan_export.md +1 -1
- package/skills/ae-analysis/references/project_info_get.md +4 -0
- package/skills/ae-analysis/references/project_member_group_add_members.md +35 -0
- package/skills/ae-analysis/references/project_member_group_create.md +25 -0
- package/skills/ae-analysis/references/project_member_group_delete.md +34 -0
- package/skills/ae-analysis/references/project_member_group_list.md +29 -0
- package/skills/ae-analysis/references/project_member_group_members.md +28 -0
- package/skills/ae-analysis/references/project_member_group_remove_members.md +35 -0
- package/skills/ae-analysis/references/project_member_group_rename.md +26 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +6 -1
- package/skills/ae-analysis/references/report_data_export.md +1 -1
- package/skills/ae-analysis/references/scenario_append.md +31 -0
- package/skills/ae-analysis/references/scenario_begin.md +11 -0
- package/skills/ae-analysis/references/scenario_collect.md +43 -0
- package/skills/ae-analysis/references/scenario_evaluation.md +18 -0
- 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/build-project-semantic-wiki.mjs +73 -4
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +5 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/execution-contract.mjs +173 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/generate-build-ir.mjs +109 -64
- package/skills/ae-automation/SKILL.md +2 -2
- package/skills/ae-automation/references/cli.md +18 -1
- package/skills/ae-capability/SKILL.md +7 -3
- 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-evaluation/SKILL.md +83 -0
- package/skills/ae-evaluation/references/access-and-members.md +55 -0
- package/skills/ae-evaluation/references/connections.md +78 -0
- package/skills/ae-evaluation/references/datasets.md +57 -0
- package/skills/ae-evaluation/references/evaluators.md +81 -0
- package/skills/ae-evaluation/references/files.md +33 -0
- package/skills/ae-evaluation/references/integrations.md +39 -0
- package/skills/ae-evaluation/references/runs.md +160 -0
- package/skills/ae-evaluation/references/schedules.md +31 -0
- 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 +33 -7
- package/skills/ae-kb/references/publication.md +81 -0
- package/skills/ae-kb/references/query-workflow.md +14 -1
- package/skills/ae-metadata/SKILL.md +3 -2
- package/skills/ae-metadata/references/metadata_data_table_download.md +7 -1
- package/skills/ae-metadata/references/metadata_data_table_get.md +37 -0
- package/skills/ae-system/SKILL.md +1 -1
- package/skills/ae-team/SKILL.md +2 -2
- package/skills/ae-team/references/run-start.md +1 -0
- package/skills/ae-team/references/run-watch.md +7 -5
- package/skills/ae-things/SKILL.md +53 -51
- package/skills/ae-things/references/cli.md +56 -54
- package/skills/ae-things-progress/SKILL.md +20 -20
- package/skills/ae-things-review/SKILL.md +19 -19
- package/skills/ae-workspace/SKILL.md +1 -1
- package/dist/chunk-6VNIR4AP.js +0 -1422
- package/dist/chunk-CI24BDR2.js +0 -43
|
@@ -1,15 +1,22 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
resolveWorkspaceTarget
|
|
4
|
+
} from "./chunk-7JAVT5TK.js";
|
|
5
|
+
import {
|
|
6
|
+
currentAgentSpaceId
|
|
7
|
+
} from "./chunk-RK6GLDGI.js";
|
|
8
|
+
import "./chunk-N6XBLRB7.js";
|
|
2
9
|
import {
|
|
3
10
|
TeAgentApiError,
|
|
4
11
|
deleteFromMainApp,
|
|
5
12
|
getFromMainApp,
|
|
6
13
|
patchToMainApp,
|
|
7
14
|
postToMainApp
|
|
8
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-RJHGDWSC.js";
|
|
9
16
|
import "./chunk-Y74WTIKJ.js";
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
17
|
+
import "./chunk-H3K5UGYC.js";
|
|
18
|
+
import "./chunk-JNVVJ273.js";
|
|
19
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
13
20
|
|
|
14
21
|
// src/commands/automation/index.ts
|
|
15
22
|
import { randomUUID } from "crypto";
|
|
@@ -24,7 +31,7 @@ var typeFlag = flag(
|
|
|
24
31
|
);
|
|
25
32
|
var scopeFlag = flag(
|
|
26
33
|
"agent-space-id",
|
|
27
|
-
"Explicit space; otherwise
|
|
34
|
+
"Explicit space; otherwise current AgentSpace, then personal space"
|
|
28
35
|
);
|
|
29
36
|
var runFlag = flag(
|
|
30
37
|
"run-id",
|
|
@@ -62,7 +69,21 @@ var configFlags = [
|
|
|
62
69
|
flag("time", "HH:mm in server timezone"),
|
|
63
70
|
flag("minute", "Hourly minute, 0-59", "number"),
|
|
64
71
|
flag("weekday", "Weekly day, 0=Sunday through 6=Saturday", "number"),
|
|
65
|
-
flag(
|
|
72
|
+
flag(
|
|
73
|
+
"weekdays",
|
|
74
|
+
"Weekly days as JSON array, 0=Sunday through 6=Saturday",
|
|
75
|
+
"json"
|
|
76
|
+
),
|
|
77
|
+
flag(
|
|
78
|
+
"day-of-month",
|
|
79
|
+
"Monthly day, 1-31; missing dates are skipped",
|
|
80
|
+
"number"
|
|
81
|
+
),
|
|
82
|
+
flag(
|
|
83
|
+
"days-of-month",
|
|
84
|
+
'Monthly days as JSON array: integers 1-31 or "L" for last day; missing dates are skipped',
|
|
85
|
+
"json"
|
|
86
|
+
),
|
|
66
87
|
flag("model", "Agent model configuration ID; null clears the override"),
|
|
67
88
|
flag("reuse-conversation", "Agent: true | false", "json"),
|
|
68
89
|
{
|
|
@@ -71,12 +92,12 @@ var configFlags = [
|
|
|
71
92
|
},
|
|
72
93
|
flag(
|
|
73
94
|
"channels",
|
|
74
|
-
"Team notification channel array; [] clears
|
|
95
|
+
"Agent or Team notification channel array; [] clears external notifications",
|
|
75
96
|
"json"
|
|
76
97
|
),
|
|
77
|
-
flag("feishu-chat-id", "
|
|
78
|
-
flag("lark-chat-id", "
|
|
79
|
-
flag("slack-channel-id", "
|
|
98
|
+
flag("feishu-chat-id", "Feishu destination; null clears it"),
|
|
99
|
+
flag("lark-chat-id", "Lark destination; null clears it"),
|
|
100
|
+
flag("slack-channel-id", "Slack destination; null clears it"),
|
|
80
101
|
flag(
|
|
81
102
|
"save-to-knowledge-base-id",
|
|
82
103
|
"Team output knowledge base ID; null clears it"
|
|
@@ -133,11 +154,33 @@ function configuration(ctx, create) {
|
|
|
133
154
|
const kind = ctx.str("scheduleKind"), cron = ctx.str("cronExpression");
|
|
134
155
|
enumValue(kind, ["hourly", "daily", "weekly", "monthly"], "schedule-kind");
|
|
135
156
|
if (kind && cron) throw new Error("Use --schedule-kind or --cron-expression");
|
|
136
|
-
if (!kind && ["time", "minute", "weekday", "dayOfMonth"].some(
|
|
157
|
+
if (!kind && (["time", "minute", "weekday", "dayOfMonth"].some(
|
|
158
|
+
(name2) => ctx.str(name2)
|
|
159
|
+
) || ctx.json("weekdays") !== void 0 || ctx.json("daysOfMonth") !== void 0))
|
|
137
160
|
throw new Error("Schedule details require --schedule-kind");
|
|
138
|
-
if (kind && ctx.str("weekday") && kind !== "weekly" || kind && ctx.str("dayOfMonth") && kind !== "monthly" || kind && ctx.str("minute") && kind !== "hourly")
|
|
161
|
+
if (kind && (ctx.str("weekday") || ctx.json("weekdays") !== void 0) && kind !== "weekly" || kind && (ctx.str("dayOfMonth") || ctx.json("daysOfMonth") !== void 0) && kind !== "monthly" || kind && ctx.str("minute") && kind !== "hourly")
|
|
139
162
|
throw new Error("Schedule field is not applicable to this frequency");
|
|
140
163
|
if (kind) {
|
|
164
|
+
const dateSelection = (single, multiple, min, max, label, allowLastDay = false) => {
|
|
165
|
+
const values = ctx.json(multiple);
|
|
166
|
+
if (values === void 0)
|
|
167
|
+
return {
|
|
168
|
+
[single]: range(ctx.optionalNum(single) ?? NaN, min, max, label)
|
|
169
|
+
};
|
|
170
|
+
if (ctx.optionalNum(single) !== void 0)
|
|
171
|
+
throw new Error(`Use --${label} or its plural array, not both`);
|
|
172
|
+
if (!Array.isArray(values) || !values.length || values.length > max - min + 1 + Number(allowLastDay) || values.some(
|
|
173
|
+
(value) => !(allowLastDay && value === "L") && (!Number.isInteger(value) || value < min || value > max)
|
|
174
|
+
))
|
|
175
|
+
throw new Error(
|
|
176
|
+
`${multiple} must be a non-empty JSON array of integers from ${min} to ${max}${allowLastDay ? ' or "L" for last day' : ""}`
|
|
177
|
+
);
|
|
178
|
+
return {
|
|
179
|
+
[multiple]: [...new Set(values)].sort(
|
|
180
|
+
(a, b) => (a === "L" ? 32 : a) - (b === "L" ? 32 : b)
|
|
181
|
+
)
|
|
182
|
+
};
|
|
183
|
+
};
|
|
141
184
|
const schedule = { kind };
|
|
142
185
|
if (kind === "hourly")
|
|
143
186
|
schedule.minute = range(ctx.optionalNum("minute") ?? 0, 0, 59, "minute");
|
|
@@ -146,18 +189,21 @@ function configuration(ctx, create) {
|
|
|
146
189
|
throw new Error("--time must use HH:mm");
|
|
147
190
|
schedule.time = ctx.str("time");
|
|
148
191
|
if (kind === "weekly")
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
0,
|
|
152
|
-
6,
|
|
153
|
-
"weekday"
|
|
192
|
+
Object.assign(
|
|
193
|
+
schedule,
|
|
194
|
+
dateSelection("weekday", "weekdays", 0, 6, "weekday")
|
|
154
195
|
);
|
|
155
196
|
if (kind === "monthly")
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
197
|
+
Object.assign(
|
|
198
|
+
schedule,
|
|
199
|
+
dateSelection(
|
|
200
|
+
"dayOfMonth",
|
|
201
|
+
"daysOfMonth",
|
|
202
|
+
1,
|
|
203
|
+
31,
|
|
204
|
+
"day-of-month",
|
|
205
|
+
true
|
|
206
|
+
)
|
|
161
207
|
);
|
|
162
208
|
}
|
|
163
209
|
result.schedule = schedule;
|
|
@@ -165,8 +211,11 @@ function configuration(ctx, create) {
|
|
|
165
211
|
if (cron) {
|
|
166
212
|
const parts = cron.trim().split(/\s+/);
|
|
167
213
|
const validNumber = (v, a, b) => /^\d+$/.test(v) && Number(v) >= a && Number(v) <= b;
|
|
214
|
+
const validDays = (v, a, b, allowLastDay = false) => v.split(",").length <= b - a + 1 + Number(allowLastDay) && v.split(",").every(
|
|
215
|
+
(day) => allowLastDay && day === "L" || validNumber(day, a, b)
|
|
216
|
+
);
|
|
168
217
|
const [m, h, d, mo, w] = parts;
|
|
169
|
-
if (parts.length !== 5 || !validNumber(m, 0, 59) || !(h === "*" || validNumber(h, 0, 23)) || mo !== "*" || !(d === "*" ||
|
|
218
|
+
if (parts.length !== 5 || !validNumber(m, 0, 59) || !(h === "*" || validNumber(h, 0, 23)) || mo !== "*" || !(d === "*" || validDays(d, 1, 31, true)) || !(w === "*" || validDays(w, 0, 6)) || d !== "*" && w !== "*" || h === "*" && (d !== "*" || w !== "*"))
|
|
170
219
|
throw new Error(
|
|
171
220
|
"--cron-expression must specify an hourly, daily, weekly or monthly schedule"
|
|
172
221
|
);
|
|
@@ -175,19 +224,18 @@ function configuration(ctx, create) {
|
|
|
175
224
|
if (create && (ctx.str("triggerType") || "scheduled") === "scheduled" && !kind && !cron)
|
|
176
225
|
throw new Error("Scheduled automation requires a schedule");
|
|
177
226
|
const agentNames = ["model", "reuseConversation"];
|
|
178
|
-
const teamNames = [
|
|
179
|
-
|
|
227
|
+
const teamNames = ["scope", "saveToKnowledgeBaseId"];
|
|
228
|
+
const notificationNames = [
|
|
180
229
|
"channels",
|
|
181
230
|
"feishuChatId",
|
|
182
231
|
"larkChatId",
|
|
183
|
-
"slackChannelId"
|
|
184
|
-
"saveToKnowledgeBaseId"
|
|
232
|
+
"slackChannelId"
|
|
185
233
|
];
|
|
186
|
-
for (const name2 of [...agentNames, ...teamNames]) {
|
|
234
|
+
for (const name2 of [...agentNames, ...teamNames, ...notificationNames]) {
|
|
187
235
|
const json = ["scope", "channels", "reuseConversation"].includes(name2);
|
|
188
236
|
const value = json ? ctx.json(name2) : ctx.str(name2) || void 0;
|
|
189
237
|
if (value === void 0) continue;
|
|
190
|
-
if ((agentNames.includes(name2) ? "agent" : "team") !== targetType)
|
|
238
|
+
if (!notificationNames.includes(name2) && (agentNames.includes(name2) ? "agent" : "team") !== targetType)
|
|
191
239
|
throw new Error(`${name2} is not applicable to ${targetType} automations`);
|
|
192
240
|
if (name2 === "reuseConversation" && typeof value !== "boolean")
|
|
193
241
|
throw new Error("--reuse-conversation must be true or false");
|
|
@@ -217,9 +265,13 @@ function configuration(ctx, create) {
|
|
|
217
265
|
if (create) result.triggerImmediately = ctx.bool("triggerImmediately");
|
|
218
266
|
return result;
|
|
219
267
|
}
|
|
220
|
-
function query(ctx, list = false, typed = false) {
|
|
268
|
+
async function query(ctx, list = false, typed = false) {
|
|
221
269
|
const p = new URLSearchParams();
|
|
222
|
-
|
|
270
|
+
let spaceId = ctx.str("agentSpaceId").trim() || currentAgentSpaceId();
|
|
271
|
+
if (!spaceId && process.env.TE_AGENT_CONVERSATION_ID?.trim()) {
|
|
272
|
+
spaceId = (await resolveWorkspaceTarget(ctx)).agentSpaceId;
|
|
273
|
+
}
|
|
274
|
+
if (spaceId) p.set("agentSpaceId", spaceId);
|
|
223
275
|
if (typed && ctx.str("targetType"))
|
|
224
276
|
p.set("targetType", ctx.str("targetType"));
|
|
225
277
|
if (list) {
|
|
@@ -232,23 +284,27 @@ async function request(ctx, method, path, body) {
|
|
|
232
284
|
if (method === "GET")
|
|
233
285
|
return getFromMainApp(
|
|
234
286
|
path,
|
|
235
|
-
ctx.hostOverride ? ctx.hostOverride() : ctx.host()
|
|
287
|
+
ctx.hostOverride ? ctx.hostOverride() : ctx.host(),
|
|
288
|
+
"cli-token"
|
|
236
289
|
);
|
|
237
290
|
if (method === "POST")
|
|
238
291
|
return postToMainApp(
|
|
239
292
|
path,
|
|
240
293
|
body,
|
|
241
|
-
ctx.hostOverride ? ctx.hostOverride() : ctx.host()
|
|
294
|
+
ctx.hostOverride ? ctx.hostOverride() : ctx.host(),
|
|
295
|
+
"cli-token"
|
|
242
296
|
);
|
|
243
297
|
if (method === "PATCH")
|
|
244
298
|
return patchToMainApp(
|
|
245
299
|
path,
|
|
246
300
|
body,
|
|
247
|
-
ctx.hostOverride ? ctx.hostOverride() : ctx.host()
|
|
301
|
+
ctx.hostOverride ? ctx.hostOverride() : ctx.host(),
|
|
302
|
+
"cli-token"
|
|
248
303
|
);
|
|
249
304
|
return deleteFromMainApp(
|
|
250
305
|
path,
|
|
251
|
-
ctx.hostOverride ? ctx.hostOverride() : ctx.host()
|
|
306
|
+
ctx.hostOverride ? ctx.hostOverride() : ctx.host(),
|
|
307
|
+
"cli-token"
|
|
252
308
|
);
|
|
253
309
|
}
|
|
254
310
|
function withDryRun(path) {
|
|
@@ -267,7 +323,7 @@ async function waitForRun(ctx, id, runId) {
|
|
|
267
323
|
const result = await request(
|
|
268
324
|
ctx,
|
|
269
325
|
"GET",
|
|
270
|
-
`${base}/${encodeURIComponent(id)}/runs/${encodeURIComponent(runId)}/result${query(ctx)}`
|
|
326
|
+
`${base}/${encodeURIComponent(id)}/runs/${encodeURIComponent(runId)}/result${await query(ctx)}`
|
|
271
327
|
);
|
|
272
328
|
if (result.status !== "running")
|
|
273
329
|
return { ...result, executionCompleted: true, timedOut: false };
|
|
@@ -397,7 +453,7 @@ var automationCommands = actions.map((a) => ({
|
|
|
397
453
|
...body,
|
|
398
454
|
...a.wait ? { commandId } : {}
|
|
399
455
|
};
|
|
400
|
-
const path = base + a.suffix(ctx) + query(ctx, a.list, a.typed);
|
|
456
|
+
const path = base + a.suffix(ctx) + await query(ctx, a.list, a.typed);
|
|
401
457
|
return {
|
|
402
458
|
request: redactedPreview(a.method, path, requestBody),
|
|
403
459
|
validation: await request(ctx, a.method, withDryRun(path), requestBody)
|
|
@@ -410,7 +466,7 @@ var automationCommands = actions.map((a) => ({
|
|
|
410
466
|
output = await request(
|
|
411
467
|
ctx,
|
|
412
468
|
a.method,
|
|
413
|
-
base + a.suffix(ctx) + query(ctx, a.list, a.typed),
|
|
469
|
+
base + a.suffix(ctx) + await query(ctx, a.list, a.typed),
|
|
414
470
|
body && { ...body, ...a.wait ? { commandId } : {} }
|
|
415
471
|
);
|
|
416
472
|
} catch (error) {
|
|
@@ -4,40 +4,47 @@ import {
|
|
|
4
4
|
requiresConfirmation
|
|
5
5
|
} from "./chunk-AMBFK2K3.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
executeCapabilityWithEnvelope,
|
|
10
|
-
inspectCapability,
|
|
11
|
-
inspectCapabilityWithEnvelope,
|
|
12
|
-
listCapabilitiesWithEnvelope,
|
|
13
|
-
validateCapabilityWithEnvelope
|
|
14
|
-
} from "./chunk-VZZNLV3I.js";
|
|
7
|
+
resolveHost
|
|
8
|
+
} from "./chunk-IN7KKL6K.js";
|
|
15
9
|
import {
|
|
16
10
|
findGatewayDomain,
|
|
17
11
|
listCapabilityDiscoveryPrefixes,
|
|
18
12
|
listRegisteredCapabilityDomains,
|
|
19
13
|
resolveGatewayDomain
|
|
20
14
|
} from "./chunk-KPQY44JQ.js";
|
|
21
|
-
import {
|
|
22
|
-
resolveHost
|
|
23
|
-
} from "./chunk-OP44TT4H.js";
|
|
24
15
|
import {
|
|
25
16
|
printError,
|
|
26
17
|
printOutput,
|
|
27
18
|
withOutputMetadata
|
|
28
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-QZLRHGVH.js";
|
|
20
|
+
import {
|
|
21
|
+
CapabilityGatewayError,
|
|
22
|
+
dryRunCapabilityWithEnvelope,
|
|
23
|
+
executeCapabilityWithEnvelope,
|
|
24
|
+
inspectCapability,
|
|
25
|
+
inspectCapabilityWithEnvelope,
|
|
26
|
+
listCapabilitiesWithEnvelope,
|
|
27
|
+
validateCapabilityWithEnvelope
|
|
28
|
+
} from "./chunk-3SDHJOCR.js";
|
|
29
29
|
import "./chunk-Y74WTIKJ.js";
|
|
30
|
+
import {
|
|
31
|
+
assertBusinessEnabled,
|
|
32
|
+
businessForCapability,
|
|
33
|
+
readBusinessConfigForExecution,
|
|
34
|
+
readCurrentBusinessConfig
|
|
35
|
+
} from "./chunk-2UW3Y463.js";
|
|
30
36
|
import {
|
|
31
37
|
CredentialStoreUnreadableError,
|
|
32
38
|
SecureStoreAuthError
|
|
33
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-H3K5UGYC.js";
|
|
34
40
|
import {
|
|
35
|
-
|
|
36
|
-
} from "./chunk-
|
|
41
|
+
parseJsonRequest
|
|
42
|
+
} from "./chunk-JNVVJ273.js";
|
|
37
43
|
import {
|
|
38
44
|
CliValidationError,
|
|
45
|
+
ExternalCliTokenError,
|
|
39
46
|
PermissionError
|
|
40
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
41
48
|
|
|
42
49
|
// src/commands/capability/index.ts
|
|
43
50
|
import * as readline from "readline";
|
|
@@ -81,7 +88,7 @@ function resolveCapabilityGatewayDomain(capabilityId, domainOverride) {
|
|
|
81
88
|
}
|
|
82
89
|
return resolveGatewayDomain(cliDomain, findGatewayDomain(cliDomain) ?? cliDomain);
|
|
83
90
|
}
|
|
84
|
-
function resolveCapabilityListDomain(cliDomain) {
|
|
91
|
+
function resolveCapabilityListDomain(cliDomain, businesses = {}) {
|
|
85
92
|
if (!cliDomain) {
|
|
86
93
|
throw new CapabilityCommandValidationError(
|
|
87
94
|
"Cannot determine the capability domain.",
|
|
@@ -90,7 +97,10 @@ function resolveCapabilityListDomain(cliDomain) {
|
|
|
90
97
|
}
|
|
91
98
|
const gatewayDomain = findGatewayDomain(cliDomain);
|
|
92
99
|
if (gatewayDomain === void 0) {
|
|
93
|
-
const registeredDomains = listRegisteredCapabilityDomains()
|
|
100
|
+
const registeredDomains = listRegisteredCapabilityDomains().filter((domain) => {
|
|
101
|
+
const business = businessForCapability(domain);
|
|
102
|
+
return !business || businesses[business] !== false;
|
|
103
|
+
});
|
|
94
104
|
const registeredHint = registeredDomains.length > 0 ? `Registered domains: ${registeredDomains.join(", ")}.` : "No capability domains are registered in this ae-cli process.";
|
|
95
105
|
throw new CapabilityCommandValidationError(
|
|
96
106
|
`Capability domain '${cliDomain}' is not registered.`,
|
|
@@ -134,10 +144,12 @@ function normalizeCapabilityList(value) {
|
|
|
134
144
|
return item !== null && typeof item === "object" && typeof item.id === "string";
|
|
135
145
|
});
|
|
136
146
|
}
|
|
137
|
-
function filterCapabilities(capabilities, domain, query) {
|
|
147
|
+
function filterCapabilities(capabilities, domain, query, businesses = {}) {
|
|
138
148
|
const prefixes = listCapabilityDiscoveryPrefixes(domain);
|
|
139
149
|
const terms = query?.trim().toLowerCase().split(/\s+/).filter(Boolean) ?? [];
|
|
140
150
|
return capabilities.filter((capability) => {
|
|
151
|
+
const business = businessForCapability(capability.id);
|
|
152
|
+
if (business && businesses[business] === false) return false;
|
|
141
153
|
if (RETIRED_CAPABILITY_REPLACEMENTS[capability.id.toLowerCase()]) {
|
|
142
154
|
return false;
|
|
143
155
|
}
|
|
@@ -160,12 +172,12 @@ function parseCapabilityInput(raw) {
|
|
|
160
172
|
let parsed;
|
|
161
173
|
try {
|
|
162
174
|
if (trimmed === "-") {
|
|
163
|
-
parsed =
|
|
175
|
+
parsed = parseJsonRequest(readFileSync(0, "utf8"));
|
|
164
176
|
} else if (trimmed.startsWith("{") || trimmed.startsWith("[")) {
|
|
165
|
-
parsed =
|
|
177
|
+
parsed = parseJsonRequest(trimmed);
|
|
166
178
|
} else {
|
|
167
179
|
const path = trimmed.startsWith("@") ? trimmed.slice(1) : trimmed;
|
|
168
|
-
parsed =
|
|
180
|
+
parsed = parseJsonRequest(readFileSync(path, "utf8"));
|
|
169
181
|
}
|
|
170
182
|
} catch (error) {
|
|
171
183
|
const message = error instanceof Error ? error.message : String(error);
|
|
@@ -199,11 +211,16 @@ function registerCapability(program) {
|
|
|
199
211
|
});
|
|
200
212
|
capability.command("list").description("List capability summaries in a domain").requiredOption("--domain <domain>", "Capability namespace, such as analysis or metadata").option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (opts) => {
|
|
201
213
|
await executeAndPrint(program, async (host) => {
|
|
202
|
-
const
|
|
214
|
+
const business = businessForCapability(opts.domain);
|
|
215
|
+
const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
|
|
216
|
+
const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
|
|
203
217
|
const projectId = parseOptionalProjectId(opts.projectId);
|
|
218
|
+
if (business && businesses[business] === false) {
|
|
219
|
+
return { domain: opts.domain, count: 0, capabilities: [], warning: `The '${business}' business is not enabled for the current environment.` };
|
|
220
|
+
}
|
|
204
221
|
const envelope = await listCapabilitiesWithEnvelope(host, gatewayDomain, projectId);
|
|
205
222
|
const catalog = normalizeCapabilityList(envelope.data);
|
|
206
|
-
const capabilities = filterCapabilities(catalog, opts.domain);
|
|
223
|
+
const capabilities = filterCapabilities(catalog, opts.domain, void 0, businesses);
|
|
207
224
|
const warning = emptyCapabilityCatalogWarning(catalog);
|
|
208
225
|
return withOutputMetadata({
|
|
209
226
|
domain: opts.domain,
|
|
@@ -221,11 +238,16 @@ function registerCapability(program) {
|
|
|
221
238
|
"Capability namespace. One of: analysis, project, system, tracking, metadata, experiment, engage-flow, engage-task, engage-setting, engage-scene, engage-activity, engage-workbench, community"
|
|
222
239
|
).option("--project-id <project-id>", "Filter by project membership, permissions, and enabled features").action(async (query, opts) => {
|
|
223
240
|
await executeAndPrint(program, async (host) => {
|
|
224
|
-
const
|
|
241
|
+
const business = businessForCapability(opts.domain);
|
|
242
|
+
const businesses = business ? await readBusinessConfigForExecution(host) : readCurrentBusinessConfig(host);
|
|
243
|
+
const gatewayDomain = resolveCapabilityListDomain(opts.domain, businesses);
|
|
225
244
|
const projectId = parseOptionalProjectId(opts.projectId);
|
|
245
|
+
if (business && businesses[business] === false) {
|
|
246
|
+
return { domain: opts.domain, query, count: 0, capabilities: [], warning: `The '${business}' business is not enabled for the current environment.` };
|
|
247
|
+
}
|
|
226
248
|
const envelope = await listCapabilitiesWithEnvelope(host, gatewayDomain, projectId);
|
|
227
249
|
const catalog = normalizeCapabilityList(envelope.data);
|
|
228
|
-
const capabilities = filterCapabilities(catalog, opts.domain, query);
|
|
250
|
+
const capabilities = filterCapabilities(catalog, opts.domain, query, businesses);
|
|
229
251
|
const warning = emptyCapabilityCatalogWarning(catalog);
|
|
230
252
|
return withOutputMetadata({
|
|
231
253
|
domain: opts.domain,
|
|
@@ -242,6 +264,7 @@ function registerCapability(program) {
|
|
|
242
264
|
capability.command("inspect").description("Inspect one capability schema, risk, auth, and output metadata").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--project-id <project-id>", "Check availability in a project before returning metadata").action(async (capabilityId, opts) => {
|
|
243
265
|
await executeAndPrint(program, async (host) => {
|
|
244
266
|
assertCapabilityIsNotRetired(capabilityId);
|
|
267
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
245
268
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
246
269
|
return gatewayOutput(await inspectCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseOptionalProjectId(opts.projectId)), host);
|
|
247
270
|
});
|
|
@@ -254,6 +277,7 @@ function registerCapability(program) {
|
|
|
254
277
|
).argument("<capability-id>", "Capability ID, such as metadata.data_table.sql_write").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
|
|
255
278
|
await executeAndPrint(program, async (host) => {
|
|
256
279
|
assertCapabilityIsNotRetired(capabilityId);
|
|
280
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
257
281
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
258
282
|
return gatewayOutput(await validateCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
|
|
259
283
|
});
|
|
@@ -277,6 +301,7 @@ Examples:
|
|
|
277
301
|
).argument("<capability-id>", "Capability ID, such as analysis.query.export").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
|
|
278
302
|
await executeAndPrint(program, async (host) => {
|
|
279
303
|
assertCapabilityIsNotRetired(capabilityId);
|
|
304
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
280
305
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
281
306
|
return gatewayOutput(await dryRunCapabilityWithEnvelope(host, gatewayDomain, capabilityId, parseCapabilityInput(opts.input)), host);
|
|
282
307
|
});
|
|
@@ -290,6 +315,7 @@ Examples:
|
|
|
290
315
|
capability.command("run").description("Execute one capability by ID").argument("<capability-id>", "Capability ID, such as analysis.report.list").option("--domain <domain>", "Override the capability namespace used for gateway routing").option("--input <json-or-path>", "Input JSON object, file path, @<path>, or - for stdin").action(async (capabilityId, opts) => {
|
|
291
316
|
await executeAndPrint(program, async (host, globalOpts) => {
|
|
292
317
|
assertCapabilityIsNotRetired(capabilityId);
|
|
318
|
+
await assertCapabilityBusinessEnabled(capabilityId, host);
|
|
293
319
|
const gatewayDomain = resolveCapabilityGatewayDomain(capabilityId, opts.domain);
|
|
294
320
|
const input = parseCapabilityInput(opts.input);
|
|
295
321
|
if (globalOpts.validate && globalOpts.dryRun) {
|
|
@@ -325,6 +351,9 @@ Examples:
|
|
|
325
351
|
ae-cli capability run analysis.dashboard.list --input input.json`
|
|
326
352
|
);
|
|
327
353
|
}
|
|
354
|
+
async function assertCapabilityBusinessEnabled(capabilityId, host) {
|
|
355
|
+
await assertBusinessEnabled(businessForCapability(capabilityId), host);
|
|
356
|
+
}
|
|
328
357
|
function gatewayOutput(envelope, host) {
|
|
329
358
|
return withOutputMetadata(withPageUrl(envelope.data, host), envelope.meta);
|
|
330
359
|
}
|
|
@@ -368,7 +397,7 @@ function printCapabilityError(error, host) {
|
|
|
368
397
|
);
|
|
369
398
|
return;
|
|
370
399
|
}
|
|
371
|
-
if (error instanceof CredentialStoreUnreadableError) {
|
|
400
|
+
if (error instanceof CredentialStoreUnreadableError || error instanceof ExternalCliTokenError) {
|
|
372
401
|
printError("config", error.message, error.hint, error.code);
|
|
373
402
|
return;
|
|
374
403
|
}
|
|
@@ -377,7 +406,7 @@ function printCapabilityError(error, host) {
|
|
|
377
406
|
return;
|
|
378
407
|
}
|
|
379
408
|
if (error instanceof PermissionError) {
|
|
380
|
-
printError("permission", error.message,
|
|
409
|
+
printError("permission", error.message, error.hint, error.code);
|
|
381
410
|
return;
|
|
382
411
|
}
|
|
383
412
|
if (error instanceof CapabilityGatewayError) {
|