@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.
Files changed (115) hide show
  1. package/README.md +14 -4
  2. package/README.zh.md +14 -4
  3. package/bin/ae-cli.js +3 -0
  4. package/bin/heari/commander-LICENSE +22 -0
  5. package/bin/heari/engine.mjs +6136 -0
  6. package/bin/heari/package.json +6 -0
  7. package/bin/heari.mjs +29 -0
  8. package/cli-installation-guide.md +6 -7
  9. package/dist/{ai-monitor-OOOD4QDK.js → ai-monitor-4VPHXQTL.js} +7 -6
  10. package/dist/ai-monitor.js +10 -9
  11. package/dist/{auth-6BUUY5XS.js → auth-RDSS2LUT.js} +18 -16
  12. package/dist/{automation-IMDCJUML.js → automation-VLIWG2XY.js} +5 -4
  13. package/dist/{capability-XXFCANX7.js → capability-CUOEIB5F.js} +5 -4
  14. package/dist/{chunk-KE5WGBXS.js → chunk-3DTMWDJX.js} +1 -1
  15. package/dist/{chunk-FPPCXG6K.js → chunk-3FSYICDW.js} +6 -5
  16. package/dist/{chunk-BEVWMPCZ.js → chunk-3TV24AVQ.js} +10 -10
  17. package/dist/{chunk-DTODOQ6T.js → chunk-3U75VLCP.js} +1 -1
  18. package/dist/{chunk-6W56UQPO.js → chunk-4MOCV6HU.js} +1 -1
  19. package/dist/{chunk-M2OCZRVX.js → chunk-6VLHJKDD.js} +2 -2
  20. package/dist/{chunk-WG27BD67.js → chunk-7KBENPQF.js} +8 -16
  21. package/dist/{chunk-5YQSCMGS.js → chunk-BFSWGXM2.js} +3 -3
  22. package/dist/{chunk-UK7HQ4IL.js → chunk-CBNE2S44.js} +2 -2
  23. package/dist/{chunk-UWQXGF44.js → chunk-FEYZBUFQ.js} +4 -353
  24. package/dist/chunk-FKTVD63C.js +369 -0
  25. package/dist/{chunk-2H3SFJE3.js → chunk-FKVG7LOP.js} +5 -3
  26. package/dist/{chunk-I7H72CMN.js → chunk-IAZ4AMVY.js} +109 -85
  27. package/dist/{chunk-KDRE7SWM.js → chunk-LSELMDKQ.js} +2 -2
  28. package/dist/{chunk-2RORKIF6.js → chunk-NJGB4YOH.js} +2 -2
  29. package/dist/{chunk-L7MT53VM.js → chunk-PWG5IGCP.js} +1 -1
  30. package/dist/{chunk-EHH3ZF7D.js → chunk-TFEGYB4X.js} +2 -2
  31. package/dist/{chunk-DZRQGI2Z.js → chunk-ZPAOEDK7.js} +5 -3
  32. package/dist/{compat-check-AO3BFA3N.js → compat-check-L3C7HCVG.js} +4 -3
  33. package/dist/{config-N5V4VNER.js → config-LAF5MMYK.js} +6 -5
  34. package/dist/context-E4YKECC4.js +350 -0
  35. package/dist/{evaluation-OZM54MES.js → evaluation-I4IJ25CY.js} +4 -3
  36. package/dist/heari-cli-login.js +83 -0
  37. package/dist/index.js +43 -34
  38. package/dist/{memory-VPOPSU52.js → memory-Y7LPCRP4.js} +5 -4
  39. package/dist/{metadata-OUJPEMLD.js → metadata-T6HYAU7E.js} +7 -6
  40. package/dist/{model-2F2354QP.js → model-2BNN72MN.js} +7 -6
  41. package/dist/{personal-semantic-preference-WEAIZQXM.js → personal-semantic-preference-WCZBOA7V.js} +42 -16
  42. package/dist/{project-semantic-6VXUYU4A.js → project-semantic-WW5AZST3.js} +266 -17
  43. package/dist/{sync-BAV3UY46.js → sync-6PL25V42.js} +13 -12
  44. package/dist/{te-agent-QWZC36YS.js → te-agent-KXLDW4NE.js} +6 -5
  45. package/dist/{te-analysis-43RCOPUA.js → te-analysis-KKRECQ7F.js} +311 -52
  46. package/dist/{te-community-ECNTP35Z.js → te-community-6RGX7IWH.js} +8 -6
  47. package/dist/{te-dataops-ISEKYRLZ.js → te-dataops-RSPBC6WJ.js} +726 -220
  48. package/dist/{te-engage-LBKIZXZO.js → te-engage-FIPP5L2Z.js} +6 -5
  49. package/dist/{te-experiment-5TPQKN6B.js → te-experiment-KQ5CBYKI.js} +86 -10
  50. package/dist/{te-kb-SHL56BJ5.js → te-kb-XYSDXZUG.js} +32 -11
  51. package/dist/{te-system-Z4VEB6PL.js → te-system-QSOHAP7M.js} +7 -6
  52. package/dist/{te-team-EZ3TZTLV.js → te-team-R6MZ4RK2.js} +6 -5
  53. package/dist/{things-UBMLTY3S.js → things-DEONFUGS.js} +6 -5
  54. package/dist/{update-WE7VNRKZ.js → update-C6G4P3C7.js} +5 -4
  55. package/dist/{web-runtime-H53QKJS2.js → web-runtime-UGKPTBOK.js} +18 -12
  56. package/dist/{workspace-W5ZPVWJS.js → workspace-OBIIE5FN.js} +5 -4
  57. package/package.json +7 -5
  58. package/skills/ae-analysis/SKILL.md +41 -16
  59. package/skills/ae-analysis/references/adhoc_export.md +1 -1
  60. package/skills/ae-analysis/references/adhoc_run.md +8 -2
  61. package/skills/ae-analysis/references/analysis_drilldown_contract.md +1 -1
  62. package/skills/ae-analysis/references/audience_scheduling.md +30 -0
  63. package/skills/ae-analysis/references/business_semantics_workspace.md +57 -0
  64. package/skills/ae-analysis/references/command_index.md +18 -13
  65. package/skills/ae-analysis/references/context_prepare.md +49 -0
  66. package/skills/ae-analysis/references/drilldown_entities_export.md +1 -1
  67. package/skills/ae-analysis/references/drilldown_entities_run.md +1 -1
  68. package/skills/ae-analysis/references/drilldown_user_events_export.md +3 -1
  69. package/skills/ae-analysis/references/drilldown_user_events_run.md +2 -1
  70. package/skills/ae-analysis/references/governance_recommendation_export.md +1 -1
  71. package/skills/ae-analysis/references/personal_semantic_preference_add.md +5 -1
  72. package/skills/ae-analysis/references/personal_semantic_preference_get.md +4 -2
  73. package/skills/ae-analysis/references/personal_semantic_preference_list.md +7 -6
  74. package/skills/ae-analysis/references/personal_semantic_preference_submit.md +1 -1
  75. package/skills/ae-analysis/references/personal_semantic_preference_update.md +5 -1
  76. package/skills/ae-analysis/references/project_info_get.md +4 -0
  77. package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +1 -1
  78. package/skills/ae-analysis/references/project_semantic_setup.md +60 -0
  79. package/skills/ae-analysis/references/report_get.md +2 -0
  80. package/skills/ae-analysis/references/report_presentation.md +55 -0
  81. package/skills/ae-analysis/references/report_update.md +4 -2
  82. package/skills/ae-analysis/references/system_openapi_token_batch_generate.md +20 -0
  83. package/skills/ae-analysis/references/system_openapi_token_get.md +14 -0
  84. package/skills/ae-analysis/references/user_cluster_create.md +3 -1
  85. package/skills/ae-analysis/references/user_cluster_models.md +2 -0
  86. package/skills/ae-analysis/references/user_cluster_update.md +5 -3
  87. package/skills/ae-analysis/references/user_tag_create.md +4 -22
  88. package/skills/ae-analysis/references/user_tag_models.md +8 -0
  89. package/skills/ae-analysis/references/user_tag_update.md +6 -14
  90. package/skills/ae-analysis/scripts/read-semantic-catalog.mjs +40 -0
  91. package/skills/ae-capability/SKILL.md +5 -1
  92. package/skills/ae-dataops/SKILL.md +9 -6
  93. package/skills/ae-dataops/references/dataops-flow-create.md +64 -47
  94. package/skills/ae-dataops/references/dataops-flow-monitor.md +4 -2
  95. package/skills/ae-dataops/references/dataops-flow-python.md +109 -0
  96. package/skills/ae-experiment/SKILL.md +9 -1
  97. package/skills/ae-experiment/references/manage_feature_fixed_value.md +73 -0
  98. package/skills/ae-experiment/references/save_feature.md +14 -1
  99. package/skills/ae-heari-research/SKILL.md +40 -0
  100. package/skills/ae-heari-research/references/design.md +35 -0
  101. package/skills/ae-heari-research/references/examples.md +46 -0
  102. package/skills/ae-heari-research/references/platform-auth.md +35 -0
  103. package/skills/ae-heari-research/references/platform-research.md +74 -0
  104. package/skills/ae-heari-research/references/platform-results.md +73 -0
  105. package/skills/ae-heari-research/references/platform.md +34 -0
  106. package/skills/ae-heari-research/references/probing-screening.md +31 -0
  107. package/skills/ae-heari-research/references/quality.md +44 -0
  108. package/skills/ae-kb/SKILL.md +10 -5
  109. package/skills/ae-kb/references/analysis-workflow.md +19 -10
  110. package/skills/ae-kb/references/query-workflow.md +34 -17
  111. package/skills/ae-kb-discovery/SKILL.md +4 -3
  112. package/skills/ae-onboarding/SKILL.md +4 -6
  113. package/skills/ae-onboarding/references/onboarding_run.md +5 -1
  114. package/dist/context-WJQGJD6F.js +0 -139
  115. package/dist/{data-integration-KMJWYAKK.js → data-integration-SCYYZLWI.js} +4 -4
@@ -0,0 +1,6 @@
1
+ {
2
+ "private": true,
3
+ "version": "1.0.0",
4
+ "revision": "2fc589fe2c185edca7b82f868cd3470ce96569f3",
5
+ "sha256": "ebc0e85692650f169b875159769bb480ff81bd667b5737eaac834c06c3128505"
6
+ }
package/bin/heari.mjs ADDED
@@ -0,0 +1,29 @@
1
+ export async function runHearI(args) {
2
+ if (Number(process.versions.node.split('.')[0]) < 22) {
3
+ console.error('HearI requires Node.js 22 or later. Select a supported runtime and rerun ae-cli heari.');
4
+ return 1;
5
+ }
6
+ const { run } = await import('./heari/engine.mjs');
7
+ const controller = new AbortController();
8
+ const cancel = () => controller.abort();
9
+ process.on('SIGINT', cancel);
10
+ process.on('SIGTERM', cancel);
11
+ try {
12
+ // The AE runtime appends its own telemetry option before the optional '--' separator.
13
+ const tail = args.indexOf('--');
14
+ const head = args.slice(0, tail === -1 ? args.length : tail);
15
+ if (head.at(-2) === '--agent-context') head.splice(-2);
16
+ else if (head.at(-1)?.startsWith('--agent-context=')) head.pop();
17
+ const forwarded = tail === -1 ? head : [...head, ...args.slice(tail)];
18
+ return await run(['--lang', 'en-US', ...forwarded], {
19
+ signal: controller.signal,
20
+ aeCredentials: async (signal, checkEndpoint) => {
21
+ const { exchangeHeariCredentials } = await import('../dist/heari-cli-login.js');
22
+ return exchangeHeariCredentials(signal, checkEndpoint);
23
+ },
24
+ });
25
+ } finally {
26
+ process.off('SIGINT', cancel);
27
+ process.off('SIGTERM', cancel);
28
+ }
29
+ }
@@ -35,7 +35,7 @@ Verification parses YAML/frontmatter and compares expected files in the shared g
35
35
  - Unrelated PromptScript/Eve project-only diagnostics and their failure summary are handled internally and not displayed as user warnings after verification succeeds.
36
36
  - YAML errors, missing or stale files, supported-client installation errors, CLI version mismatch, and unsuccessful processes remain failures.
37
37
 
38
- `--format json` emits one report on stdout. Progress goes to stderr; raw subprocess logs are not forwarded. Reports include `ok`, `dry_run`, `cli.package/version/path/verified`, `skills.directory/expected_count/installed_count/missing/source/version/failures/attempts`, `auth.host/authenticated`, and `next_steps`. When provided, `onboarding_skill_path` points to the onboarding Skill in the verified package. Counts refer to unique Skills in the global directory. Use `--format table` for a human summary. Dry runs make no subprocess calls or installation/configuration writes.
38
+ `--format json` emits one report on stdout. Progress goes to stderr; raw subprocess logs are not forwarded. Reports include `ok`, `dry_run`, `cli.package/version/path/verified`, `skills.directory/expected_count/installed_count/missing/source/version/failures/attempts`, `auth.host/authenticated`, and `next_steps`. A verified installation can also report `next_action`, localized choices in `interaction`, and `local_language`. When provided, `onboarding_skill_path` points to the onboarding Skill in the verified package. Counts refer to unique Skills in the global directory. Use `--format table` for a human summary. Dry runs make no subprocess calls or installation/configuration writes.
39
39
 
40
40
  `install --dry-run --format json` returns that report directly, with a root-level `commands` array. `update --dry-run --format json` keeps the command envelope (`ok` and `data`); its `data` includes `action`, `dryRun`, `target`, optional `host`, `commands`, and `skillsSources`.
41
41
 
@@ -56,8 +56,9 @@ If the user asks to install AE CLI, run the installer and report the verificatio
56
56
  - For an existing-account login, use step 5. If the intended environment is already signed in, use it for the user's AE task.
57
57
  - For a direct signup request, use step 4. For an explicit onboarding or walkthrough request, use the signed-in environment when available and the user has not requested a new account. For onboarding that requires signup, read `references/about-ae.md` next to the Skill at `onboarding_skill_path` and show the localized **Create an AE account** and **Learn about AE** choices in the Agent's native picker. Without the report field, locate the Skill under `skills/ae-onboarding/` in the verified package. The package root is one directory above the `bin/` directory containing `cli.entrypoint`. Use chat choices if the picker is unavailable. Wait for their choice before opening the website or starting the CLI onboarding command.
58
58
  - For **Learn about AE**, show the introduction and available official resources in the display language. Then offer **Create an AE account** and wait. Use step 4 after the user chooses it.
59
- 4. Use an explicitly requested or already confirmed market. For a new production account otherwise use `onboarding_market` from the install report or `device_market` from the onboarding dry run. Chinese device locales, including Traditional Chinese, use China. Other locales use the United States. Without these fields, check `AE_LANG`, `LC_ALL`, `LC_MESSAGES`, `LANG`, and `LANGUAGE` for the device locale.
60
- - Start website onboarding with `ae-cli analysis onboarding run --browser system --format json`. Pass the resolved `--region` and the `--source` for the current AI tool. Use `--language` for the display preference. The CLI opens the system default browser. If opening fails, share the returned URL. Read the returned `skill_path`, show its sign-in choices, and reuse `session_id` in the same conversation after the user confirms they signed in.
59
+ 4. For a new production account, use the market the user specified or confirmed. Otherwise, compare `local_language` in the install report with the language of the user's own request. Without a current report, read `data.local_language` from `ae-cli --dry-run analysis onboarding run --format json`. Infer the request language from the user's prose, excluding commands, links, quoted text, and picker labels. A missing locale or `C.UTF-8` provides no language signal. Treat `onboarding_market` and `device_market` as defaults that may include a fallback.
60
+ - Map Chinese (including Traditional Chinese) to China (`cn`), English to the United States (`us`), Japanese to Japan (`jp`), and Korean to South Korea (`kr`). If both signals point to different markets, show exactly those two markets in the user's language and wait for their selection. If they agree or only one maps to a market, use that market directly. With neither, use `us`.
61
+ - Start website onboarding with `ae-cli analysis onboarding run --browser system --format json`. Pass the resolved `--region` and the `--source` for the current AI tool. Pass `--language` for the display preference or conversation language when known. The CLI opens the system default browser. If opening fails, share the returned URL. Read the returned `skill_path`, show its sign-in choices, and reuse `session_id` in the same conversation after the user confirms they signed in.
61
62
  - For explicitly requested overseas test signup, add `--website-env test --region us`, or use `jp` or `kr` when requested. Keep the returned session ID through website sign-in and CLI authorization.
62
63
  5. To sign in, use the original AE environment supplied or confirmed by the user. If its address is unknown, ask for it. Follow the device flow below. Once the session is authorized, confirm that `ae-cli auth status` reports the expected environment and signed-in account. Check `ae-cli analysis onboarding progress --format json` and follow the same routing as after installation.
63
64
 
@@ -127,8 +128,6 @@ Choose the specific Skill you are troubleshooting. The onboarding Skill is loade
127
128
 
128
129
  ## AI installation prompt
129
130
 
130
- > Install AE CLI and its matching global Skills with `npx @thinkingai/ae-cli@latest install --format json`. Use the version and registry I supply, if any. Verify the installation and report the CLI version and Skill count. Follow [Start using AE in an Agent](#start-using-ae-in-an-agent) after a verified fresh 6.1 install or if I ask for onboarding, signup, or sign-in.
131
+ > Install AE CLI and its matching global Skills with `npx @thinkingai/ae-cli@latest install --format json`. Use the version and registry I supply, if any. Verify the installation and report the CLI version and Skill count. After a verified fresh 6.1 install, use `next_action` to continue in this turn. If it is `choose_account`, show the account choices from `interaction` and wait for my selection. Follow [Start using AE in an Agent](#start-using-ae-in-an-agent) for the next step or when I ask for onboarding, signup, or sign-in.
131
132
 
132
- To install the 6.1 line and see the account choices after a verified fresh install when signed out, send this to your Agent:
133
-
134
- > Install AE CLI and its matching global Skills with `npx @thinkingai/ae-cli@latest-6.1 install`.
133
+ To select the 6.1 release line explicitly, use `npx @thinkingai/ae-cli@latest-6.1 install --format json` in the same prompt.
@@ -9,13 +9,14 @@ import {
9
9
  traceCount,
10
10
  traceGet,
11
11
  traceList
12
- } from "./chunk-EHH3ZF7D.js";
13
- import "./chunk-FPPCXG6K.js";
12
+ } from "./chunk-TFEGYB4X.js";
13
+ import "./chunk-3FSYICDW.js";
14
14
  import "./chunk-AWW2T2WL.js";
15
- import "./chunk-6W56UQPO.js";
16
- import "./chunk-I7H72CMN.js";
17
- import "./chunk-WG27BD67.js";
18
- import "./chunk-UWQXGF44.js";
15
+ import "./chunk-4MOCV6HU.js";
16
+ import "./chunk-IAZ4AMVY.js";
17
+ import "./chunk-7KBENPQF.js";
18
+ import "./chunk-FKTVD63C.js";
19
+ import "./chunk-FEYZBUFQ.js";
19
20
  import "./chunk-IGU3R2JD.js";
20
21
  import "./chunk-MTK4ZE7W.js";
21
22
  import "./chunk-3ZQY7SLZ.js";
@@ -1,21 +1,22 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  ai_monitor_default
4
- } from "./chunk-EHH3ZF7D.js";
5
- import "./chunk-FPPCXG6K.js";
4
+ } from "./chunk-TFEGYB4X.js";
5
+ import "./chunk-3FSYICDW.js";
6
6
  import "./chunk-AWW2T2WL.js";
7
7
  import {
8
8
  configureBusinessCommands,
9
9
  parseProgram,
10
10
  runCommand
11
- } from "./chunk-BEVWMPCZ.js";
11
+ } from "./chunk-3TV24AVQ.js";
12
12
  import "./chunk-GYODT7C4.js";
13
- import "./chunk-L7MT53VM.js";
14
- import "./chunk-6W56UQPO.js";
15
- import "./chunk-KE5WGBXS.js";
16
- import "./chunk-I7H72CMN.js";
17
- import "./chunk-WG27BD67.js";
18
- import "./chunk-UWQXGF44.js";
13
+ import "./chunk-PWG5IGCP.js";
14
+ import "./chunk-3DTMWDJX.js";
15
+ import "./chunk-4MOCV6HU.js";
16
+ import "./chunk-IAZ4AMVY.js";
17
+ import "./chunk-7KBENPQF.js";
18
+ import "./chunk-FKTVD63C.js";
19
+ import "./chunk-FEYZBUFQ.js";
19
20
  import "./chunk-IGU3R2JD.js";
20
21
  import {
21
22
  readExternalCliToken,
@@ -3,18 +3,11 @@ import {
3
3
  environmentRefreshOutput,
4
4
  invalidateBusinessSkillSynchronization,
5
5
  refreshEnvironmentAfterLogin
6
- } from "./chunk-5YQSCMGS.js";
6
+ } from "./chunk-BFSWGXM2.js";
7
7
  import {
8
8
  MultiselectCancelled,
9
9
  promptSingleSelect
10
10
  } from "./chunk-7K24F7T2.js";
11
- import {
12
- resolveHost
13
- } from "./chunk-Z6WSCIHM.js";
14
- import {
15
- printError,
16
- printOutput
17
- } from "./chunk-6W56UQPO.js";
18
11
  import {
19
12
  DeviceFlowUnsupportedError,
20
13
  authorizeLoginDevice,
@@ -23,31 +16,40 @@ import {
23
16
  resolveDeviceSessionRoute,
24
17
  resolveLegacyLoginBase,
25
18
  runDeviceFlow
26
- } from "./chunk-2H3SFJE3.js";
19
+ } from "./chunk-FKVG7LOP.js";
20
+ import {
21
+ resolveHost
22
+ } from "./chunk-Z6WSCIHM.js";
23
+ import {
24
+ printError,
25
+ printOutput
26
+ } from "./chunk-4MOCV6HU.js";
27
27
  import {
28
28
  missingAeHostGuidance,
29
29
  missingAeHostHint,
30
30
  runHostCompatCheck
31
- } from "./chunk-I7H72CMN.js";
31
+ } from "./chunk-IAZ4AMVY.js";
32
32
  import {
33
33
  getLocalCliPackageInfo
34
- } from "./chunk-WG27BD67.js";
34
+ } from "./chunk-7KBENPQF.js";
35
35
  import {
36
36
  CliTokenValidationUnavailableError,
37
+ clearCliTokenCache,
38
+ mintCliToken,
39
+ validateCliTokenOnServer
40
+ } from "./chunk-FKTVD63C.js";
41
+ import {
37
42
  CredentialStoreUnreadableError,
38
43
  SecureStoreAuthError,
39
44
  activateCredential,
40
45
  assertCredentialsReadable,
41
46
  clearAllCredentials,
42
- clearCliTokenCache,
43
47
  getActiveCredential,
44
48
  listCredentials,
45
- mintCliToken,
46
49
  removeActiveCredential,
47
50
  saveCredential,
48
- updateCredentialMetadata,
49
- validateCliTokenOnServer
50
- } from "./chunk-UWQXGF44.js";
51
+ updateCredentialMetadata
52
+ } from "./chunk-FEYZBUFQ.js";
51
53
  import {
52
54
  getFallbackCliToken,
53
55
  loadConfig,
@@ -1,11 +1,11 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
3
  resolveWorkspaceTarget
4
- } from "./chunk-2RORKIF6.js";
4
+ } from "./chunk-NJGB4YOH.js";
5
5
  import {
6
6
  currentAgentSpaceId
7
7
  } from "./chunk-RK6GLDGI.js";
8
- import "./chunk-UK7HQ4IL.js";
8
+ import "./chunk-CBNE2S44.js";
9
9
  import {
10
10
  detectCliLocale
11
11
  } from "./chunk-N2MAYIRU.js";
@@ -15,8 +15,9 @@ import {
15
15
  getFromMainApp,
16
16
  patchToMainApp,
17
17
  postToMainApp
18
- } from "./chunk-KE5WGBXS.js";
19
- import "./chunk-UWQXGF44.js";
18
+ } from "./chunk-3DTMWDJX.js";
19
+ import "./chunk-FKTVD63C.js";
20
+ import "./chunk-FEYZBUFQ.js";
20
21
  import "./chunk-IGU3R2JD.js";
21
22
  import "./chunk-MTK4ZE7W.js";
22
23
  import {
@@ -17,13 +17,13 @@ import {
17
17
  printError,
18
18
  printOutput,
19
19
  withOutputMetadata
20
- } from "./chunk-6W56UQPO.js";
20
+ } from "./chunk-4MOCV6HU.js";
21
21
  import {
22
22
  assertBusinessEnabled,
23
23
  businessForCapability,
24
24
  readBusinessConfigForExecution,
25
25
  readCurrentBusinessConfig
26
- } from "./chunk-I7H72CMN.js";
26
+ } from "./chunk-IAZ4AMVY.js";
27
27
  import {
28
28
  CapabilityGatewayError,
29
29
  dryRunCapabilityWithEnvelope,
@@ -32,11 +32,12 @@ import {
32
32
  inspectCapabilityWithEnvelope,
33
33
  listCapabilitiesWithEnvelope,
34
34
  validateCapabilityWithEnvelope
35
- } from "./chunk-WG27BD67.js";
35
+ } from "./chunk-7KBENPQF.js";
36
+ import "./chunk-FKTVD63C.js";
36
37
  import {
37
38
  CredentialStoreUnreadableError,
38
39
  SecureStoreAuthError
39
- } from "./chunk-UWQXGF44.js";
40
+ } from "./chunk-FEYZBUFQ.js";
40
41
  import {
41
42
  parseJsonRequest
42
43
  } from "./chunk-IGU3R2JD.js";
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  getCliToken,
4
4
  internalCallSourceHeaders
5
- } from "./chunk-UWQXGF44.js";
5
+ } from "./chunk-FKTVD63C.js";
6
6
  import {
7
7
  getActiveHost,
8
8
  getSandboxRuntimeRoot
@@ -4,12 +4,12 @@ import {
4
4
  } from "./chunk-AWW2T2WL.js";
5
5
  import {
6
6
  withOutputMetadata
7
- } from "./chunk-6W56UQPO.js";
7
+ } from "./chunk-4MOCV6HU.js";
8
8
  import {
9
9
  dryRunCapabilityWithEnvelope,
10
10
  executeCapabilityWithEnvelope,
11
11
  validateCapabilityWithEnvelope
12
- } from "./chunk-WG27BD67.js";
12
+ } from "./chunk-7KBENPQF.js";
13
13
  import {
14
14
  CliValidationError
15
15
  } from "./chunk-3ZQY7SLZ.js";
@@ -130,9 +130,10 @@ function createCapabilityCommand(config) {
130
130
  const preparedInput = config.prepareInput ? await config.prepareInput(ctx, input) : input;
131
131
  const evidence = config.intentConsistency ? verifyDefinitionIntent(ctx, config.intentConsistency) : void 0;
132
132
  const intentMeta = evidence ? { intent_consistency: evidence } : void 0;
133
- announceDispatch(config.capabilityId, preparedInput);
134
- const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, preparedInput);
135
- const data = config.postProcess ? await config.postProcess(result.data, preparedInput, ctx) : result.data;
133
+ const executeInput = config.prepareExecuteInput ? await config.prepareExecuteInput(ctx, preparedInput) : preparedInput;
134
+ announceDispatch(config.capabilityId, executeInput);
135
+ const result = await executeCapabilityWithEnvelope(requestHost, gatewayDomain, config.capabilityId, executeInput);
136
+ const data = config.postProcess ? await config.postProcess(result.data, executeInput, ctx) : result.data;
136
137
  return withOutputMetadata(data, { ...result.meta, ...intentMeta });
137
138
  }
138
139
  };
@@ -5,29 +5,29 @@ import {
5
5
  } from "./chunk-GYODT7C4.js";
6
6
  import {
7
7
  EvalApiError
8
- } from "./chunk-L7MT53VM.js";
9
- import {
10
- printError,
11
- printOutput
12
- } from "./chunk-6W56UQPO.js";
8
+ } from "./chunk-PWG5IGCP.js";
13
9
  import {
14
10
  TeAgentApiError,
15
11
  TeAgentCredentialsError
16
- } from "./chunk-KE5WGBXS.js";
12
+ } from "./chunk-3DTMWDJX.js";
13
+ import {
14
+ printError,
15
+ printOutput
16
+ } from "./chunk-4MOCV6HU.js";
17
17
  import {
18
18
  BusinessDisabledError,
19
19
  assertBusinessEnabled,
20
20
  businessForCommand,
21
21
  formatCapabilityMissCompatHint,
22
22
  readCurrentBusinessConfig
23
- } from "./chunk-I7H72CMN.js";
23
+ } from "./chunk-IAZ4AMVY.js";
24
24
  import {
25
25
  CapabilityGatewayError
26
- } from "./chunk-WG27BD67.js";
26
+ } from "./chunk-7KBENPQF.js";
27
27
  import {
28
28
  CredentialStoreUnreadableError,
29
29
  SecureStoreAuthError
30
- } from "./chunk-UWQXGF44.js";
30
+ } from "./chunk-FEYZBUFQ.js";
31
31
  import {
32
32
  getActiveHost,
33
33
  safeJsonParse
@@ -470,7 +470,7 @@ function createRuntimeContext(cmd, opts, globalOpts) {
470
470
  }
471
471
  const ctx = {
472
472
  async onboarding(action, input) {
473
- const { invokeOnboarding } = await import("./web-runtime-H53QKJS2.js");
473
+ const { invokeOnboarding } = await import("./web-runtime-UGKPTBOK.js");
474
474
  return invokeOnboarding(action, input);
475
475
  },
476
476
  has(name) {
@@ -3,7 +3,7 @@ import {
3
3
  getAgentApi,
4
4
  patchAgentApi,
5
5
  postAgentApi
6
- } from "./chunk-UK7HQ4IL.js";
6
+ } from "./chunk-CBNE2S44.js";
7
7
 
8
8
  // src/commands/memory/cli-client.ts
9
9
  var DEFAULT_TE_CLAUDE_BASE_PATH = "/agent";
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
2
2
  import {
3
3
  getPendingHostCompatNotice,
4
4
  getPendingUpdateNotice
5
- } from "./chunk-I7H72CMN.js";
5
+ } from "./chunk-IAZ4AMVY.js";
6
6
  import {
7
7
  logger,
8
8
  redactExternalCliToken
@@ -6,11 +6,11 @@ import {
6
6
  evalRequest,
7
7
  evaluationResponseStatus,
8
8
  resolveEvaluationHost
9
- } from "./chunk-L7MT53VM.js";
9
+ } from "./chunk-PWG5IGCP.js";
10
10
  import {
11
11
  getCliToken,
12
12
  internalCallSourceHeaders
13
- } from "./chunk-UWQXGF44.js";
13
+ } from "./chunk-FKTVD63C.js";
14
14
  import {
15
15
  isAeSandboxRuntime
16
16
  } from "./chunk-IGU3R2JD.js";
@@ -1,10 +1,12 @@
1
1
  import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
2
2
  import {
3
- SecureStoreAuthError,
4
3
  clearCliTokenCache,
5
4
  getCliToken,
6
5
  internalCallSourceHeaders
7
- } from "./chunk-UWQXGF44.js";
6
+ } from "./chunk-FKTVD63C.js";
7
+ import {
8
+ SecureStoreAuthError
9
+ } from "./chunk-FEYZBUFQ.js";
8
10
  import {
9
11
  getAeSandboxDetectionReason,
10
12
  safeJsonParse,
@@ -374,24 +376,14 @@ function buildCapabilityGatewayUrl(host, domain, pathAfterV1, queryParams = {},
374
376
  }
375
377
  return url.toString();
376
378
  }
377
- async function permissionMessage(resp) {
378
- const text = await resp.text().catch(() => "");
379
- try {
380
- const d = safeJsonParse(text);
381
- const msg = d && (d.error?.message || (typeof d.error === "string" ? d.error : void 0) || d.message);
382
- if (msg && typeof msg === "string") return msg;
383
- } catch {
384
- }
385
- return "Permission denied for this resource (HTTP 403)";
386
- }
387
379
  async function permissionError(resp) {
388
- const codeResponse = resp.clone();
389
- const message = await permissionMessage(resp);
390
- const body = safeJsonParse(await codeResponse.text());
380
+ const parsed = parseCapabilityResponse(await resp.text().catch(() => ""));
381
+ const body = isRecord(parsed) ? parsed : void 0;
391
382
  const error = isRecord(body?.error) ? body.error : void 0;
383
+ const message = error?.message || (typeof body?.error === "string" ? body.error : void 0) || body?.message;
392
384
  const code = nonEmptyString(error?.code) ?? nonEmptyString(body?.code);
393
385
  return new PermissionError(
394
- message,
386
+ typeof message === "string" && message ? message : "Permission denied for this resource (HTTP 403)",
395
387
  code,
396
388
  nonEmptyString(error?.hint) ?? nonEmptyString(body?.hint),
397
389
  void 0,
@@ -6,13 +6,13 @@ import {
6
6
  rememberBusinessConfig,
7
7
  reserveBusinessSkillContext,
8
8
  syncBusinessSkills
9
- } from "./chunk-I7H72CMN.js";
9
+ } from "./chunk-IAZ4AMVY.js";
10
10
  import {
11
11
  getLocalCliPackageInfo
12
- } from "./chunk-WG27BD67.js";
12
+ } from "./chunk-7KBENPQF.js";
13
13
  import {
14
14
  peekCliToken
15
- } from "./chunk-UWQXGF44.js";
15
+ } from "./chunk-FKTVD63C.js";
16
16
  import {
17
17
  getActiveHost,
18
18
  getConfigDir
@@ -10,10 +10,10 @@ import {
10
10
  postToMainApp,
11
11
  putToMainApp,
12
12
  uploadToMainApp
13
- } from "./chunk-KE5WGBXS.js";
13
+ } from "./chunk-3DTMWDJX.js";
14
14
  import {
15
15
  clearCliTokenCache
16
- } from "./chunk-UWQXGF44.js";
16
+ } from "./chunk-FKTVD63C.js";
17
17
 
18
18
  // src/core/resource-package-client.ts
19
19
  function checkPath(path) {