@thinkingai/ae-cli 6.1.41 → 6.1.43
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 +14 -4
- package/README.zh.md +14 -4
- package/bin/ae-cli.js +3 -0
- package/bin/heari/commander-LICENSE +22 -0
- package/bin/heari/engine.mjs +6136 -0
- package/bin/heari/package.json +6 -0
- package/bin/heari.mjs +29 -0
- package/cli-installation-guide.md +6 -7
- package/dist/{ai-monitor-OOOD4QDK.js → ai-monitor-4VPHXQTL.js} +7 -6
- package/dist/ai-monitor.js +10 -9
- package/dist/{auth-6BUUY5XS.js → auth-RDSS2LUT.js} +18 -16
- package/dist/{automation-IMDCJUML.js → automation-VLIWG2XY.js} +5 -4
- package/dist/{capability-XXFCANX7.js → capability-CUOEIB5F.js} +5 -4
- package/dist/{chunk-KE5WGBXS.js → chunk-3DTMWDJX.js} +1 -1
- package/dist/{chunk-FPPCXG6K.js → chunk-3FSYICDW.js} +6 -5
- package/dist/{chunk-BEVWMPCZ.js → chunk-3TV24AVQ.js} +10 -10
- package/dist/{chunk-DTODOQ6T.js → chunk-3U75VLCP.js} +1 -1
- package/dist/{chunk-6W56UQPO.js → chunk-4MOCV6HU.js} +1 -1
- package/dist/{chunk-M2OCZRVX.js → chunk-6VLHJKDD.js} +2 -2
- package/dist/{chunk-WG27BD67.js → chunk-7KBENPQF.js} +8 -16
- package/dist/{chunk-5YQSCMGS.js → chunk-BFSWGXM2.js} +3 -3
- package/dist/{chunk-UK7HQ4IL.js → chunk-CBNE2S44.js} +2 -2
- package/dist/{chunk-UWQXGF44.js → chunk-FEYZBUFQ.js} +4 -353
- package/dist/chunk-FKTVD63C.js +369 -0
- package/dist/{chunk-2H3SFJE3.js → chunk-FKVG7LOP.js} +5 -3
- package/dist/{chunk-I7H72CMN.js → chunk-IAZ4AMVY.js} +109 -85
- package/dist/{chunk-KDRE7SWM.js → chunk-LSELMDKQ.js} +2 -2
- package/dist/{chunk-2RORKIF6.js → chunk-NJGB4YOH.js} +2 -2
- package/dist/{chunk-L7MT53VM.js → chunk-PWG5IGCP.js} +1 -1
- package/dist/{chunk-EHH3ZF7D.js → chunk-TFEGYB4X.js} +2 -2
- package/dist/{chunk-DZRQGI2Z.js → chunk-ZPAOEDK7.js} +5 -3
- package/dist/{compat-check-AO3BFA3N.js → compat-check-L3C7HCVG.js} +4 -3
- package/dist/{config-N5V4VNER.js → config-LAF5MMYK.js} +6 -5
- package/dist/context-E4YKECC4.js +350 -0
- package/dist/{evaluation-OZM54MES.js → evaluation-I4IJ25CY.js} +4 -3
- package/dist/heari-cli-login.js +83 -0
- package/dist/index.js +43 -34
- package/dist/{memory-VPOPSU52.js → memory-Y7LPCRP4.js} +5 -4
- package/dist/{metadata-OUJPEMLD.js → metadata-T6HYAU7E.js} +7 -6
- package/dist/{model-2F2354QP.js → model-2BNN72MN.js} +7 -6
- package/dist/{personal-semantic-preference-WEAIZQXM.js → personal-semantic-preference-WCZBOA7V.js} +42 -16
- package/dist/{project-semantic-6VXUYU4A.js → project-semantic-WW5AZST3.js} +266 -17
- package/dist/{sync-BAV3UY46.js → sync-6PL25V42.js} +13 -12
- package/dist/{te-agent-QWZC36YS.js → te-agent-KXLDW4NE.js} +6 -5
- package/dist/{te-analysis-43RCOPUA.js → te-analysis-KKRECQ7F.js} +311 -52
- package/dist/{te-community-ECNTP35Z.js → te-community-6RGX7IWH.js} +8 -6
- package/dist/{te-dataops-ISEKYRLZ.js → te-dataops-RSPBC6WJ.js} +726 -220
- package/dist/{te-engage-LBKIZXZO.js → te-engage-FIPP5L2Z.js} +6 -5
- package/dist/{te-experiment-5TPQKN6B.js → te-experiment-KQ5CBYKI.js} +86 -10
- package/dist/{te-kb-SHL56BJ5.js → te-kb-XYSDXZUG.js} +32 -11
- package/dist/{te-system-Z4VEB6PL.js → te-system-QSOHAP7M.js} +7 -6
- package/dist/{te-team-EZ3TZTLV.js → te-team-R6MZ4RK2.js} +6 -5
- package/dist/{things-UBMLTY3S.js → things-DEONFUGS.js} +6 -5
- package/dist/{update-WE7VNRKZ.js → update-C6G4P3C7.js} +5 -4
- package/dist/{web-runtime-H53QKJS2.js → web-runtime-UGKPTBOK.js} +18 -12
- package/dist/{workspace-W5ZPVWJS.js → workspace-OBIIE5FN.js} +5 -4
- package/package.json +7 -5
- package/skills/ae-analysis/SKILL.md +41 -16
- package/skills/ae-analysis/references/adhoc_export.md +1 -1
- package/skills/ae-analysis/references/adhoc_run.md +8 -2
- package/skills/ae-analysis/references/analysis_drilldown_contract.md +1 -1
- package/skills/ae-analysis/references/audience_scheduling.md +30 -0
- package/skills/ae-analysis/references/business_semantics_workspace.md +57 -0
- package/skills/ae-analysis/references/command_index.md +18 -13
- package/skills/ae-analysis/references/context_prepare.md +49 -0
- package/skills/ae-analysis/references/drilldown_entities_export.md +1 -1
- package/skills/ae-analysis/references/drilldown_entities_run.md +1 -1
- package/skills/ae-analysis/references/drilldown_user_events_export.md +3 -1
- package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -1
- package/skills/ae-analysis/references/governance_recommendation_export.md +1 -1
- package/skills/ae-analysis/references/personal_semantic_preference_add.md +5 -1
- package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -2
- package/skills/ae-analysis/references/personal_semantic_preference_list.md +7 -6
- package/skills/ae-analysis/references/personal_semantic_preference_submit.md +1 -1
- package/skills/ae-analysis/references/personal_semantic_preference_update.md +5 -1
- package/skills/ae-analysis/references/project_info_get.md +4 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +1 -1
- package/skills/ae-analysis/references/project_semantic_setup.md +60 -0
- package/skills/ae-analysis/references/report_get.md +2 -0
- package/skills/ae-analysis/references/report_presentation.md +55 -0
- package/skills/ae-analysis/references/report_update.md +4 -2
- package/skills/ae-analysis/references/system_openapi_token_batch_generate.md +20 -0
- package/skills/ae-analysis/references/system_openapi_token_get.md +14 -0
- package/skills/ae-analysis/references/user_cluster_create.md +3 -1
- package/skills/ae-analysis/references/user_cluster_models.md +2 -0
- package/skills/ae-analysis/references/user_cluster_update.md +5 -3
- package/skills/ae-analysis/references/user_tag_create.md +4 -22
- package/skills/ae-analysis/references/user_tag_models.md +8 -0
- package/skills/ae-analysis/references/user_tag_update.md +6 -14
- package/skills/ae-analysis/scripts/read-semantic-catalog.mjs +40 -0
- package/skills/ae-capability/SKILL.md +5 -1
- package/skills/ae-dataops/SKILL.md +9 -6
- package/skills/ae-dataops/references/dataops-flow-create.md +64 -47
- package/skills/ae-dataops/references/dataops-flow-monitor.md +4 -2
- package/skills/ae-dataops/references/dataops-flow-python.md +109 -0
- package/skills/ae-experiment/SKILL.md +9 -1
- package/skills/ae-experiment/references/manage_feature_fixed_value.md +73 -0
- package/skills/ae-experiment/references/save_feature.md +14 -1
- package/skills/ae-heari-research/SKILL.md +40 -0
- package/skills/ae-heari-research/references/design.md +35 -0
- package/skills/ae-heari-research/references/examples.md +46 -0
- package/skills/ae-heari-research/references/platform-auth.md +35 -0
- package/skills/ae-heari-research/references/platform-research.md +74 -0
- package/skills/ae-heari-research/references/platform-results.md +73 -0
- package/skills/ae-heari-research/references/platform.md +34 -0
- package/skills/ae-heari-research/references/probing-screening.md +31 -0
- package/skills/ae-heari-research/references/quality.md +44 -0
- package/skills/ae-kb/SKILL.md +10 -5
- package/skills/ae-kb/references/analysis-workflow.md +19 -10
- package/skills/ae-kb/references/query-workflow.md +34 -17
- package/skills/ae-kb-discovery/SKILL.md +4 -3
- package/skills/ae-onboarding/SKILL.md +4 -6
- package/skills/ae-onboarding/references/onboarding_run.md +5 -1
- package/dist/context-WJQGJD6F.js +0 -139
- package/dist/{data-integration-KMJWYAKK.js → data-integration-SCYYZLWI.js} +4 -4
|
@@ -2,11 +2,11 @@ import { createRequire as __createRequire } from 'node:module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
CapabilityGatewayError,
|
|
4
4
|
getLocalCliPackageInfo
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-7KBENPQF.js";
|
|
6
6
|
import {
|
|
7
7
|
internalCallSourceHeaders,
|
|
8
8
|
peekCliToken
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-FKTVD63C.js";
|
|
10
10
|
import {
|
|
11
11
|
getActiveHost,
|
|
12
12
|
getConfigDir,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
|
|
26
26
|
// src/core/compat-check.ts
|
|
27
27
|
import fs10 from "fs";
|
|
28
|
-
import
|
|
28
|
+
import path12 from "path";
|
|
29
29
|
import { createHash as createHash3 } from "crypto";
|
|
30
30
|
import { Agent } from "undici";
|
|
31
31
|
|
|
@@ -316,7 +316,7 @@ function formatCompatNotice(verdict) {
|
|
|
316
316
|
|
|
317
317
|
// src/core/version-sync.ts
|
|
318
318
|
import fs8 from "fs";
|
|
319
|
-
import
|
|
319
|
+
import path10 from "path";
|
|
320
320
|
|
|
321
321
|
// src/core/onboarding/contracts.ts
|
|
322
322
|
var DEMO_CONTEXT = "project.plg_demo.context";
|
|
@@ -1346,7 +1346,7 @@ async function verifyAndCompleteProgress(deps, host, runId) {
|
|
|
1346
1346
|
|
|
1347
1347
|
// src/core/installation.ts
|
|
1348
1348
|
import fs7 from "fs";
|
|
1349
|
-
import
|
|
1349
|
+
import path9 from "path";
|
|
1350
1350
|
import crypto4 from "crypto";
|
|
1351
1351
|
|
|
1352
1352
|
// src/core/skills-install.ts
|
|
@@ -1431,6 +1431,7 @@ function verifyGlobalSkills(skills, directory) {
|
|
|
1431
1431
|
}
|
|
1432
1432
|
|
|
1433
1433
|
// src/core/host-guidance.ts
|
|
1434
|
+
import path4 from "path";
|
|
1434
1435
|
function normalizeRegistrationLanguage(value) {
|
|
1435
1436
|
const language = value.trim().toLowerCase().split(/[_.:@-]/)[0];
|
|
1436
1437
|
if (language === "zh" || language === "cn") return "zh-CN";
|
|
@@ -1438,14 +1439,32 @@ function normalizeRegistrationLanguage(value) {
|
|
|
1438
1439
|
if (language === "ko" || language === "kr") return "ko-KR";
|
|
1439
1440
|
return language === "en" ? "en-US" : void 0;
|
|
1440
1441
|
}
|
|
1441
|
-
function
|
|
1442
|
-
|
|
1442
|
+
function terminalRegistrationLanguage(env) {
|
|
1443
|
+
const locale = [env.LC_ALL, env.LC_MESSAGES, env.LANG, env.LANGUAGE].map((value) => value?.trim()).find((value) => value && !/^(?:C|POSIX)(?:[.@].*)?$/i.test(value));
|
|
1444
|
+
return normalizeRegistrationLanguage(locale ?? "");
|
|
1445
|
+
}
|
|
1446
|
+
function localRegistrationLanguage(env = process.env, platform = process.platform, runner = defaultInstallRunner) {
|
|
1447
|
+
const override = normalizeRegistrationLanguage(env.AE_LANG ?? "");
|
|
1448
|
+
if (override) return override;
|
|
1449
|
+
let systemLocale;
|
|
1450
|
+
if (platform === "darwin") {
|
|
1451
|
+
const result2 = runner("/usr/bin/defaults", ["read", "-g", "AppleLanguages"], 1e3);
|
|
1452
|
+
if (commandSucceeded(result2)) {
|
|
1453
|
+
systemLocale = result2.stdout.match(/^\s*\(\s*"?([\w-]+)"?\s*[,)]/u)?.[1];
|
|
1454
|
+
}
|
|
1455
|
+
} else if (platform === "win32") {
|
|
1456
|
+
const powershell = path4.win32.join(env.SystemRoot ?? "C:\\Windows", "System32", "WindowsPowerShell", "v1.0", "powershell.exe");
|
|
1457
|
+
const result2 = runner(powershell, ["-NoProfile", "-NonInteractive", "-Command", "(Get-UICulture).Name"], 2e3);
|
|
1458
|
+
if (commandSucceeded(result2)) systemLocale = result2.stdout.trim();
|
|
1459
|
+
}
|
|
1460
|
+
return systemLocale ? normalizeRegistrationLanguage(systemLocale) : terminalRegistrationLanguage(env);
|
|
1443
1461
|
}
|
|
1444
|
-
function onboardingDeviceMarket(
|
|
1445
|
-
return
|
|
1462
|
+
function onboardingDeviceMarket(language) {
|
|
1463
|
+
return language === "zh-CN" ? "cn" : "us";
|
|
1446
1464
|
}
|
|
1447
1465
|
function registrationLanguage(language, env = process.env) {
|
|
1448
|
-
|
|
1466
|
+
const locale = language || env.AE_LANG || env.LC_ALL || env.LC_MESSAGES || env.LANG || env.LANGUAGE || "";
|
|
1467
|
+
return normalizeRegistrationLanguage(locale) ?? "en-US";
|
|
1449
1468
|
}
|
|
1450
1469
|
function registrationMarket(language) {
|
|
1451
1470
|
return { "zh-CN": "cn", "en-US": "us", "ja-JP": "jp", "ko-KR": "kr" }[language];
|
|
@@ -1480,12 +1499,13 @@ function missingAeHostGuidance() {
|
|
|
1480
1499
|
// src/core/business-config.ts
|
|
1481
1500
|
import crypto3 from "crypto";
|
|
1482
1501
|
import fs6 from "fs";
|
|
1483
|
-
import
|
|
1502
|
+
import path8 from "path";
|
|
1484
1503
|
|
|
1485
1504
|
// src/core/skill-businesses.json
|
|
1486
1505
|
var skill_businesses_default = {
|
|
1487
1506
|
base: [
|
|
1488
|
-
"ae-capability"
|
|
1507
|
+
"ae-capability",
|
|
1508
|
+
"ae-heari-research"
|
|
1489
1509
|
],
|
|
1490
1510
|
analysis: [
|
|
1491
1511
|
"ae-analysis",
|
|
@@ -1640,6 +1660,7 @@ function normalizeBusinesses(value) {
|
|
|
1640
1660
|
}
|
|
1641
1661
|
function businessForCommand(commandPath) {
|
|
1642
1662
|
const [service, resource] = commandPath;
|
|
1663
|
+
if (service === "context" && (!resource || resource === "prepare")) return void 0;
|
|
1643
1664
|
if (service === "system") return AGENT_SYSTEM_COMMANDS.has(resource) ? "agent" : void 0;
|
|
1644
1665
|
return COMMAND_BUSINESSES[service];
|
|
1645
1666
|
}
|
|
@@ -1667,18 +1688,18 @@ function canManageGlobalSkills() {
|
|
|
1667
1688
|
// src/core/business-skill-refresh.ts
|
|
1668
1689
|
import crypto2 from "crypto";
|
|
1669
1690
|
import fs5 from "fs";
|
|
1670
|
-
import
|
|
1691
|
+
import path7 from "path";
|
|
1671
1692
|
|
|
1672
1693
|
// src/core/business-skill-sync.ts
|
|
1673
1694
|
import fs4 from "fs";
|
|
1674
1695
|
import os3 from "os";
|
|
1675
|
-
import
|
|
1696
|
+
import path6 from "path";
|
|
1676
1697
|
import { createHash as createHash2, randomUUID } from "crypto";
|
|
1677
1698
|
|
|
1678
1699
|
// src/core/skills-tool.ts
|
|
1679
1700
|
import fs3 from "fs";
|
|
1680
1701
|
import os2 from "os";
|
|
1681
|
-
import
|
|
1702
|
+
import path5 from "path";
|
|
1682
1703
|
import { createHash } from "crypto";
|
|
1683
1704
|
import { createRequire, isBuiltin } from "module";
|
|
1684
1705
|
import { pathToFileURL } from "url";
|
|
@@ -1704,25 +1725,25 @@ function realSkillPath(file) {
|
|
|
1704
1725
|
return fs3.realpathSync(file);
|
|
1705
1726
|
} catch (error) {
|
|
1706
1727
|
if (error.code !== "ENOENT") throw error;
|
|
1707
|
-
const parent =
|
|
1728
|
+
const parent = path5.dirname(file);
|
|
1708
1729
|
if (parent === file) throw error;
|
|
1709
|
-
return
|
|
1730
|
+
return path5.join(realSkillPath(parent), path5.basename(file));
|
|
1710
1731
|
}
|
|
1711
1732
|
}
|
|
1712
1733
|
function skillPathProblem(targetDirectory, skill, sourceRoot) {
|
|
1713
1734
|
try {
|
|
1714
|
-
const target = realSkillPath(
|
|
1715
|
-
const source = realSkillPath(
|
|
1716
|
-
const overlaps = (a, b) => a === b || a.startsWith(b +
|
|
1735
|
+
const target = realSkillPath(path5.resolve(targetDirectory, skill));
|
|
1736
|
+
const source = realSkillPath(path5.resolve(sourceRoot));
|
|
1737
|
+
const overlaps = (a, b) => a === b || a.startsWith(b + path5.sep);
|
|
1717
1738
|
if (overlaps(target, source) || overlaps(source, target)) return "package_source_overlap";
|
|
1718
|
-
let parent =
|
|
1739
|
+
let parent = path5.resolve(targetDirectory);
|
|
1719
1740
|
while (true) {
|
|
1720
1741
|
try {
|
|
1721
1742
|
if (fs3.lstatSync(parent).isSymbolicLink()) return "copy_parent_linked";
|
|
1722
1743
|
} catch (error) {
|
|
1723
1744
|
if (error.code !== "ENOENT") throw error;
|
|
1724
1745
|
}
|
|
1725
|
-
const next =
|
|
1746
|
+
const next = path5.dirname(parent);
|
|
1726
1747
|
if (next === parent) return null;
|
|
1727
1748
|
parent = next;
|
|
1728
1749
|
}
|
|
@@ -1739,13 +1760,13 @@ function skillCopyHash(directory, source = false) {
|
|
|
1739
1760
|
}
|
|
1740
1761
|
const hash = createHash("sha256");
|
|
1741
1762
|
const visit = (relative) => {
|
|
1742
|
-
for (const name of fs3.readdirSync(
|
|
1763
|
+
for (const name of fs3.readdirSync(path5.join(directory, relative)).sort()) {
|
|
1743
1764
|
if (name === ".DS_Store") continue;
|
|
1744
|
-
const child =
|
|
1745
|
-
const absolute =
|
|
1765
|
+
const child = path5.join(relative, name);
|
|
1766
|
+
const absolute = path5.join(directory, child);
|
|
1746
1767
|
const stat = fs3.lstatSync(absolute);
|
|
1747
1768
|
if (source && (name === "metadata.json" || stat.isDirectory() && [".git", "__pycache__", "__pypackages__"].includes(name))) continue;
|
|
1748
|
-
const normalized = child.split(
|
|
1769
|
+
const normalized = child.split(path5.sep).join("/");
|
|
1749
1770
|
if (stat.isSymbolicLink()) throw new Error("Symbolic links are not managed Skill copies.");
|
|
1750
1771
|
if (stat.isDirectory()) {
|
|
1751
1772
|
hash.update(`directory:${normalized}\0`);
|
|
@@ -1809,7 +1830,7 @@ function adaptedToolSource(source, entry) {
|
|
|
1809
1830
|
);
|
|
1810
1831
|
source = replaceOnce(source, "main().finally(() => flushTelemetry().then(() => process.exit(0)));", "");
|
|
1811
1832
|
const require2 = createRequire(entry);
|
|
1812
|
-
const resolveImport = (specifier) => isBuiltin(specifier) ? specifier : pathToFileURL(specifier.startsWith(".") ?
|
|
1833
|
+
const resolveImport = (specifier) => isBuiltin(specifier) ? specifier : pathToFileURL(specifier.startsWith(".") ? path5.resolve(path5.dirname(entry), specifier) : require2.resolve(specifier)).href;
|
|
1813
1834
|
source = source.replace(
|
|
1814
1835
|
/\bfrom (['"])([^'"]+)\1/g,
|
|
1815
1836
|
(_match, quote, specifier) => `from ${quote}${resolveImport(specifier)}${quote}`
|
|
@@ -2019,8 +2040,8 @@ catch { process.stdout.write(JSON.stringify({ ok: false })); process.exitCode =
|
|
|
2019
2040
|
`;
|
|
2020
2041
|
function createPinnedSkillsTool(options = {}) {
|
|
2021
2042
|
const require2 = createRequire(import.meta.url);
|
|
2022
|
-
const packageFile = options.entry ?
|
|
2023
|
-
const entry = options.entry ??
|
|
2043
|
+
const packageFile = options.entry ? path5.join(path5.dirname(options.entry), "..", "package.json") : require2.resolve("skills/package.json");
|
|
2044
|
+
const entry = options.entry ?? path5.join(path5.dirname(packageFile), "dist", "cli.mjs");
|
|
2024
2045
|
const metadata = JSON.parse(fs3.readFileSync(packageFile, "utf8"));
|
|
2025
2046
|
const source = fs3.readFileSync(entry, "utf8");
|
|
2026
2047
|
if (metadata.version !== MANAGED_SKILLS_TOOL_VERSION || createHash("sha256").update(source).digest("hex") !== TOOL_SOURCE_SHA256) {
|
|
@@ -2028,8 +2049,8 @@ function createPinnedSkillsTool(options = {}) {
|
|
|
2028
2049
|
}
|
|
2029
2050
|
const script = adaptedToolSource(source, entry);
|
|
2030
2051
|
const run = (request2) => {
|
|
2031
|
-
const directory = fs3.mkdtempSync(
|
|
2032
|
-
const worker =
|
|
2052
|
+
const directory = fs3.mkdtempSync(path5.join(os2.tmpdir(), "ae-cli-skills-tool-"));
|
|
2053
|
+
const worker = path5.join(directory, "adapter.mjs");
|
|
2033
2054
|
try {
|
|
2034
2055
|
fs3.writeFileSync(worker, script, { mode: 384 });
|
|
2035
2056
|
const result2 = spawn2.sync(process.execPath, [worker], {
|
|
@@ -2065,17 +2086,17 @@ var POLICY_HASH = createHash2("sha256").update(JSON.stringify({ removal_policy:
|
|
|
2065
2086
|
function historicalCliSkills(options) {
|
|
2066
2087
|
const env = options.env ?? process.env;
|
|
2067
2088
|
const home = env.HOME || env.USERPROFILE || os3.homedir();
|
|
2068
|
-
const file = env.XDG_STATE_HOME ?
|
|
2089
|
+
const file = env.XDG_STATE_HOME ? path6.join(env.XDG_STATE_HOME, "skills", ".skill-lock.json") : path6.join(home, ".agents", ".skill-lock.json");
|
|
2069
2090
|
const names = /* @__PURE__ */ new Set();
|
|
2070
2091
|
let content = "";
|
|
2071
2092
|
const isCliSource = (value, type) => {
|
|
2072
2093
|
if (typeof value !== "string") return false;
|
|
2073
|
-
if (type === "local" &&
|
|
2074
|
-
const source2 =
|
|
2075
|
-
if (source2 ===
|
|
2076
|
-
if (
|
|
2094
|
+
if (type === "local" && path6.isAbsolute(value)) {
|
|
2095
|
+
const source2 = path6.resolve(value);
|
|
2096
|
+
if (source2 === path6.resolve(options.skillsDirectory)) return true;
|
|
2097
|
+
if (path6.basename(source2) !== "skills") return false;
|
|
2077
2098
|
try {
|
|
2078
|
-
const pkg = JSON.parse(fs4.readFileSync(
|
|
2099
|
+
const pkg = JSON.parse(fs4.readFileSync(path6.join(source2, "..", "package.json"), "utf8"));
|
|
2079
2100
|
return ["@tant/ae-cli", "@thinkingai/ae-cli"].includes(pkg.name) && typeof pkg.bin?.["ae-cli"] === "string";
|
|
2080
2101
|
} catch {
|
|
2081
2102
|
return false;
|
|
@@ -2136,7 +2157,7 @@ function reserveBusinessSkillContext(options) {
|
|
|
2136
2157
|
const directory = options.stateDirectory ?? getConfigDir();
|
|
2137
2158
|
fs4.mkdirSync(directory, { recursive: true, mode: 448 });
|
|
2138
2159
|
const generation = randomUUID();
|
|
2139
|
-
writeJson(
|
|
2160
|
+
writeJson(path6.join(directory, CONTEXT_FILE), { ...contextIdentity(options), generation });
|
|
2140
2161
|
return generation;
|
|
2141
2162
|
}
|
|
2142
2163
|
function currentContext(options, file, generation) {
|
|
@@ -2150,7 +2171,7 @@ function currentContext(options, file, generation) {
|
|
|
2150
2171
|
}
|
|
2151
2172
|
}
|
|
2152
2173
|
function isBusinessSkillContextCurrent(options) {
|
|
2153
|
-
return currentContext(options,
|
|
2174
|
+
return currentContext(options, path6.join(options.stateDirectory ?? getConfigDir(), CONTEXT_FILE), options.generation);
|
|
2154
2175
|
}
|
|
2155
2176
|
function takeLock(file) {
|
|
2156
2177
|
const owner = randomUUID();
|
|
@@ -2166,7 +2187,7 @@ function takeLock(file) {
|
|
|
2166
2187
|
};
|
|
2167
2188
|
try {
|
|
2168
2189
|
fs4.chmodSync(candidate, 448);
|
|
2169
|
-
fs4.writeFileSync(
|
|
2190
|
+
fs4.writeFileSync(path6.join(candidate, ownerName), JSON.stringify({ pid: process.pid, owner }), { mode: 384 });
|
|
2170
2191
|
for (let attempt = 0; attempt < 4; attempt++) {
|
|
2171
2192
|
try {
|
|
2172
2193
|
fs4.renameSync(candidate, file);
|
|
@@ -2176,7 +2197,7 @@ function takeLock(file) {
|
|
|
2176
2197
|
}
|
|
2177
2198
|
return () => {
|
|
2178
2199
|
try {
|
|
2179
|
-
fs4.unlinkSync(
|
|
2200
|
+
fs4.unlinkSync(path6.join(file, ownerName));
|
|
2180
2201
|
} catch {
|
|
2181
2202
|
}
|
|
2182
2203
|
try {
|
|
@@ -2221,7 +2242,7 @@ function takeLock(file) {
|
|
|
2221
2242
|
}
|
|
2222
2243
|
for (const name of names) {
|
|
2223
2244
|
try {
|
|
2224
|
-
fs4.unlinkSync(
|
|
2245
|
+
fs4.unlinkSync(path6.join(file, name));
|
|
2225
2246
|
} catch (cause) {
|
|
2226
2247
|
if (cause.code !== "ENOENT") throw cause;
|
|
2227
2248
|
}
|
|
@@ -2250,12 +2271,12 @@ function readLedger(file) {
|
|
|
2250
2271
|
throw new Error("Managed Skill ledger has an unsupported format.");
|
|
2251
2272
|
}
|
|
2252
2273
|
for (const [filePath, copy] of Object.entries(value.copies)) {
|
|
2253
|
-
if (!
|
|
2274
|
+
if (!path6.isAbsolute(filePath) || !copy || typeof copy.skill !== "string" || typeof copy.agent !== "string" || !/^[a-f0-9]{64}$/.test(copy.hash) || typeof copy.package_version !== "string") throw new Error("Managed Skill ledger has an invalid copy.");
|
|
2254
2275
|
}
|
|
2255
2276
|
return value;
|
|
2256
2277
|
}
|
|
2257
2278
|
function result(skill, target, reason) {
|
|
2258
|
-
return { skill, agent: target.agent, path:
|
|
2279
|
+
return { skill, agent: target.agent, path: path6.join(target.directory, skill), ...reason ? { reason } : {} };
|
|
2259
2280
|
}
|
|
2260
2281
|
function directInstallerLink(file, target, text) {
|
|
2261
2282
|
if (typeof text !== "string") return false;
|
|
@@ -2263,14 +2284,14 @@ function directInstallerLink(file, target, text) {
|
|
|
2263
2284
|
if (process.platform === "win32") {
|
|
2264
2285
|
if (value.toUpperCase().startsWith("\\\\?\\UNC\\")) value = "\\\\" + value.slice(8);
|
|
2265
2286
|
else if (value.startsWith("\\\\?\\") || value.startsWith("\\??\\")) value = value.slice(4);
|
|
2266
|
-
return [target,
|
|
2287
|
+
return [target, path6.relative(path6.dirname(file), target)].some((expected) => value.toLowerCase() === expected.toLowerCase());
|
|
2267
2288
|
}
|
|
2268
|
-
return value === target || value ===
|
|
2289
|
+
return value === target || value === path6.relative(path6.dirname(file), target);
|
|
2269
2290
|
}
|
|
2270
2291
|
function legacySkillLink(file, skill, sourceRoot, sourceHash, targets, ledger, removing = false) {
|
|
2271
2292
|
const canonical = targets.find((target2) => target2.agent === "universal");
|
|
2272
2293
|
if (!canonical) return;
|
|
2273
|
-
const target =
|
|
2294
|
+
const target = path6.join(canonical.directory, skill);
|
|
2274
2295
|
const managed = ledger.copies[target];
|
|
2275
2296
|
if (!managed || managed.skill !== skill || managed.agent !== canonical.agent || !removing && managed.hash !== sourceHash || skillPathProblem(canonical.directory, skill, sourceRoot)) return;
|
|
2276
2297
|
try {
|
|
@@ -2294,7 +2315,7 @@ function syncBusinessSkills(options) {
|
|
|
2294
2315
|
managed_count: 0
|
|
2295
2316
|
};
|
|
2296
2317
|
const directory = options.stateDirectory ?? getConfigDir();
|
|
2297
|
-
const contextFile =
|
|
2318
|
+
const contextFile = path6.join(directory, CONTEXT_FILE);
|
|
2298
2319
|
let unlock = null;
|
|
2299
2320
|
try {
|
|
2300
2321
|
if (options.isCurrentContext && !options.isCurrentContext()) {
|
|
@@ -2307,7 +2328,7 @@ function syncBusinessSkills(options) {
|
|
|
2307
2328
|
report.status = "stale";
|
|
2308
2329
|
return report;
|
|
2309
2330
|
}
|
|
2310
|
-
unlock = takeLock(
|
|
2331
|
+
unlock = takeLock(path6.join(directory, LOCK_FILE));
|
|
2311
2332
|
if (!unlock) {
|
|
2312
2333
|
report.status = "busy";
|
|
2313
2334
|
return report;
|
|
@@ -2316,7 +2337,7 @@ function syncBusinessSkills(options) {
|
|
|
2316
2337
|
report.status = "stale";
|
|
2317
2338
|
return report;
|
|
2318
2339
|
}
|
|
2319
|
-
const ledgerFile =
|
|
2340
|
+
const ledgerFile = path6.join(directory, LEDGER_FILE);
|
|
2320
2341
|
const ledger = readLedger(ledgerFile);
|
|
2321
2342
|
const packageVersion = options.packageVersion ?? "unknown";
|
|
2322
2343
|
const history = historicalCliSkills(options);
|
|
@@ -2370,7 +2391,7 @@ function syncBusinessSkills(options) {
|
|
|
2370
2391
|
for (const name of skills) {
|
|
2371
2392
|
const state = getSkillBusinessState(name, options.businesses);
|
|
2372
2393
|
if (options.mode !== "adopt" && state === void 0) continue;
|
|
2373
|
-
const source =
|
|
2394
|
+
const source = path6.join(options.skillsDirectory, name);
|
|
2374
2395
|
const sourceHash = bundled.some((skill) => skill.name === name) ? skillCopyHash(source, true) : null;
|
|
2375
2396
|
if (!sourceHash && options.mode === "adopt") throw new Error("Complete package Skill source is missing.");
|
|
2376
2397
|
for (const target of targets) {
|
|
@@ -2395,7 +2416,7 @@ function syncBusinessSkills(options) {
|
|
|
2395
2416
|
}
|
|
2396
2417
|
const legacyLink2 = node.type === "symlink" ? legacySkillLink(item.path, name, options.skillsDirectory, sourceHash ?? "", targets, ledger, true) : void 0;
|
|
2397
2418
|
const canonical = targets.find((copy) => copy.agent === "universal");
|
|
2398
|
-
const historicalLink = node.type === "symlink" && canonical && directInstallerLink(item.path,
|
|
2419
|
+
const historicalLink = node.type === "symlink" && canonical && directInstallerLink(item.path, path6.join(canonical.directory, name), node.link);
|
|
2399
2420
|
const historicalCopy = history.names.has(name) && (target.agent === "universal" && node.type !== "symlink" || historicalLink);
|
|
2400
2421
|
if (!managed && (legacyLink2 || historicalCopy)) {
|
|
2401
2422
|
ledger.copies[item.path] = {
|
|
@@ -2558,8 +2579,8 @@ function syncRefreshedBusinessSkills(refresh, businesses) {
|
|
|
2558
2579
|
if (!Object.keys(states).length) return;
|
|
2559
2580
|
try {
|
|
2560
2581
|
const pkg = getLocalCliPackageInfo();
|
|
2561
|
-
const options = { ...refresh, skillsDirectory:
|
|
2562
|
-
if (!fs5.existsSync(
|
|
2582
|
+
const options = { ...refresh, skillsDirectory: path7.join(pkg.root, "skills"), businesses: states, packageVersion: pkg.version };
|
|
2583
|
+
if (!fs5.existsSync(path7.join(getConfigDir(), "business-skills.json"))) {
|
|
2563
2584
|
const adoption = syncBusinessSkills({ ...options, mode: "adopt" });
|
|
2564
2585
|
if (["failed", "busy", "stale"].includes(adoption.status)) {
|
|
2565
2586
|
if (adoption.status !== "stale") process.stderr.write("[ae-cli] Skills could not be synchronized. Retry: ae-cli config refresh\n");
|
|
@@ -2579,7 +2600,7 @@ function syncRefreshedBusinessSkills(refresh, businesses) {
|
|
|
2579
2600
|
var BUSINESS_CONFIG_TTL_MS = 10 * 60 * 1e3;
|
|
2580
2601
|
var UNAVAILABLE_TTL_MS = 5 * 60 * 1e3;
|
|
2581
2602
|
function cachePath() {
|
|
2582
|
-
return
|
|
2603
|
+
return path8.join(getConfigDir(), "business-config.json");
|
|
2583
2604
|
}
|
|
2584
2605
|
function cacheKey(host, token) {
|
|
2585
2606
|
return `${normalizeUrl(host)}#${crypto3.createHash("sha256").update(token).digest("hex")}`;
|
|
@@ -2598,7 +2619,7 @@ function remember(host, token, entry) {
|
|
|
2598
2619
|
const target = cachePath();
|
|
2599
2620
|
const temporary = `${target}.${process.pid}.${crypto3.randomBytes(6).toString("hex")}.tmp`;
|
|
2600
2621
|
try {
|
|
2601
|
-
fs6.mkdirSync(
|
|
2622
|
+
fs6.mkdirSync(path8.dirname(target), { recursive: true });
|
|
2602
2623
|
fs6.writeFileSync(temporary, JSON.stringify(store), { encoding: "utf8", mode: 384 });
|
|
2603
2624
|
fs6.renameSync(temporary, target);
|
|
2604
2625
|
fs6.chmodSync(target, 384);
|
|
@@ -2673,7 +2694,7 @@ async function readBusinessConfigForExecution(hostOverride, synchronizeSkills =
|
|
|
2673
2694
|
const token = peekCliToken(host);
|
|
2674
2695
|
if (!token) return {};
|
|
2675
2696
|
return await resolveBusinessConfig(host, token, async () => {
|
|
2676
|
-
const { fetchCliConfig: fetchCliConfig2 } = await import("./compat-check-
|
|
2697
|
+
const { fetchCliConfig: fetchCliConfig2 } = await import("./compat-check-L3C7HCVG.js");
|
|
2677
2698
|
return fetchCliConfig2(host, token);
|
|
2678
2699
|
}, Date.now(), synchronizeSkills);
|
|
2679
2700
|
} catch {
|
|
@@ -2704,9 +2725,10 @@ function newInstallationReport(packageName, version, dryRun = false) {
|
|
|
2704
2725
|
return {
|
|
2705
2726
|
ok: false,
|
|
2706
2727
|
dry_run: dryRun,
|
|
2707
|
-
// Keep the next interaction visible before
|
|
2728
|
+
// Keep the next interaction and detected language visible before Skill synchronization details.
|
|
2708
2729
|
next_action: void 0,
|
|
2709
2730
|
interaction: void 0,
|
|
2731
|
+
local_language: void 0,
|
|
2710
2732
|
cli: { package: packageName, version, path: null, entrypoint: null, verified: false, action: "pending", warnings: [] },
|
|
2711
2733
|
skills: {
|
|
2712
2734
|
directory: globalSkillsDirectory(),
|
|
@@ -2732,7 +2754,7 @@ function failInstallation(report, stage, message, cause = "validation") {
|
|
|
2732
2754
|
function installPlan(packageName, version, root = "<npm-root>") {
|
|
2733
2755
|
const config = distribution(packageName);
|
|
2734
2756
|
const target = exactVersion(version);
|
|
2735
|
-
const executable =
|
|
2757
|
+
const executable = path9.join(root, packageName, "bin", "ae-cli.js");
|
|
2736
2758
|
return [
|
|
2737
2759
|
`npm install -g ${packageName}@${target} --registry=${config.registry}`,
|
|
2738
2760
|
`node ${JSON.stringify(executable)} install`
|
|
@@ -2752,7 +2774,7 @@ function skipGlobalSkillReason() {
|
|
|
2752
2774
|
}
|
|
2753
2775
|
function readPackage(root) {
|
|
2754
2776
|
try {
|
|
2755
|
-
return JSON.parse(fs7.readFileSync(
|
|
2777
|
+
return JSON.parse(fs7.readFileSync(path9.join(root, "package.json"), "utf8"));
|
|
2756
2778
|
} catch {
|
|
2757
2779
|
return null;
|
|
2758
2780
|
}
|
|
@@ -2765,13 +2787,13 @@ function linked(root) {
|
|
|
2765
2787
|
}
|
|
2766
2788
|
}
|
|
2767
2789
|
function cliBinBelongsToPackage(bin, packageRoot, platform) {
|
|
2768
|
-
const entry = fs7.realpathSync(
|
|
2790
|
+
const entry = fs7.realpathSync(path9.join(packageRoot, "bin", "ae-cli.js"));
|
|
2769
2791
|
if (platform !== "win32") return fs7.realpathSync(bin) === entry;
|
|
2770
2792
|
const shim = fs7.readFileSync(bin, "utf8");
|
|
2771
2793
|
const targets = [...shim.matchAll(/"%(?:dp0%|~dp0)[\\/]([^"\r\n]+)"/gi)];
|
|
2772
2794
|
return targets.some(([, relative]) => {
|
|
2773
2795
|
try {
|
|
2774
|
-
const target =
|
|
2796
|
+
const target = path9.resolve(path9.dirname(bin), relative.replace(/\\/g, path9.sep));
|
|
2775
2797
|
return fs7.realpathSync(target).toLowerCase() === entry.toLowerCase();
|
|
2776
2798
|
} catch {
|
|
2777
2799
|
return false;
|
|
@@ -2813,9 +2835,9 @@ function runInstallation(options = {}) {
|
|
|
2813
2835
|
const prefixResult = runner(npm, ["prefix", "-g"], 15e3);
|
|
2814
2836
|
const globalRoot = rootResult.stdout.trim();
|
|
2815
2837
|
const prefix = prefixResult.stdout.trim();
|
|
2816
|
-
if (!commandSucceeded(rootResult) || !commandSucceeded(prefixResult) || !
|
|
2817
|
-
const packageRoot =
|
|
2818
|
-
const bin = platform === "win32" ?
|
|
2838
|
+
if (!commandSucceeded(rootResult) || !commandSucceeded(prefixResult) || !path9.isAbsolute(globalRoot) || !path9.isAbsolute(prefix) || /[\r\n]/.test(globalRoot + prefix)) return failInstallation(report, stage, "Cannot resolve npm global root and prefix. Check npm configuration.");
|
|
2839
|
+
const packageRoot = path9.join(globalRoot, packageName);
|
|
2840
|
+
const bin = platform === "win32" ? path9.join(prefix, "ae-cli.cmd") : path9.join(prefix, "bin", "ae-cli");
|
|
2819
2841
|
report.cli.path = bin;
|
|
2820
2842
|
const env = options.env ?? process.env;
|
|
2821
2843
|
const installedBefore = readPackage(packageRoot);
|
|
@@ -2838,8 +2860,8 @@ function runInstallation(options = {}) {
|
|
|
2838
2860
|
};
|
|
2839
2861
|
const generation = reserveBusinessSkillContext({ ...identity, stateDirectory });
|
|
2840
2862
|
context = { ...identity, stateDirectory, generation, isCurrentContext };
|
|
2841
|
-
if (!fs7.existsSync(
|
|
2842
|
-
const previousSkills =
|
|
2863
|
+
if (!fs7.existsSync(path9.join(stateDirectory, "business-skills.json")) && installedBefore?.name === packageName) {
|
|
2864
|
+
const previousSkills = path9.join(packageRoot, "skills");
|
|
2843
2865
|
try {
|
|
2844
2866
|
readInstallableSkills(previousSkills);
|
|
2845
2867
|
syncSkills({ ...context, skillsDirectory: previousSkills, businesses: {}, mode: "adopt", packageVersion: installedBefore.version });
|
|
@@ -2868,12 +2890,12 @@ function runInstallation(options = {}) {
|
|
|
2868
2890
|
if (!cliBinBelongsToPackage(bin, packageRoot, platform)) return failInstallation(report, stage, "The global executable does not belong to the installed CLI package.");
|
|
2869
2891
|
const versionResult = runner(bin, ["--version"], 15e3);
|
|
2870
2892
|
if (!commandSucceeded(versionResult) || versionResult.stdout.trim() !== target) return failInstallation(report, stage, "ae-cli --version did not return the requested version. Refresh the shell command cache and check npm bin links.");
|
|
2871
|
-
report.cli.entrypoint = fs7.realpathSync(
|
|
2893
|
+
report.cli.entrypoint = fs7.realpathSync(path9.join(packageRoot, "bin", "ae-cli.js"));
|
|
2872
2894
|
report.cli.verified = true;
|
|
2873
2895
|
const pathKey = platform === "win32" ? Object.keys(env).find((key) => key.toLowerCase() === "path") : "PATH";
|
|
2874
|
-
const installedPathBin = (env[pathKey ?? "PATH"] ?? "").split(platform === "win32" ? ";" :
|
|
2896
|
+
const installedPathBin = (env[pathKey ?? "PATH"] ?? "").split(platform === "win32" ? ";" : path9.delimiter).filter(Boolean).map((dir) => path9.join(dir.replace(/^"(.*)"$/, "$1"), platform === "win32" ? "ae-cli.cmd" : "ae-cli")).find((file) => fs7.existsSync(file) && !file.includes(`${path9.sep}_npx${path9.sep}`));
|
|
2875
2897
|
if (!installedPathBin || fs7.realpathSync(installedPathBin) !== fs7.realpathSync(bin)) {
|
|
2876
|
-
report.cli.warnings.push(`Add ${
|
|
2898
|
+
report.cli.warnings.push(`Add ${path9.dirname(bin)} to the front of PATH and refresh the shell command cache. The absolute executable was verified.`);
|
|
2877
2899
|
report.next_steps.push(`Use the verified executable at ${bin}, or correct PATH before invoking ae-cli.`);
|
|
2878
2900
|
}
|
|
2879
2901
|
if (skipSkills) {
|
|
@@ -2882,7 +2904,7 @@ function runInstallation(options = {}) {
|
|
|
2882
2904
|
progress(`[ae-cli] [3/4] ${skipSkills}`);
|
|
2883
2905
|
} else if (context) {
|
|
2884
2906
|
stage = "skills_local";
|
|
2885
|
-
const skillsPath =
|
|
2907
|
+
const skillsPath = path9.join(packageRoot, "skills");
|
|
2886
2908
|
const skills = readInstallableSkills(skillsPath);
|
|
2887
2909
|
if (!isBusinessSkillContextCurrent(context)) {
|
|
2888
2910
|
return failInstallation(report, stage, "The active environment changed during CLI installation. Re-run install or update to synchronize its Skills.");
|
|
@@ -2938,13 +2960,11 @@ function runInstallation(options = {}) {
|
|
|
2938
2960
|
report.ok = true;
|
|
2939
2961
|
return report;
|
|
2940
2962
|
}
|
|
2941
|
-
const localLanguage = localRegistrationLanguage(env);
|
|
2942
|
-
const language = localLanguage ?? "en-US";
|
|
2943
|
-
const deviceMarket = onboardingDeviceMarket(env);
|
|
2944
2963
|
if (guideAccountSetup) {
|
|
2964
|
+
const localLanguage = localRegistrationLanguage(env, platform, runner);
|
|
2945
2965
|
if (localLanguage) report.local_language = localLanguage;
|
|
2946
|
-
report.onboarding_market =
|
|
2947
|
-
const onboardingSkillPath =
|
|
2966
|
+
report.onboarding_market = onboardingDeviceMarket(localLanguage);
|
|
2967
|
+
const onboardingSkillPath = path9.join(packageRoot, "skills", "ae-onboarding", "SKILL.md");
|
|
2948
2968
|
if (fs7.existsSync(onboardingSkillPath)) report.onboarding_skill_path = onboardingSkillPath;
|
|
2949
2969
|
if (report.auth.authenticated === true) {
|
|
2950
2970
|
report.next_action = isOnboardingProgressHost(report.auth.host ?? void 0) ? "check_onboarding" : "continue_using_ae";
|
|
@@ -2971,14 +2991,17 @@ function runInstallation(options = {}) {
|
|
|
2971
2991
|
}
|
|
2972
2992
|
if (chooseAccount || !report.auth.host) {
|
|
2973
2993
|
const source = cliEntrySource(void 0, env);
|
|
2974
|
-
const registration = aeRegistrationUrl(chooseAccount ? deviceMarket === "cn" ? "zh-CN" : "en-US" : language, env, source);
|
|
2975
2994
|
if (chooseAccount) {
|
|
2976
2995
|
report.next_steps.push(`After the user confirms signup in the overseas test environment, run ae-cli analysis onboarding run --website-env test --region us --source ${source} --browser system --format json. Use jp or kr for the corresponding requested test market and keep the returned session_id.`);
|
|
2977
|
-
report.next_steps.push(
|
|
2996
|
+
report.next_steps.push(
|
|
2997
|
+
"For production signup, honor an explicitly requested or confirmed market first. Otherwise compare local_language with the language of the user\u2019s own request, excluding commands, links, quoted text, and picker labels. Map Chinese to cn, English to us, Japanese to jp, and Korean to kr. If both signals agree or only one maps to a market, use that market. When the two markets differ, show only those two options and wait. Use us if neither language maps to a market.",
|
|
2998
|
+
`After the user chooses \u201CCreate an AE account\u201D or directly asks to sign up, run ae-cli analysis onboarding run --region <market> --source ${source} --browser system --format json with the resolved market. Pass --language separately for the display preference. If the browser cannot open, share the returned login_url. Read the returned skill_path and resume with its session_id after sign-in.`
|
|
2999
|
+
);
|
|
2978
3000
|
} else {
|
|
3001
|
+
const language = registrationLanguage(void 0, env);
|
|
3002
|
+
const registration = aeRegistrationUrl(language, env, source);
|
|
2979
3003
|
report.next_steps.push(`New or returning website users: for guided website verification, run ae-cli analysis onboarding run --language ${language} --source ${source} --browser system. For manual registration or sign-in, use ${registration} in the system default browser.`);
|
|
2980
3004
|
}
|
|
2981
|
-
if (chooseAccount) report.next_steps.push(`Chinese device locales, including Traditional Chinese, default to China. Other device locales default to the United States. The current default is ${deviceMarket}. Explicit --region cn|jp|kr|us still selects the requested market. Display language changes presentation only.`);
|
|
2982
3005
|
}
|
|
2983
3006
|
if (chooseAccount) report.next_steps.push("Existing AE users: confirm their original AE environment URL and use it for login. Ask for that URL if it is unknown.");
|
|
2984
3007
|
else if (!report.auth.host) report.next_steps.push("Existing AE users: use your original environment URL, or ask your administrator.");
|
|
@@ -3000,10 +3023,10 @@ var LOCK_STALE_MS = 10 * 60 * 1e3;
|
|
|
3000
3023
|
var SYNC_STATE_FILE = "version-sync.json";
|
|
3001
3024
|
var SYNC_LOCK_FILE = "version-sync.lock";
|
|
3002
3025
|
function syncStatePath() {
|
|
3003
|
-
return
|
|
3026
|
+
return path10.join(getConfigDir(), SYNC_STATE_FILE);
|
|
3004
3027
|
}
|
|
3005
3028
|
function syncLockPath() {
|
|
3006
|
-
return
|
|
3029
|
+
return path10.join(getConfigDir(), SYNC_LOCK_FILE);
|
|
3007
3030
|
}
|
|
3008
3031
|
function readSyncStore() {
|
|
3009
3032
|
try {
|
|
@@ -3212,11 +3235,11 @@ function autoSyncDirection(current, expected) {
|
|
|
3212
3235
|
// src/core/feature-config.ts
|
|
3213
3236
|
import crypto5 from "crypto";
|
|
3214
3237
|
import fs9 from "fs";
|
|
3215
|
-
import
|
|
3238
|
+
import path11 from "path";
|
|
3216
3239
|
var FEATURE_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
3217
3240
|
var UNAVAILABLE_TTL_MS2 = 5 * 60 * 1e3;
|
|
3218
3241
|
function cachePath2() {
|
|
3219
|
-
return
|
|
3242
|
+
return path11.join(getConfigDir(), "feature-config.json");
|
|
3220
3243
|
}
|
|
3221
3244
|
function cacheKey2(host, token) {
|
|
3222
3245
|
const fingerprint = crypto5.createHash("sha256").update(token).digest("hex");
|
|
@@ -3234,7 +3257,7 @@ function writeStore(store) {
|
|
|
3234
3257
|
const target = cachePath2();
|
|
3235
3258
|
const temp = `${target}.${process.pid}.${crypto5.randomBytes(6).toString("hex")}.tmp`;
|
|
3236
3259
|
try {
|
|
3237
|
-
fs9.mkdirSync(
|
|
3260
|
+
fs9.mkdirSync(path11.dirname(target), { recursive: true });
|
|
3238
3261
|
fs9.writeFileSync(temp, JSON.stringify(store), { encoding: "utf8", mode: 384 });
|
|
3239
3262
|
fs9.renameSync(temp, target);
|
|
3240
3263
|
fs9.chmodSync(target, 384);
|
|
@@ -3287,7 +3310,7 @@ var NOTIFY_INTERVAL_MS = 24 * 60 * 60 * 1e3;
|
|
|
3287
3310
|
var FETCH_TIMEOUT_MS = 3e3;
|
|
3288
3311
|
var CLI_CONFIG_PATH = "/v1/ta/cli/config";
|
|
3289
3312
|
function cacheFilePath() {
|
|
3290
|
-
return
|
|
3313
|
+
return path12.join(getConfigDir(), "compat-check.json");
|
|
3291
3314
|
}
|
|
3292
3315
|
function readStore3() {
|
|
3293
3316
|
try {
|
|
@@ -3679,6 +3702,7 @@ export {
|
|
|
3679
3702
|
readProgress,
|
|
3680
3703
|
verifyAndCompleteProgress,
|
|
3681
3704
|
normalizeRegistrationLanguage,
|
|
3705
|
+
localRegistrationLanguage,
|
|
3682
3706
|
onboardingDeviceMarket,
|
|
3683
3707
|
registrationLanguage,
|
|
3684
3708
|
registrationMarket,
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
readOutputMetadata,
|
|
7
7
|
unwrapOutputData,
|
|
8
8
|
withOutputMetadata
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4MOCV6HU.js";
|
|
10
10
|
import {
|
|
11
11
|
CapabilityGatewayError,
|
|
12
12
|
fetchCapabilityGateway,
|
|
13
13
|
requestCapabilityGateway
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7KBENPQF.js";
|
|
15
15
|
import {
|
|
16
16
|
PermissionError
|
|
17
17
|
} from "./chunk-3ZQY7SLZ.js";
|
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
postAgentApi,
|
|
10
10
|
putAgentApi,
|
|
11
11
|
uploadAgentApi
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CBNE2S44.js";
|
|
13
13
|
import {
|
|
14
14
|
TeAgentApiError,
|
|
15
15
|
createTeAgentApiError
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-3DTMWDJX.js";
|
|
17
17
|
import {
|
|
18
18
|
CliValidationError,
|
|
19
19
|
isApiErrorType
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
internalCallSourceHeaders
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-FKTVD63C.js";
|
|
5
5
|
import {
|
|
6
6
|
logger
|
|
7
7
|
} from "./chunk-MTK4ZE7W.js";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createCapabilityCommand
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-3FSYICDW.js";
|
|
5
5
|
import {
|
|
6
6
|
registerCapabilityGatewayRoute
|
|
7
7
|
} from "./chunk-AWW2T2WL.js";
|
|
8
8
|
import {
|
|
9
9
|
executeCapabilityWithEnvelope
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-7KBENPQF.js";
|
|
11
11
|
import {
|
|
12
12
|
CliApiError,
|
|
13
13
|
CliValidationError
|