@thinkingai/ae-cli 6.0.55 → 6.0.57
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 +35 -6
- package/README.zh.md +35 -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-RQBO6MTY.js → auth-YEIJLBFY.js} +61 -19
- package/dist/{automation-VAAQBM7Y.js → automation-NAR5DDGL.js} +94 -38
- package/dist/{capability-JRIFC4AJ.js → capability-P7DD4Q73.js} +50 -21
- package/dist/{chunk-5XJYLEVC.js → chunk-72NJKS7O.js} +4 -4
- package/dist/chunk-752BSLZC.js +222 -0
- package/dist/{chunk-RGYPSEYD.js → chunk-7ABK2PEJ.js} +3 -3
- package/dist/{chunk-Q5US7JC5.js → chunk-7JAVT5TK.js} +3 -3
- package/dist/{chunk-GHXZK54S.js → chunk-H3K5UGYC.js} +41 -13
- package/dist/{chunk-OP44TT4H.js → chunk-IN7KKL6K.js} +4 -2
- package/dist/{chunk-VZZNLV3I.js → chunk-JCWM2TYP.js} +61 -15
- 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-7KU2WNQE.js → chunk-QEMQKVHW.js} +37 -15
- package/dist/{chunk-CT7QDJS6.js → chunk-QVRIDN42.js} +2 -2
- package/dist/{chunk-RPBOAQQQ.js → chunk-QZUVLFNR.js} +1 -1
- package/dist/{chunk-3YVEAZUN.js → chunk-RJHGDWSC.js} +32 -21
- package/dist/{chunk-374V5R6N.js → chunk-TKVVACEJ.js} +6 -4
- package/dist/chunk-TULINOLS.js +2283 -0
- package/dist/chunk-YVG6QD3V.js +233 -0
- package/dist/{chunk-WNGFSIOB.js → chunk-Z3Q2AEIN.js} +237 -86
- package/dist/chunk-ZGIYG473.js +132 -0
- package/dist/{community-report-client-PEERQCX2.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-PMEGUPZU.js +32 -0
- package/dist/{config-SICKWZ2A.js → config-VWVPR4WW.js} +43 -10
- 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 +343 -79
- 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-EMFGUI2W.js → metadata-HEQQEEG3.js} +17 -9
- package/dist/{model-VX5M2CJ6.js → model-7UHGWYVR.js} +4 -4
- package/dist/{personal-semantic-preference-SLWVVYZ4.js → personal-semantic-preference-V4L6ZWR2.js} +7 -6
- package/dist/{project-semantic-DPSZBKQD.js → project-semantic-NKHKJX6M.js} +7 -6
- package/dist/{sync-RZIAV37C.js → sync-ZJMXCRIN.js} +8 -7
- package/dist/{te-agent-AORRE2FM.js → te-agent-WBKIFEQD.js} +757 -94
- package/dist/{te-analysis-ISXKJKRT.js → te-analysis-ADX7RKO4.js} +578 -94
- package/dist/{te-community-42M7ICDO.js → te-community-PREDRXG3.js} +722 -228
- package/dist/{te-dataops-BNKNZ4F2.js → te-dataops-ITWJHO2U.js} +9 -6
- package/dist/{te-engage-BZE3MBKT.js → te-engage-VE2NUH5V.js} +7 -6
- package/dist/{te-kb-ULATOTQ3.js → te-kb-WSMOW7WS.js} +407 -83
- package/dist/{te-system-UGHVKBVV.js → te-system-YM657FKO.js} +6 -6
- package/dist/{te-team-YA6SNOJ3.js → te-team-T2WRLOOD.js} +64 -41
- package/dist/{things-DTCOQIQB.js → things-6QOMFXOG.js} +7 -7
- package/dist/{update-ESNYKUVR.js → update-I4MOUYOX.js} +11 -7
- package/dist/{workspace-JEOHKFPX.js → workspace-LYDAP647.js} +6 -6
- package/package.json +25 -11
- package/skills/ae-agent/SKILL.md +20 -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-kb/SKILL.md +33 -6
- 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-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/dist/chunk-6VNIR4AP.js +0 -1422
- package/dist/chunk-CI24BDR2.js +0 -43
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
canManageGlobalSkills,
|
|
4
|
+
fetchCliConfig,
|
|
5
|
+
getLocalCliPackageInfo,
|
|
6
|
+
isBusinessSkillContextCurrent,
|
|
7
|
+
rememberBusinessConfig,
|
|
8
|
+
reserveBusinessSkillContext,
|
|
9
|
+
syncBusinessSkills
|
|
10
|
+
} from "./chunk-TULINOLS.js";
|
|
11
|
+
import {
|
|
12
|
+
peekCliToken
|
|
13
|
+
} from "./chunk-H3K5UGYC.js";
|
|
14
|
+
import {
|
|
15
|
+
getActiveHost,
|
|
16
|
+
getConfigDir
|
|
17
|
+
} from "./chunk-JNVVJ273.js";
|
|
18
|
+
import {
|
|
19
|
+
normalizeUrl
|
|
20
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
21
|
+
|
|
22
|
+
// src/core/environment-refresh.ts
|
|
23
|
+
import crypto from "crypto";
|
|
24
|
+
import fs from "fs";
|
|
25
|
+
import path from "path";
|
|
26
|
+
function cliTokenFingerprint(token) {
|
|
27
|
+
return crypto.createHash("sha256").update(token).digest("hex");
|
|
28
|
+
}
|
|
29
|
+
function invalidateBusinessSkillSynchronization() {
|
|
30
|
+
if (canManageGlobalSkills()) reserveBusinessSkillContext({});
|
|
31
|
+
}
|
|
32
|
+
async function refreshEnvironmentConfig(host, options = {}) {
|
|
33
|
+
const normalized = normalizeUrl(host);
|
|
34
|
+
const skipped = (reason) => ({
|
|
35
|
+
host: normalized,
|
|
36
|
+
businesses: {},
|
|
37
|
+
source: "unavailable",
|
|
38
|
+
skills: { status: "skipped", reason }
|
|
39
|
+
});
|
|
40
|
+
let token;
|
|
41
|
+
try {
|
|
42
|
+
token = peekCliToken(normalized);
|
|
43
|
+
} catch {
|
|
44
|
+
return skipped("Credentials could not be read. Sign in before refreshing Skills.");
|
|
45
|
+
}
|
|
46
|
+
if (!token) return skipped("Sign in to this environment before refreshing its business configuration.");
|
|
47
|
+
const fingerprint = cliTokenFingerprint(token);
|
|
48
|
+
const localActiveEnvironment = () => {
|
|
49
|
+
try {
|
|
50
|
+
return canManageGlobalSkills() && normalizeUrl(getActiveHost()) === normalized && cliTokenFingerprint(peekCliToken(normalized) ?? "") === fingerprint;
|
|
51
|
+
} catch {
|
|
52
|
+
return false;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
const synchronize = options.synchronizeSkills !== false && localActiveEnvironment();
|
|
56
|
+
const generation = synchronize ? reserveBusinessSkillContext({ host: normalized, tokenFingerprint: fingerprint }) : void 0;
|
|
57
|
+
let config;
|
|
58
|
+
try {
|
|
59
|
+
config = await (options.fetchConfig ?? fetchCliConfig)(normalized, token);
|
|
60
|
+
} catch {
|
|
61
|
+
config = null;
|
|
62
|
+
}
|
|
63
|
+
if (!config) return skipped("CLI configuration is unavailable; existing Skills were preserved.");
|
|
64
|
+
if (generation && !isBusinessSkillContextCurrent({
|
|
65
|
+
host: normalized,
|
|
66
|
+
tokenFingerprint: fingerprint,
|
|
67
|
+
generation,
|
|
68
|
+
isCurrentContext: localActiveEnvironment
|
|
69
|
+
})) {
|
|
70
|
+
return {
|
|
71
|
+
host: normalized,
|
|
72
|
+
businesses: {},
|
|
73
|
+
source: "remote",
|
|
74
|
+
skills: { status: "skipped", reason: "A newer environment refresh superseded this response." }
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
rememberBusinessConfig(normalized, token, config.businesses);
|
|
78
|
+
const result = {
|
|
79
|
+
host: normalized,
|
|
80
|
+
businesses: config.businesses ?? {},
|
|
81
|
+
source: "remote",
|
|
82
|
+
skills: { status: "skipped", reason: "Only an explicitly refreshed active local environment changes global Skills." }
|
|
83
|
+
};
|
|
84
|
+
if (config.businesses === void 0) {
|
|
85
|
+
result.skills = { status: "skipped", reason: "This server does not provide business states; existing Skills were preserved." };
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
if (!synchronize || !localActiveEnvironment()) return result;
|
|
89
|
+
try {
|
|
90
|
+
const syncOptions = {
|
|
91
|
+
skillsDirectory: path.join(getLocalCliPackageInfo().root, "skills"),
|
|
92
|
+
host: normalized,
|
|
93
|
+
tokenFingerprint: fingerprint,
|
|
94
|
+
businesses: config.businesses,
|
|
95
|
+
packageVersion: getLocalCliPackageInfo().version,
|
|
96
|
+
generation,
|
|
97
|
+
isCurrentContext: localActiveEnvironment
|
|
98
|
+
};
|
|
99
|
+
if (!fs.existsSync(path.join(getConfigDir(), "business-skills.json"))) {
|
|
100
|
+
const adoption = syncBusinessSkills({ ...syncOptions, mode: "adopt" });
|
|
101
|
+
if (["failed", "busy", "stale"].includes(adoption.status)) {
|
|
102
|
+
result.skills = adoption;
|
|
103
|
+
return result;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
result.skills = syncBusinessSkills(syncOptions);
|
|
107
|
+
} catch {
|
|
108
|
+
result.skills = { status: "failed", reason: "Skill synchronization could not complete. Retry: ae-cli config refresh" };
|
|
109
|
+
}
|
|
110
|
+
return result;
|
|
111
|
+
}
|
|
112
|
+
async function refreshEnvironmentAfterLogin(host) {
|
|
113
|
+
try {
|
|
114
|
+
const result = await refreshEnvironmentConfig(host);
|
|
115
|
+
if (!["success", "skipped"].includes(result.skills.status)) {
|
|
116
|
+
process.stderr.write("[ae-cli] Some Skills could not be synchronized. Run: ae-cli config refresh\n");
|
|
117
|
+
}
|
|
118
|
+
if (result.source === "unavailable") {
|
|
119
|
+
process.stderr.write("[ae-cli] Business configuration could not be refreshed. Sign in if needed, then run: ae-cli config refresh\n");
|
|
120
|
+
}
|
|
121
|
+
return result;
|
|
122
|
+
} catch {
|
|
123
|
+
process.stderr.write("[ae-cli] Business configuration could not be refreshed. Retry: ae-cli config refresh\n");
|
|
124
|
+
return void 0;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export {
|
|
129
|
+
invalidateBusinessSkillSynchronization,
|
|
130
|
+
refreshEnvironmentConfig,
|
|
131
|
+
refreshEnvironmentAfterLogin
|
|
132
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
fetchCliConfig,
|
|
4
|
+
formatCapabilityMissCompatHint,
|
|
5
|
+
getCachedCompatForHost,
|
|
6
|
+
getPendingHostCompatNotice,
|
|
7
|
+
getPendingUpdateNotice,
|
|
8
|
+
isCompatCacheStale,
|
|
9
|
+
isNonInteractiveOutput,
|
|
10
|
+
notifyIfHostCompat,
|
|
11
|
+
runHostCompatCheck,
|
|
12
|
+
shouldNotifyCompat,
|
|
13
|
+
shouldSkipAutoSync,
|
|
14
|
+
shouldSkipCompatCheck
|
|
15
|
+
} from "./chunk-TULINOLS.js";
|
|
16
|
+
import "./chunk-H3K5UGYC.js";
|
|
17
|
+
import "./chunk-JNVVJ273.js";
|
|
18
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
19
|
+
export {
|
|
20
|
+
fetchCliConfig,
|
|
21
|
+
formatCapabilityMissCompatHint,
|
|
22
|
+
getCachedCompatForHost,
|
|
23
|
+
getPendingHostCompatNotice,
|
|
24
|
+
getPendingUpdateNotice,
|
|
25
|
+
isCompatCacheStale,
|
|
26
|
+
isNonInteractiveOutput,
|
|
27
|
+
notifyIfHostCompat,
|
|
28
|
+
runHostCompatCheck,
|
|
29
|
+
shouldNotifyCompat,
|
|
30
|
+
shouldSkipAutoSync,
|
|
31
|
+
shouldSkipCompatCheck
|
|
32
|
+
};
|
|
@@ -1,33 +1,42 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
invalidateBusinessSkillSynchronization,
|
|
4
|
+
refreshEnvironmentAfterLogin,
|
|
5
|
+
refreshEnvironmentConfig
|
|
6
|
+
} from "./chunk-ZGIYG473.js";
|
|
6
7
|
import {
|
|
7
8
|
MultiselectCancelled,
|
|
8
9
|
promptSingleSelect
|
|
9
10
|
} from "./chunk-7K24F7T2.js";
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
+
AE_TRIAL_URL,
|
|
13
|
+
missingAeHostHint
|
|
14
|
+
} from "./chunk-6ZIQV5GW.js";
|
|
15
|
+
import {
|
|
12
16
|
printError,
|
|
13
|
-
printOutput
|
|
17
|
+
printOutput
|
|
18
|
+
} from "./chunk-752BSLZC.js";
|
|
19
|
+
import {
|
|
20
|
+
fetchCliConfig,
|
|
21
|
+
readCurrentBusinessConfig,
|
|
14
22
|
resolveKbAutoDiscoveryFeature
|
|
15
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TULINOLS.js";
|
|
16
24
|
import {
|
|
17
25
|
peekCliToken
|
|
18
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-H3K5UGYC.js";
|
|
19
27
|
import {
|
|
20
28
|
addHost,
|
|
21
29
|
getActiveHost,
|
|
22
30
|
listHosts,
|
|
23
31
|
loadConfig,
|
|
24
|
-
normalizeUrl,
|
|
25
32
|
removeHost,
|
|
26
33
|
resolveHostSelector,
|
|
27
34
|
setActiveHost,
|
|
28
35
|
updateHostLabel
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import
|
|
36
|
+
} from "./chunk-JNVVJ273.js";
|
|
37
|
+
import {
|
|
38
|
+
normalizeUrl
|
|
39
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
31
40
|
|
|
32
41
|
// src/commands/config.ts
|
|
33
42
|
import * as readline2 from "readline";
|
|
@@ -69,7 +78,9 @@ Already active: \x1B[1m${item.host.label}\x1B[0m
|
|
|
69
78
|
`);
|
|
70
79
|
return;
|
|
71
80
|
}
|
|
81
|
+
invalidateBusinessSkillSynchronization();
|
|
72
82
|
setActiveHost(item.host.url);
|
|
83
|
+
await refreshEnvironmentAfterLogin(item.host.url);
|
|
73
84
|
process.stderr.write(`
|
|
74
85
|
\x1B[32m\u2713\x1B[0m Active environment: \x1B[1m${item.host.label}\x1B[0m ${item.host.url}
|
|
75
86
|
`);
|
|
@@ -103,6 +114,7 @@ async function promptAddEnvironment() {
|
|
|
103
114
|
const labelInput = await ask(`Label [${defaultLabel}]: `);
|
|
104
115
|
const label = labelInput || defaultLabel;
|
|
105
116
|
try {
|
|
117
|
+
invalidateBusinessSkillSynchronization();
|
|
106
118
|
addHost(url, label);
|
|
107
119
|
const active = listHosts().find((host) => host.url === url)?.active;
|
|
108
120
|
process.stderr.write(
|
|
@@ -111,6 +123,7 @@ async function promptAddEnvironment() {
|
|
|
111
123
|
`
|
|
112
124
|
);
|
|
113
125
|
if (active) {
|
|
126
|
+
await refreshEnvironmentAfterLogin(url);
|
|
114
127
|
process.stderr.write(` Authenticate if needed: ae-cli auth login --host ${url}
|
|
115
128
|
`);
|
|
116
129
|
}
|
|
@@ -155,11 +168,13 @@ async function promptRemoveEnvironment(host) {
|
|
|
155
168
|
process.stderr.write("Cancelled.\n");
|
|
156
169
|
return;
|
|
157
170
|
}
|
|
171
|
+
invalidateBusinessSkillSynchronization();
|
|
158
172
|
if (replacement) setActiveHost(replacement.url);
|
|
159
173
|
removeHost(host.url);
|
|
160
174
|
process.stderr.write(`\x1B[32m\u2713\x1B[0m Removed: ${host.label}
|
|
161
175
|
`);
|
|
162
176
|
if (replacement) {
|
|
177
|
+
await refreshEnvironmentAfterLogin(replacement.url);
|
|
163
178
|
process.stderr.write(` Active environment: ${replacement.label} ${replacement.url}
|
|
164
179
|
`);
|
|
165
180
|
} else if (listHosts().length === 0) {
|
|
@@ -273,6 +288,16 @@ function registerConfig(program) {
|
|
|
273
288
|
configCmd.command("current").description("Show the active AE environment").action(async () => {
|
|
274
289
|
await printCurrentConfig(program);
|
|
275
290
|
});
|
|
291
|
+
configCmd.command("refresh").description("Refresh business configuration and synchronize managed Skills for the active environment").action(async () => {
|
|
292
|
+
const host = program.opts().host || getActiveHost();
|
|
293
|
+
if (!host) {
|
|
294
|
+
failConfig("No active AE environment configured.", missingAeHostHint());
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const result = await refreshEnvironmentConfig(host, { synchronizeSkills: !program.opts().host });
|
|
298
|
+
await printOutput(result, program.opts().format || "json", program.opts().jq);
|
|
299
|
+
if (result.source === "unavailable" || ["failed", "partial", "busy"].includes(result.skills.status)) process.exitCode = 1;
|
|
300
|
+
});
|
|
276
301
|
configCmd.command("show").description("Show effective configuration for the selected AE host and account").action(async () => {
|
|
277
302
|
const host = program.opts().host || getActiveHost();
|
|
278
303
|
const token = host ? peekCliToken(host) : null;
|
|
@@ -280,6 +305,7 @@ function registerConfig(program) {
|
|
|
280
305
|
await printOutput(
|
|
281
306
|
{
|
|
282
307
|
host: host || null,
|
|
308
|
+
businesses: readCurrentBusinessConfig(host),
|
|
283
309
|
routing: { knowledge_base: feature.enabled ? "auto" : "explicit" },
|
|
284
310
|
source: feature.source
|
|
285
311
|
},
|
|
@@ -303,8 +329,10 @@ function registerConfig(program) {
|
|
|
303
329
|
try {
|
|
304
330
|
const normalized = normalizeUrl(url);
|
|
305
331
|
const label = opts.label || normalized;
|
|
332
|
+
invalidateBusinessSkillSynchronization();
|
|
306
333
|
addHost(normalized, label);
|
|
307
334
|
setActiveHost(normalized);
|
|
335
|
+
await refreshEnvironmentAfterLogin(normalized);
|
|
308
336
|
await printOutput(
|
|
309
337
|
{ activeHost: normalized, label: label.trim() },
|
|
310
338
|
program.opts().format || "json",
|
|
@@ -352,7 +380,9 @@ async function useConfigEnv(program, env) {
|
|
|
352
380
|
failHostResolution(env, target);
|
|
353
381
|
return;
|
|
354
382
|
}
|
|
383
|
+
invalidateBusinessSkillSynchronization();
|
|
355
384
|
setActiveHost(target.host.url);
|
|
385
|
+
await refreshEnvironmentAfterLogin(target.host.url);
|
|
356
386
|
await printOutput({ activeHost: target.host.url, label: target.host.label }, program.opts().format || "json", program.opts().jq);
|
|
357
387
|
}
|
|
358
388
|
async function addConfigEnv(program, url, opts) {
|
|
@@ -366,8 +396,10 @@ async function addConfigEnv(program, url, opts) {
|
|
|
366
396
|
return;
|
|
367
397
|
}
|
|
368
398
|
try {
|
|
399
|
+
invalidateBusinessSkillSynchronization();
|
|
369
400
|
addHost(normalized, opts.label);
|
|
370
401
|
if (opts.use) setActiveHost(normalized);
|
|
402
|
+
if (getActiveHost() === normalized) await refreshEnvironmentAfterLogin(normalized);
|
|
371
403
|
const saved = loadConfig();
|
|
372
404
|
await printOutput(
|
|
373
405
|
{
|
|
@@ -431,6 +463,7 @@ async function removeConfigEnv(program, env, skipConfirmation) {
|
|
|
431
463
|
return;
|
|
432
464
|
}
|
|
433
465
|
}
|
|
466
|
+
invalidateBusinessSkillSynchronization();
|
|
434
467
|
removeHost(target.host.url);
|
|
435
468
|
await printOutput(
|
|
436
469
|
{
|
|
@@ -2,15 +2,15 @@ import { createRequire as __createRequire } from 'node:module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
TeAgentApiError,
|
|
4
4
|
getFromMainApp
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-RJHGDWSC.js";
|
|
6
6
|
import "./chunk-Y74WTIKJ.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-H3K5UGYC.js";
|
|
8
8
|
import {
|
|
9
9
|
safeJsonParse
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JNVVJ273.js";
|
|
11
11
|
import {
|
|
12
12
|
CliValidationError
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
14
14
|
|
|
15
15
|
// src/core/current-page-context-client.ts
|
|
16
16
|
async function readCurrentPageContext(path) {
|