@thinkingai/ae-cli 6.1.33 → 6.1.35

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.
Files changed (85) hide show
  1. package/README.md +2 -2
  2. package/README.zh.md +2 -6
  3. package/cli-installation-guide.md +18 -4
  4. package/dist/{ai-monitor-OHTSU6SV.js → ai-monitor-TVRFVZBH.js} +10 -9
  5. package/dist/ai-monitor.js +17 -16
  6. package/dist/{auth-2MOK4OI6.js → auth-JAXLMPBB.js} +25 -317
  7. package/dist/{automation-6L6IAYRK.js → automation-OQ647CSW.js} +7 -6
  8. package/dist/{capability-EMIHQJA3.js → capability-2Z4ZXTPD.js} +18 -16
  9. package/dist/chunk-2H3SFJE3.js +344 -0
  10. package/dist/{chunk-RC3PPCYD.js → chunk-3PZNM5KN.js} +3 -3
  11. package/dist/chunk-3ZQY7SLZ.js +147 -0
  12. package/dist/{chunk-NNK3JBH4.js → chunk-6E6HCTP2.js} +2 -2
  13. package/dist/{local-data-upload-client-YTWMAAGE.js → chunk-6IUTXRAD.js} +32 -4
  14. package/dist/{chunk-VLOGOM7N.js → chunk-CYZV5AXW.js} +8 -5
  15. package/dist/{chunk-O45NOIWR.js → chunk-DE5XHQQ6.js} +2 -2
  16. package/dist/{chunk-KD5UC33N.js → chunk-E5CJI7L3.js} +7 -5
  17. package/dist/{chunk-UCMO4LKL.js → chunk-EQMGH32F.js} +2 -2
  18. package/dist/{chunk-E3ONSFUN.js → chunk-FNACCKQR.js} +211 -12
  19. package/dist/{chunk-2I5SZ5DS.js → chunk-GD5JSAGV.js} +2 -2
  20. package/dist/{chunk-EFGUBGA6.js → chunk-GYODT7C4.js} +1 -1
  21. package/dist/chunk-HBI7IQH3.js +1207 -0
  22. package/dist/{chunk-AMURHMS3.js → chunk-IGU3R2JD.js} +4 -4
  23. package/dist/{chunk-YE6MJB5V.js → chunk-IWMDPHMI.js} +3 -3
  24. package/dist/{chunk-LFJ7N36I.js → chunk-L7MT53VM.js} +5 -3
  25. package/dist/{chunk-HIMOBNEY.js → chunk-LXRALNNA.js} +2 -2
  26. package/dist/{chunk-BQFLABJQ.js → chunk-M2OCZRVX.js} +7 -5
  27. package/dist/{chunk-R2SVAO4G.js → chunk-MTK4ZE7W.js} +3 -143
  28. package/dist/{chunk-7DHSB3FL.js → chunk-NK5PS5X7.js} +3 -3
  29. package/dist/{chunk-HQED4YB4.js → chunk-NPH5J65M.js} +1 -1
  30. package/dist/{chunk-EWVEAERM.js → chunk-Q764EZND.js} +78 -72
  31. package/dist/chunk-QOJXLXDJ.js +55 -0
  32. package/dist/{chunk-THTROEGD.js → chunk-QPUPWGZ3.js} +1 -1
  33. package/dist/{chunk-XZDKAR4N.js → chunk-RLPMXKDQ.js} +8921 -10119
  34. package/dist/{chunk-DWAG2QJM.js → chunk-S74XV3A6.js} +4 -4
  35. package/dist/{chunk-COOMXFUG.js → chunk-SHB7A2JE.js} +3 -3
  36. package/dist/{chunk-PLNS5J33.js → chunk-UWQXGF44.js} +17 -9
  37. package/dist/{data-integration-UNJ7EPW2.js → chunk-V6UKLIM6.js} +160 -2258
  38. package/dist/{chunk-4IQYPWCX.js → chunk-VPLRZSMY.js} +18 -10
  39. package/dist/{chunk-KA5WKR5P.js → chunk-Z6WSCIHM.js} +2 -2
  40. package/dist/{community-report-client-ULRNXLQV.js → community-report-client-5VNT6HCV.js} +4 -2
  41. package/dist/{compat-check-CADG7GND.js → compat-check-E7AQ7UCG.js} +5 -4
  42. package/dist/{config-PFD3KWQG.js → config-PGSUWIK5.js} +15 -11
  43. package/dist/{context-SOQDFZIB.js → context-Y2A6QIS3.js} +5 -4
  44. package/dist/conversion-4FR3RA45.js +16 -0
  45. package/dist/data-integration-EIF5QHYF.js +2138 -0
  46. package/dist/{evaluation-Q3AIGFOG.js → evaluation-OZM54MES.js} +6 -5
  47. package/dist/index.js +74 -51
  48. package/dist/local-data-upload-client-2U3LFD7Z.js +16 -0
  49. package/dist/{memory-HKNGUIPK.js → memory-6QMZS4HF.js} +7 -6
  50. package/dist/{metadata-GFWR5ZHC.js → metadata-7MZ3CJ2N.js} +10 -9
  51. package/dist/{model-NAKQWK4W.js → model-LEYRQKOS.js} +8 -7
  52. package/dist/{personal-semantic-preference-JCTKXLC3.js → personal-semantic-preference-SWOUNDWJ.js} +9 -8
  53. package/dist/{project-semantic-B2NWQOKK.js → project-semantic-M2DDPAMD.js} +9 -8
  54. package/dist/{sync-UQH4J4BD.js → sync-PWC63JCO.js} +16 -15
  55. package/dist/{te-agent-L6EYFQCC.js → te-agent-S7UH657Z.js} +11 -9
  56. package/dist/{te-analysis-U7NNOY66.js → te-analysis-BK6PE333.js} +281 -214
  57. package/dist/{te-community-3UQEW3KD.js → te-community-OLNTKGCW.js} +12 -10
  58. package/dist/{te-dataops-SUNYXF5G.js → te-dataops-XUWRIF5R.js} +12 -10
  59. package/dist/{te-engage-KMXZJ2KN.js → te-engage-I3I4FJOM.js} +9 -8
  60. package/dist/{te-experiment-IEYKP6VC.js → te-experiment-XSDUL4KH.js} +9 -8
  61. package/dist/{te-kb-MT3V5ZMH.js → te-kb-QFH3YLFQ.js} +15 -13
  62. package/dist/{te-system-F4ZU2HRQ.js → te-system-DB5Z3LLF.js} +7 -6
  63. package/dist/{te-team-M6E6XQ5H.js → te-team-UADF2HBO.js} +9 -8
  64. package/dist/{things-FRLBZV2Z.js → things-G2QFXDK7.js} +9 -8
  65. package/dist/{update-NULYHVE6.js → update-6I366ICW.js} +7 -8
  66. package/dist/web-runtime-3XFREWRF.js +2367 -0
  67. package/dist/{workspace-Z7L33OBQ.js → workspace-RZESYB6T.js} +7 -6
  68. package/package.json +4 -3
  69. package/skills/ae-analysis/SKILL.md +1 -1
  70. package/skills/ae-data-integration/references/ue-mapping.md +2 -0
  71. package/skills/ae-onboarding/SKILL.md +64 -0
  72. package/skills/ae-onboarding/references/business-sdk.md +8 -0
  73. package/skills/ae-onboarding/references/demo-operations.md +79 -0
  74. package/skills/ae-onboarding/references/import.md +19 -0
  75. package/skills/ae-onboarding/references/onboarding_experiment_launch.md +12 -0
  76. package/skills/ae-onboarding/references/onboarding_experiment_plan.md +14 -0
  77. package/skills/ae-onboarding/references/onboarding_growth.md +36 -0
  78. package/skills/ae-onboarding/references/onboarding_run.md +11 -0
  79. package/skills/ae-onboarding/references/onboarding_status.md +5 -0
  80. package/skills/ae-onboarding/scripts/experiment-preset.json +252 -0
  81. package/skills/ae-onboarding/scripts/experiment-requests.mjs +120 -0
  82. package/skills/ae-onboarding/scripts/generate.mjs +170 -0
  83. package/skills/ae-onboarding/scripts/resolve-experiment-preset.mjs +26 -0
  84. package/skills/ae-onboarding/scripts/web-journey.mjs +39 -0
  85. package/dist/chunk-6ZIQV5GW.js +0 -26
@@ -3,7 +3,7 @@ import {
3
3
  logger,
4
4
  normalizeUrl,
5
5
  readExternalCliToken
6
- } from "./chunk-R2SVAO4G.js";
6
+ } from "./chunk-MTK4ZE7W.js";
7
7
 
8
8
  // src/core/sandbox-runtime.ts
9
9
  import { homedir } from "os";
@@ -288,13 +288,13 @@ function getConfigDir() {
288
288
  }
289
289
 
290
290
  export {
291
- getSandboxRuntimeRoot,
292
- isAeSandboxRuntime,
293
- getAeSandboxDetectionReason,
294
291
  safeJsonParse,
295
292
  safeReadJsonFile,
296
293
  stringifyJsonRequest,
297
294
  parseJsonRequest,
295
+ getSandboxRuntimeRoot,
296
+ isAeSandboxRuntime,
297
+ getAeSandboxDetectionReason,
298
298
  readSandboxCliTokenEntry,
299
299
  getFallbackCliToken,
300
300
  loadConfig,
@@ -1,17 +1,17 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  createCapabilityCommand
4
- } from "./chunk-RC3PPCYD.js";
4
+ } from "./chunk-3PZNM5KN.js";
5
5
  import {
6
6
  registerCapabilityGatewayRoute
7
7
  } from "./chunk-AWW2T2WL.js";
8
8
  import {
9
9
  executeCapabilityWithEnvelope
10
- } from "./chunk-4IQYPWCX.js";
10
+ } from "./chunk-VPLRZSMY.js";
11
11
  import {
12
12
  CliApiError,
13
13
  CliValidationError
14
- } from "./chunk-R2SVAO4G.js";
14
+ } from "./chunk-3ZQY7SLZ.js";
15
15
 
16
16
  // src/commands/ai-monitor/shared.ts
17
17
  function createAiMonitorCapabilityCommand(config) {
@@ -1,11 +1,13 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  internalCallSourceHeaders
4
- } from "./chunk-PLNS5J33.js";
4
+ } from "./chunk-UWQXGF44.js";
5
5
  import {
6
- CliValidationError,
7
6
  logger
8
- } from "./chunk-R2SVAO4G.js";
7
+ } from "./chunk-MTK4ZE7W.js";
8
+ import {
9
+ CliValidationError
10
+ } from "./chunk-3ZQY7SLZ.js";
9
11
 
10
12
  // src/core/eval-endpoint.ts
11
13
  function resolveEvaluationHost(host) {
@@ -10,10 +10,10 @@ import {
10
10
  postToMainApp,
11
11
  putToMainApp,
12
12
  uploadToMainApp
13
- } from "./chunk-VLOGOM7N.js";
13
+ } from "./chunk-CYZV5AXW.js";
14
14
  import {
15
15
  clearCliTokenCache
16
- } from "./chunk-PLNS5J33.js";
16
+ } from "./chunk-UWQXGF44.js";
17
17
 
18
18
  // src/core/resource-package-client.ts
19
19
  function checkPath(path) {
@@ -6,19 +6,21 @@ import {
6
6
  evalRequest,
7
7
  evaluationResponseStatus,
8
8
  resolveEvaluationHost
9
- } from "./chunk-LFJ7N36I.js";
9
+ } from "./chunk-L7MT53VM.js";
10
10
  import {
11
11
  getCliToken,
12
12
  internalCallSourceHeaders
13
- } from "./chunk-PLNS5J33.js";
13
+ } from "./chunk-UWQXGF44.js";
14
14
  import {
15
15
  isAeSandboxRuntime
16
- } from "./chunk-AMURHMS3.js";
16
+ } from "./chunk-IGU3R2JD.js";
17
17
  import {
18
- CliValidationError,
19
18
  externalCliTokenRequestOptions,
20
19
  readExternalCliToken
21
- } from "./chunk-R2SVAO4G.js";
20
+ } from "./chunk-MTK4ZE7W.js";
21
+ import {
22
+ CliValidationError
23
+ } from "./chunk-3ZQY7SLZ.js";
22
24
 
23
25
  // src/core/eval-session.ts
24
26
  var SESSION_PATH = "/api/sandbox/agent/evaluation/session";
@@ -1,135 +1,7 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
9
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
10
- }) : x)(function(x) {
11
- if (typeof require !== "undefined") return require.apply(this, arguments);
12
- throw Error('Dynamic require of "' + x + '" is not supported');
13
- });
14
- var __esm = (fn, res, err) => function __init() {
15
- if (err) throw err[0];
16
- try {
17
- return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
18
- } catch (e) {
19
- throw err = [e], e;
20
- }
21
- };
22
- var __commonJS = (cb, mod) => function __require2() {
23
- try {
24
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
- } catch (e) {
26
- throw mod = 0, e;
27
- }
28
- };
29
- var __export = (target, all) => {
30
- for (var name in all)
31
- __defProp(target, name, { get: all[name], enumerable: true });
32
- };
33
- var __copyProps = (to, from, except, desc) => {
34
- if (from && typeof from === "object" || typeof from === "function") {
35
- for (let key of __getOwnPropNames(from))
36
- if (!__hasOwnProp.call(to, key) && key !== except)
37
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
38
- }
39
- return to;
40
- };
41
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
42
- // If the importer is in node compatibility mode or this is not an ESM
43
- // file that has been converted to a CommonJS file using a Babel-
44
- // compatible transform (i.e. "__esModule" has not been set), then set
45
- // "default" to the CommonJS "module.exports" for node compatibility.
46
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
47
- mod
48
- ));
49
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
50
-
51
- // src/core/errors.ts
52
- var PermissionError = class extends Error {
53
- constructor(message, code, hint, details, meta) {
54
- super(message);
55
- this.code = code;
56
- this.hint = hint;
57
- this.details = details;
58
- this.meta = meta;
59
- this.name = "PermissionError";
60
- }
61
- code;
62
- hint;
63
- details;
64
- meta;
65
- };
66
- function isApiErrorType(value) {
67
- return value === "auth" || value === "permission" || value === "validation" || value === "not_found" || value === "api";
68
- }
69
- var CliValidationError = class extends Error {
70
- code;
71
- hint;
72
- location;
73
- constructor(message, options = {}) {
74
- super(message);
75
- this.name = "CliValidationError";
76
- this.code = options.code;
77
- this.hint = options.hint;
78
- if (options.location) {
79
- const location = {};
80
- if (typeof options.location.segment === "number" && Number.isFinite(options.location.segment)) {
81
- location.segment = options.location.segment;
82
- }
83
- if (typeof options.location.record === "number" && Number.isFinite(options.location.record)) {
84
- location.record = options.location.record;
85
- }
86
- if (typeof options.location.field === "string" && options.location.field.length > 0) {
87
- location.field = options.location.field;
88
- }
89
- if (Object.keys(location).length > 0) this.location = location;
90
- }
91
- }
92
- };
93
- var CliApiError = class extends Error {
94
- code;
95
- hint;
96
- meta;
97
- constructor(message, options = {}) {
98
- super(message);
99
- this.name = "CliApiError";
100
- this.code = options.code;
101
- this.hint = options.hint;
102
- this.meta = options.meta;
103
- }
104
- };
105
- var CommunityReportError = class extends Error {
106
- code;
107
- httpStatus;
108
- hint;
109
- meta;
110
- constructor(message, options = {}) {
111
- super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
112
- this.name = "CommunityReportError";
113
- this.code = options.code;
114
- this.httpStatus = options.httpStatus;
115
- this.hint = options.hint;
116
- this.meta = options.meta;
117
- }
118
- };
119
- var LocalDataUploadError = class extends Error {
120
- code;
121
- httpStatus;
122
- hint;
123
- meta;
124
- constructor(message, options = {}) {
125
- super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
126
- this.name = "LocalDataUploadError";
127
- this.code = options.code;
128
- this.httpStatus = options.httpStatus;
129
- this.hint = options.hint;
130
- this.meta = options.meta;
131
- }
132
- };
2
+ import {
3
+ CliValidationError
4
+ } from "./chunk-3ZQY7SLZ.js";
133
5
 
134
6
  // src/core/kb-read-context.ts
135
7
  import fs from "fs";
@@ -366,18 +238,6 @@ var Logger = class {
366
238
  var logger = new Logger();
367
239
 
368
240
  export {
369
- __require,
370
- __esm,
371
- __commonJS,
372
- __export,
373
- __toESM,
374
- __toCommonJS,
375
- PermissionError,
376
- isApiErrorType,
377
- CliValidationError,
378
- CliApiError,
379
- CommunityReportError,
380
- LocalDataUploadError,
381
241
  kbExecutionContextRequired,
382
242
  isKbQueryPath,
383
243
  readKbExecutionContext,
@@ -6,15 +6,15 @@ import {
6
6
  readOutputMetadata,
7
7
  unwrapOutputData,
8
8
  withOutputMetadata
9
- } from "./chunk-O45NOIWR.js";
9
+ } from "./chunk-DE5XHQQ6.js";
10
10
  import {
11
11
  CapabilityGatewayError,
12
12
  fetchCapabilityGateway,
13
13
  requestCapabilityGateway
14
- } from "./chunk-4IQYPWCX.js";
14
+ } from "./chunk-VPLRZSMY.js";
15
15
  import {
16
16
  PermissionError
17
- } from "./chunk-R2SVAO4G.js";
17
+ } from "./chunk-3ZQY7SLZ.js";
18
18
 
19
19
  // src/core/analysis-async-artifact.ts
20
20
  import { randomBytes } from "crypto";
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  __commonJS,
4
4
  __require
5
- } from "./chunk-R2SVAO4G.js";
5
+ } from "./chunk-3ZQY7SLZ.js";
6
6
 
7
7
  // node_modules/process-nextick-args/index.js
8
8
  var require_process_nextick_args = __commonJS({
@@ -2,98 +2,48 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  confirmHighRiskWrite,
4
4
  requiresConfirmation
5
- } from "./chunk-EFGUBGA6.js";
6
- import {
7
- TeAgentApiError,
8
- TeAgentCredentialsError
9
- } from "./chunk-VLOGOM7N.js";
5
+ } from "./chunk-GYODT7C4.js";
10
6
  import {
11
7
  EvalApiError
12
- } from "./chunk-LFJ7N36I.js";
8
+ } from "./chunk-L7MT53VM.js";
13
9
  import {
14
10
  printError,
15
11
  printOutput
16
- } from "./chunk-O45NOIWR.js";
12
+ } from "./chunk-DE5XHQQ6.js";
13
+ import {
14
+ TeAgentApiError,
15
+ TeAgentCredentialsError
16
+ } from "./chunk-CYZV5AXW.js";
17
17
  import {
18
18
  CapabilityGatewayError
19
- } from "./chunk-4IQYPWCX.js";
19
+ } from "./chunk-VPLRZSMY.js";
20
20
  import {
21
21
  BusinessDisabledError,
22
22
  assertBusinessEnabled,
23
23
  businessForCommand,
24
24
  formatCapabilityMissCompatHint,
25
25
  readCurrentBusinessConfig
26
- } from "./chunk-E3ONSFUN.js";
26
+ } from "./chunk-FNACCKQR.js";
27
27
  import {
28
28
  CredentialStoreUnreadableError,
29
29
  SecureStoreAuthError
30
- } from "./chunk-PLNS5J33.js";
30
+ } from "./chunk-UWQXGF44.js";
31
31
  import {
32
32
  getActiveHost,
33
33
  safeJsonParse
34
- } from "./chunk-AMURHMS3.js";
34
+ } from "./chunk-IGU3R2JD.js";
35
+ import {
36
+ ExternalCliTokenError,
37
+ logger,
38
+ readKbExecutionContext
39
+ } from "./chunk-MTK4ZE7W.js";
35
40
  import {
36
41
  CliApiError,
37
42
  CliValidationError,
38
43
  CommunityReportError,
39
- ExternalCliTokenError,
40
44
  LocalDataUploadError,
41
- PermissionError,
42
- logger,
43
- readKbExecutionContext
44
- } from "./chunk-R2SVAO4G.js";
45
-
46
- // src/framework/business-filter.ts
47
- import { Help } from "commander";
48
- function commandPath(command) {
49
- const result = [];
50
- for (let current = command; current?.parent; current = current.parent) {
51
- result.unshift(current.name());
52
- }
53
- return result;
54
- }
55
- function configureBusinessCommands(program, options = {}) {
56
- const readStates = options.readStates ?? (() => readCurrentBusinessConfig(options.hostOverride));
57
- const commandBusiness = (command) => businessForCommand([...options.commandPrefix ?? [], ...commandPath(command)]);
58
- const isVisible = (command) => {
59
- const business = commandBusiness(command);
60
- return !business || readStates()[business] !== false;
61
- };
62
- const helpConfiguration = {
63
- visibleCommands(command) {
64
- return Help.prototype.visibleCommands.call(this, command).filter(isVisible);
65
- },
66
- formatHelp(command, helper) {
67
- if (!isVisible(command)) {
68
- const business = commandBusiness(command);
69
- return `The '${business}' business is not enabled for the current environment.
70
- Run: ae-cli config refresh
71
- `;
72
- }
73
- return Help.prototype.formatHelp.call(this, command, helper);
74
- }
75
- };
76
- const configureHelp = (command) => {
77
- command.configureHelp(helpConfiguration);
78
- command.commands.forEach(configureHelp);
79
- };
80
- configureHelp(program);
81
- program.on("beforeAllHelp", (context) => {
82
- if (isVisible(context.command)) return;
83
- const business = commandBusiness(context.command);
84
- context.write(`The '${business}' business is not enabled for the current environment.
85
- Run: ae-cli config refresh
86
- `);
87
- context.write = () => {
88
- };
89
- });
90
- program.hook("preAction", async (_root, actionCommand) => {
91
- const business = commandBusiness(actionCommand);
92
- if (!business) return;
93
- const opts = actionCommand.optsWithGlobals();
94
- await (options.assertEnabled ?? assertBusinessEnabled)(business, opts.host ?? options.hostOverride);
95
- });
96
- }
45
+ PermissionError
46
+ } from "./chunk-3ZQY7SLZ.js";
97
47
 
98
48
  // src/framework/program-lifecycle.ts
99
49
  async function parseProgram(program, argv = process.argv) {
@@ -165,6 +115,58 @@ function findOption(command, flag) {
165
115
  return void 0;
166
116
  }
167
117
 
118
+ // src/framework/business-filter.ts
119
+ import { Help } from "commander";
120
+ function commandPath(command) {
121
+ const result = [];
122
+ for (let current = command; current?.parent; current = current.parent) {
123
+ result.unshift(current.name());
124
+ }
125
+ return result;
126
+ }
127
+ function configureBusinessCommands(program, options = {}) {
128
+ const readStates = options.readStates ?? (() => readCurrentBusinessConfig(options.hostOverride));
129
+ const commandBusiness = (command) => businessForCommand([...options.commandPrefix ?? [], ...commandPath(command)]);
130
+ const isVisible = (command) => {
131
+ const business = commandBusiness(command);
132
+ return !business || readStates()[business] !== false;
133
+ };
134
+ const helpConfiguration = {
135
+ visibleCommands(command) {
136
+ return Help.prototype.visibleCommands.call(this, command).filter(isVisible);
137
+ },
138
+ formatHelp(command, helper) {
139
+ if (!isVisible(command)) {
140
+ const business = commandBusiness(command);
141
+ return `The '${business}' business is not enabled for the current environment.
142
+ Run: ae-cli config refresh
143
+ `;
144
+ }
145
+ return Help.prototype.formatHelp.call(this, command, helper);
146
+ }
147
+ };
148
+ const configureHelp = (command) => {
149
+ command.configureHelp(helpConfiguration);
150
+ command.commands.forEach(configureHelp);
151
+ };
152
+ configureHelp(program);
153
+ program.on("beforeAllHelp", (context) => {
154
+ if (isVisible(context.command)) return;
155
+ const business = commandBusiness(context.command);
156
+ context.write(`The '${business}' business is not enabled for the current environment.
157
+ Run: ae-cli config refresh
158
+ `);
159
+ context.write = () => {
160
+ };
161
+ });
162
+ program.hook("preAction", async (_root, actionCommand) => {
163
+ const business = commandBusiness(actionCommand);
164
+ if (!business) return;
165
+ const opts = actionCommand.optsWithGlobals();
166
+ await (options.assertEnabled ?? assertBusinessEnabled)(business, opts.host ?? options.hostOverride);
167
+ });
168
+ }
169
+
168
170
  // src/framework/runner.ts
169
171
  function missingRequiredFlagsError(cmdName, missing) {
170
172
  const names = missing.map((flag) => `--${flag.name}`);
@@ -455,18 +457,22 @@ function createRuntimeContext(cmd, opts, globalOpts) {
455
457
  let _communityReportModule = null;
456
458
  async function getCommunityReportClient() {
457
459
  if (!_communityReportModule) {
458
- _communityReportModule = await import("./community-report-client-ULRNXLQV.js");
460
+ _communityReportModule = await import("./community-report-client-5VNT6HCV.js");
459
461
  }
460
462
  return _communityReportModule;
461
463
  }
462
464
  let _localDataUploadModule = null;
463
465
  async function getLocalDataUploadClient() {
464
466
  if (!_localDataUploadModule) {
465
- _localDataUploadModule = await import("./local-data-upload-client-YTWMAAGE.js");
467
+ _localDataUploadModule = await import("./local-data-upload-client-2U3LFD7Z.js");
466
468
  }
467
469
  return _localDataUploadModule;
468
470
  }
469
471
  const ctx = {
472
+ async onboarding(action, input) {
473
+ const { invokeOnboarding } = await import("./web-runtime-3XFREWRF.js");
474
+ return invokeOnboarding(action, input);
475
+ },
470
476
  has(name) {
471
477
  return Object.prototype.hasOwnProperty.call(opts, camelCase(name));
472
478
  },
@@ -558,6 +564,6 @@ function camelCase(str) {
558
564
 
559
565
  export {
560
566
  runCommand,
561
- configureBusinessCommands,
562
- parseProgram
567
+ parseProgram,
568
+ configureBusinessCommands
563
569
  };
@@ -0,0 +1,55 @@
1
+ import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
+
3
+ // src/core/resource-url.ts
4
+ var LOCAL_BACKEND_PORTS = /* @__PURE__ */ new Set(["8992", "8996"]);
5
+ function normalizeResourceUrlFields(node, host, sourceHost = host) {
6
+ if (!node || typeof node !== "object") return;
7
+ const obj = node;
8
+ for (const [key, value] of Object.entries(obj)) {
9
+ if (typeof value === "string") {
10
+ if (/url|link/i.test(key) || value.includes("/#/")) {
11
+ obj[key] = normalizeResourceUrls(value, host, sourceHost);
12
+ }
13
+ } else if (value && typeof value === "object") {
14
+ normalizeResourceUrlFields(value, host, sourceHost);
15
+ }
16
+ }
17
+ }
18
+ function absolutizeRelativeUrls(s, host) {
19
+ return normalizeResourceUrls(s, host);
20
+ }
21
+ function normalizeResourceUrls(s, host, sourceHost = host) {
22
+ const base = host.replace(/\/+$/, "");
23
+ const sourceBase = sourceHost.replace(/\/+$/, "");
24
+ if (sourceBase && sourceBase !== base) {
25
+ s = s.replace(new RegExp(`${escapeRegExp(sourceBase)}/#`, "g"), `${base}/#`);
26
+ }
27
+ s = s.replace(/\]\((\/(?!\/)[^)]*)\)/g, `](${base}$1)`);
28
+ if (/^\/(?!\/)/.test(s)) s = base + s;
29
+ return s;
30
+ }
31
+ function resolvePublicWebHost(host) {
32
+ const override = process.env.AE_CLI_PUBLIC_WEB_URL || process.env.AE_CLI_WEB_HOST;
33
+ if (override?.trim()) {
34
+ return override.trim().replace(/\/+$/, "");
35
+ }
36
+ try {
37
+ const url = new URL(host);
38
+ if ((url.hostname === "127.0.0.1" || url.hostname === "localhost") && LOCAL_BACKEND_PORTS.has(url.port)) {
39
+ url.port = "10010";
40
+ return url.toString().replace(/\/+$/, "");
41
+ }
42
+ } catch {
43
+ }
44
+ return host.replace(/\/+$/, "");
45
+ }
46
+ function escapeRegExp(value) {
47
+ return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
48
+ }
49
+
50
+ export {
51
+ normalizeResourceUrlFields,
52
+ absolutizeRelativeUrls,
53
+ normalizeResourceUrls,
54
+ resolvePublicWebHost
55
+ };
@@ -3,7 +3,7 @@ import {
3
3
  getAgentApi,
4
4
  patchAgentApi,
5
5
  postAgentApi
6
- } from "./chunk-HIMOBNEY.js";
6
+ } from "./chunk-LXRALNNA.js";
7
7
 
8
8
  // src/commands/memory/cli-client.ts
9
9
  var DEFAULT_TE_CLAUDE_BASE_PATH = "/agent";