@thinkingai/ae-cli 6.1.29 → 6.1.32
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 +11 -5
- package/README.zh.md +11 -5
- package/bin/ai-monitor.js +2 -0
- package/dist/ai-monitor-MKMHSSNI.js +32 -0
- package/dist/ai-monitor.js +135 -0
- package/dist/{auth-OBQ5KVQM.js → auth-CZHHPZOQ.js} +12 -11
- package/dist/{automation-NAR5DDGL.js → automation-FLCPFMN4.js} +5 -5
- package/dist/{capability-LFSVNI5B.js → capability-64KVJFIA.js} +28 -32
- package/dist/{chunk-IN7KKL6K.js → chunk-2F64AZYH.js} +1 -1
- package/dist/{chunk-QZLRHGVH.js → chunk-3ULDJJTZ.js} +1 -1
- package/dist/{chunk-JNVVJ273.js → chunk-4PSTYEG5.js} +5 -10
- package/dist/{chunk-3SDHJOCR.js → chunk-4XKTRCRK.js} +16 -16
- package/dist/{chunk-RJHGDWSC.js → chunk-5M5LBRR3.js} +2 -2
- package/dist/chunk-6M7ZEDT2.js +182 -0
- package/dist/{chunk-KPQY44JQ.js → chunk-AWW2T2WL.js} +3 -0
- package/dist/chunk-BNBCMCYN.js +563 -0
- package/dist/chunk-CF6JTT2U.js +64 -0
- package/dist/{chunk-2UW3Y463.js → chunk-DWBYNGSR.js} +565 -315
- package/dist/{chunk-N6XBLRB7.js → chunk-F2VFZUGG.js} +2 -2
- package/dist/{chunk-CVCTFLSO.js → chunk-FCAA7I2D.js} +3 -3
- package/dist/{chunk-H3K5UGYC.js → chunk-HTZ2MLYA.js} +48 -22
- package/dist/{chunk-QZUVLFNR.js → chunk-HVMCPKOZ.js} +1 -1
- package/dist/chunk-IDDWEZ7F.js +1285 -0
- package/dist/{chunk-7JAVT5TK.js → chunk-KTJXD27G.js} +2 -2
- package/dist/{chunk-6HAUVWOQ.js → chunk-NLEXY2TM.js} +48 -13
- package/dist/{chunk-YVG6QD3V.js → chunk-P7QDCWJ6.js} +98 -7
- package/dist/{chunk-PWXDWMCW.js → chunk-T7WF4HYW.js} +84 -32
- package/dist/{chunk-VCZE3IWO.js → chunk-TMQGS4TO.js} +15 -10
- package/dist/{compat-check-CII6B74E.js → compat-check-ZJNCMNQV.js} +3 -3
- package/dist/{config-YZ6O2UQ2.js → config-FSH2NMNZ.js} +26 -13
- package/dist/{context-F6FCGTF3.js → context-YAQG6YQC.js} +3 -3
- package/dist/{data-integration-6UAZO4GG.js → data-integration-QE37EQ3A.js} +1 -1
- package/dist/{evaluation-4LO2O4AF.js → evaluation-2JSF4V47.js} +13 -158
- package/dist/index.js +84 -586
- package/dist/{memory-HHPX3NF2.js → memory-VEZZVAAP.js} +5 -5
- package/dist/{metadata-TIFY24LW.js → metadata-3IWHX3V4.js} +8 -8
- package/dist/{model-7UHGWYVR.js → model-T7H7Q6BG.js} +3 -3
- package/dist/{personal-semantic-preference-WKJEGPTM.js → personal-semantic-preference-YITU23SA.js} +7 -7
- package/dist/{project-semantic-EIQVZNHW.js → project-semantic-MHEXJF3C.js} +16 -14
- package/dist/{sync-RV3OPCTI.js → sync-AQHVCSPI.js} +5 -5
- package/dist/{te-agent-5ENVZJUH.js → te-agent-RXI7WOH4.js} +6 -6
- package/dist/{te-analysis-USIK6ZZG.js → te-analysis-CZY74HVF.js} +381 -192
- package/dist/{te-community-WE2UU4XV.js → te-community-DKCYUBCM.js} +7 -7
- package/dist/{te-dataops-XNMO7MBF.js → te-dataops-QEH6VE56.js} +5 -5
- package/dist/{te-engage-6C3HCFQR.js → te-engage-WK7WKDKF.js} +7 -7
- package/dist/{te-experiment-LVTRI3QK.js → te-experiment-LH3RPIOE.js} +275 -30
- package/dist/{te-kb-TUPGMVBY.js → te-kb-UPORIOVN.js} +17 -8
- package/dist/{te-system-YM657FKO.js → te-system-AL4B4XZL.js} +3 -3
- package/dist/{te-team-G4VEJJNL.js → te-team-LLVTO2G4.js} +6 -6
- package/dist/{things-22KQWC23.js → things-XLMLBYQR.js} +6 -6
- package/dist/{update-XX4ILU7X.js → update-7J5UQHSK.js} +4 -4
- package/dist/{workspace-LYDAP647.js → workspace-FF2HXJGR.js} +5 -5
- package/package.json +9 -7
- package/skills/ae-ai-monitor/SKILL.md +179 -0
- package/skills/ae-ai-monitor/references/read-commands.md +866 -0
- package/skills/ae-analysis/SKILL.md +10 -4
- package/skills/ae-analysis/references/adhoc_export.md +3 -1
- package/skills/ae-analysis/references/ai_models/path.md +5 -6
- package/skills/ae-analysis/references/ai_models.md +1 -0
- package/skills/ae-analysis/references/analysis_gateway_assets.md +2 -0
- package/skills/ae-analysis/references/asset_search.md +1 -1
- package/skills/ae-analysis/references/bad_case_begin.md +12 -0
- package/skills/ae-analysis/references/bad_case_get.md +12 -0
- package/skills/ae-analysis/references/bad_case_history.md +12 -0
- package/skills/ae-analysis/references/bad_case_list.md +12 -0
- package/skills/ae-analysis/references/bad_case_review.md +51 -0
- package/skills/ae-analysis/references/bad_case_run.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit.md +12 -0
- package/skills/ae-analysis/references/bad_case_submit_to_page.md +12 -0
- package/skills/ae-analysis/references/bad_case_sync_evaluation.md +11 -0
- package/skills/ae-analysis/references/bi_panel_list.md +1 -1
- package/skills/ae-analysis/references/bi_panel_share.md +3 -1
- package/skills/ae-analysis/references/catalog_list.md +2 -0
- package/skills/ae-analysis/references/command_index.md +38 -29
- package/skills/ae-analysis/references/dashboard_daily_report_update.md +2 -0
- package/skills/ae-analysis/references/dashboard_handover.md +3 -1
- package/skills/ae-analysis/references/dashboard_list.md +3 -3
- package/skills/ae-analysis/references/dashboard_report_data_export.md +1 -1
- package/skills/ae-analysis/references/dashboard_share.md +3 -1
- package/skills/ae-analysis/references/dashboard_update.md +3 -2
- package/skills/ae-analysis/references/filter_value_list.md +2 -0
- package/skills/ae-analysis/references/folder_share.md +8 -2
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +3 -1
- package/skills/ae-analysis/references/project_data_power_upsert.md +3 -1
- package/skills/ae-analysis/references/project_mark_time_create.md +2 -0
- package/skills/ae-analysis/references/project_mark_time_update.md +2 -0
- package/skills/ae-analysis/references/project_member_add.md +3 -1
- package/skills/ae-analysis/references/project_member_batch_update.md +3 -1
- package/skills/ae-analysis/references/project_member_handover_run.md +3 -1
- package/skills/ae-analysis/references/project_member_update.md +3 -1
- package/skills/ae-analysis/references/project_owner_update.md +3 -1
- package/skills/ae-analysis/references/project_role_upsert.md +5 -3
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +16 -1
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki_plan_schema.md +14 -1
- package/skills/ae-analysis/references/project_space_share.md +8 -2
- package/skills/ae-analysis/references/property_get.md +2 -0
- package/skills/ae-analysis/references/public_link_list.md +3 -1
- package/skills/ae-analysis/references/query_cancel.md +4 -1
- package/skills/ae-analysis/references/report_data_run.md +1 -1
- package/skills/ae-analysis/references/report_list.md +3 -3
- package/skills/ae-analysis/references/scenario_append.md +2 -2
- package/skills/ae-analysis/references/scenario_collect.md +15 -4
- package/skills/ae-analysis/references/scenario_list.md +2 -1
- package/skills/ae-analysis/references/system_oauth2_update.md +3 -1
- package/skills/ae-analysis/references/system_third_party_login_upsert.md +4 -2
- package/skills/ae-analysis/references/user_tag_create.md +4 -1
- package/skills/ae-analysis/references/user_tag_get.md +2 -0
- package/skills/ae-analysis/references/user_tag_models.md +8 -2
- package/skills/ae-analysis/references/user_tag_update.md +5 -2
- package/skills/ae-analysis/references/virtual_property_create.md +12 -1
- package/skills/ae-analysis/references/virtual_property_sql_rule_update.md +10 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/build-project-semantic-wiki.mjs +55 -13
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-rules.md +2 -2
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/default-compile-schema.md +7 -1
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/wait-compile-run.mjs +79 -0
- package/skills/ae-automation/SKILL.md +4 -2
- package/skills/ae-capability/SKILL.md +9 -5
- package/skills/ae-community/SKILL.md +1 -0
- package/skills/ae-dataops/SKILL.md +1 -0
- package/skills/ae-engage/SKILL.md +1 -0
- package/skills/ae-evaluation/SKILL.md +17 -2
- package/skills/ae-experiment/SKILL.md +38 -11
- package/skills/ae-experiment/references/experiment_approval.md +171 -0
- package/skills/ae-experiment/references/manage_experiment.md +11 -2
- package/skills/ae-experiment/references/save_experiment.md +28 -8
- package/skills/ae-experiment/references/save_submit_experiment.md +18 -3
- package/skills/ae-experiment/references/save_submit_external_experiment.md +57 -3
- package/skills/ae-generate-tracking-plan/SKILL.md +5 -0
- package/skills/ae-kb/SKILL.md +9 -5
- package/skills/ae-kb/references/analysis-workflow.md +11 -2
- package/skills/ae-kb/references/query-workflow.md +9 -6
- package/skills/ae-kb/references/versions.md +1 -1
- package/skills/ae-kb-discovery/SKILL.md +15 -6
- package/skills/ae-metadata/SKILL.md +1 -0
- package/skills/ae-migrate-tracking-code/SKILL.md +2 -1
- package/skills/ae-team/SKILL.md +1 -1
- package/skills/ae-tracking-matrix/SKILL.md +170 -0
- package/skills/ae-tracking-matrix/assets//345/237/213/347/202/271/346/250/241/347/211/210.xlsx +0 -0
- package/skills/ae-tracking-matrix/i18n.yaml +12 -0
- package/skills/ae-tracking-matrix/references/ae-capabilities.md +93 -0
- package/skills/ae-tracking-matrix/references/business-semantic-checks.md +30 -0
- package/skills/ae-tracking-matrix/references/categories/acquaintance_social_tracking_plan_template.md +256 -0
- package/skills/ae-tracking-matrix/references/categories/blockchain_game_tracking_plan_template.md +213 -0
- package/skills/ae-tracking-matrix/references/categories/card_game_tracking_plan_template.md +407 -0
- package/skills/ae-tracking-matrix/references/categories/casual_game_tracking_plan_template.md +218 -0
- package/skills/ae-tracking-matrix/references/categories/casual_music.md +112 -0
- package/skills/ae-tracking-matrix/references/categories/chess_cards_tracking_plan_template.md +301 -0
- package/skills/ae-tracking-matrix/references/categories/ecommerce_tracking_plan_template.md +356 -0
- package/skills/ae-tracking-matrix/references/categories/fishing.md +775 -0
- package/skills/ae-tracking-matrix/references/categories/game_basic_module_tracking_plan.md +89 -0
- package/skills/ae-tracking-matrix/references/categories/idle_card.md +27 -0
- package/skills/ae-tracking-matrix/references/categories/idle_game_tracking_plan_template.md +415 -0
- package/skills/ae-tracking-matrix/references/categories/interactive_video.md +133 -0
- package/skills/ae-tracking-matrix/references/categories/merge.md +639 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_mobile_tracking_plan_template.md +406 -0
- package/skills/ae-tracking-matrix/references/categories/mmo_web.md +230 -0
- package/skills/ae-tracking-matrix/references/categories/music.md +137 -0
- package/skills/ae-tracking-matrix/references/categories/online_education_tracking_plan_template.md +414 -0
- package/skills/ae-tracking-matrix/references/categories/qipai_mj.md +199 -0
- package/skills/ae-tracking-matrix/references/categories/reading_tracking_plan_template.md +158 -0
- package/skills/ae-tracking-matrix/references/categories/roguelike_tracking_plan_template.md +546 -0
- package/skills/ae-tracking-matrix/references/categories/rpg.md +195 -0
- package/skills/ae-tracking-matrix/references/categories/short_drama_tracking_plan_template.md +115 -0
- package/skills/ae-tracking-matrix/references/categories/simulation_business_tracking_plan_template.md +151 -0
- package/skills/ae-tracking-matrix/references/categories/slg_tracking_plan_template.md +260 -0
- package/skills/ae-tracking-matrix/references/categories/slots_tracking_plan_template.md +232 -0
- package/skills/ae-tracking-matrix/references/categories/stranger_social_tracking_plan_template.md +359 -0
- package/skills/ae-tracking-matrix/references/categories/tower_defense.md +365 -0
- package/skills/ae-tracking-matrix/references/categories/video_editor_tracking_plan_template.md +211 -0
- package/skills/ae-tracking-matrix/references/categories/wechat_minigame.md +132 -0
- package/skills/ae-tracking-matrix/references/category-registry.md +77 -0
- package/skills/ae-tracking-matrix/references/data-verification/diagnosis_kb.md +230 -0
- package/skills/ae-tracking-matrix/references/data-verification/sql_checks.md +406 -0
- package/skills/ae-tracking-matrix/references/data-verification/tracking_plan_comparison.md +128 -0
- package/skills/ae-tracking-matrix/references/eval-cases.md +74 -0
- package/skills/ae-tracking-matrix/references/naming-dict.md +238 -0
- package/skills/ae-tracking-matrix/references/optimization-checklist.md +85 -0
- package/skills/ae-tracking-matrix/references/plan-generation/export-schema.md +142 -0
- package/skills/ae-tracking-matrix/references/plan-generation/module-baseline.md +47 -0
- package/skills/ae-tracking-matrix/references/plan-generation/reference.md +794 -0
- package/skills/ae-tracking-matrix/references/plan-generation/template-catalog.md +94 -0
- package/skills/ae-tracking-matrix/references/scene-routing.md +80 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/android.md +3787 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/c.md +827 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-lua.md +655 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocos2d-x.md +953 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/cocoscreator.md +1128 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/corona.md +714 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/egret.md +1268 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/flutter.md +776 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/h5-and-app-sdk-integration.md +182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/ios.md +2755 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/javascript.md +1182 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/layaair.md +1300 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/macos.md +1369 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/mini-program-mini-game.md +1692 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/openharmony.md +902 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/react-native.md +763 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/uni-app.md +1107 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unity.md +1532 -0
- package/skills/ae-tracking-matrix/references/sdk/client-sdk/unreal.md +845 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/android_sdk_faq.md +228 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/ios_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/java_sdk_faq.md +407 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/javascript_sdk_faq.md +163 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/minigame_sdk_faq.md +149 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/miniprogram_sdk_faq.md +153 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/python_sdk_faq.md +232 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_log_guide.md +314 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/sdk_usage_notes.md +117 -0
- package/skills/ae-tracking-matrix/references/sdk/faq/unity_sdk_faq.md +148 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/filebeat-logstash-guide.md +645 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_guide.md +307 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/logbus2_parser_plugin.md +347 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/restful_api_notes.md +72 -0
- package/skills/ae-tracking-matrix/references/sdk/integration-tools/ta-datax-writer-guide.md +264 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/c.md +566 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/erlang.md +409 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/golang.md +446 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/java.md +557 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/lua.md +457 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/nodejs.md +490 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/php.md +523 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/python.md +484 -0
- package/skills/ae-tracking-matrix/references/sdk/server-sdk/ruby.md +442 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/data-rules.md +391 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/first-event-validation.md +91 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/preset-properties-system-fields.md +635 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/updatable-events.md +113 -0
- package/skills/ae-tracking-matrix/references/sdk/te-data-rules/user-identification-rules.md +466 -0
- package/skills/ae-tracking-matrix/references/standard-base/README.md +22 -0
- package/skills/ae-tracking-matrix/references/standard-base/basic_event_data.md +174 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties.md +20 -0
- package/skills/ae-tracking-matrix/references/standard-base/common_event_properties_setup.md +7 -0
- package/skills/ae-tracking-matrix/references/standard-base/data_type_design_principles.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/gameplay_event_data.md +370 -0
- package/skills/ae-tracking-matrix/references/standard-base/id_system_faq.md +47 -0
- package/skills/ae-tracking-matrix/references/standard-base/integration_must_know.md +37 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_platform_integration_notes.md +27 -0
- package/skills/ae-tracking-matrix/references/standard-base/multi_user_id_system_recommendations.md +23 -0
- package/skills/ae-tracking-matrix/references/standard-base/tracking_notes.md +14 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_data.md +46 -0
- package/skills/ae-tracking-matrix/references/standard-base/user_id_system.md +13 -0
- package/skills/ae-tracking-matrix/references/system-fields.md +297 -0
- package/skills/ae-tracking-matrix/references/te-field-translations.md +1791 -0
- package/skills/ae-tracking-matrix/references/workflows/data-verification.md +232 -0
- package/skills/ae-tracking-matrix/references/workflows/feasibility-analysis.md +829 -0
- package/skills/ae-tracking-matrix/references/workflows/integration-qna.md +355 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-generation.md +283 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-lint.md +168 -0
- package/skills/ae-tracking-matrix/references/workflows/plan-review-optimize.md +205 -0
- package/skills/ae-tracking-matrix/references/workflows/prd-to-suggestions.md +75 -0
- package/skills/ae-tracking-matrix/references/workflows/troubleshooting.md +36 -0
- package/skills/ae-tracking-matrix/references/workflows/validated-upload.md +107 -0
- package/skills/ae-tracking-matrix/scripts/build_template_catalog.py +114 -0
- package/skills/ae-tracking-matrix/scripts/export_tracking_plan.py +53 -0
- package/skills/ae-tracking-matrix/scripts/finalize_plan.py +166 -0
- package/skills/ae-tracking-matrix/scripts/lint_tracking_plan.py +674 -0
- package/skills/ae-tracking-matrix/scripts/plan_contract.py +200 -0
- package/skills/ae-tracking-matrix/scripts/plan_types.py +60 -0
- package/skills/ae-tracking-matrix/scripts/prepare_delivery.py +169 -0
- package/skills/ae-tracking-matrix/scripts/sync_plan.py +296 -0
- package/skills/ae-tracking-matrix/scripts/upload_plan.py +340 -0
- package/dist/chunk-AMBFK2K3.js +0 -28
|
@@ -0,0 +1,1285 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
createCapabilityCommand
|
|
4
|
+
} from "./chunk-TMQGS4TO.js";
|
|
5
|
+
import {
|
|
6
|
+
registerCapabilityGatewayRoute
|
|
7
|
+
} from "./chunk-AWW2T2WL.js";
|
|
8
|
+
import {
|
|
9
|
+
executeCapabilityWithEnvelope
|
|
10
|
+
} from "./chunk-4XKTRCRK.js";
|
|
11
|
+
import {
|
|
12
|
+
CliApiError,
|
|
13
|
+
CliValidationError
|
|
14
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
15
|
+
|
|
16
|
+
// src/commands/ai-monitor/shared.ts
|
|
17
|
+
function createAiMonitorCapabilityCommand(config) {
|
|
18
|
+
return createCapabilityCommand({
|
|
19
|
+
...config,
|
|
20
|
+
cliService: "ai-monitor",
|
|
21
|
+
gatewayDomain: "ai-monitor"
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
function optionalString(ctx, name) {
|
|
25
|
+
const value = ctx.str(name).trim();
|
|
26
|
+
return value || void 0;
|
|
27
|
+
}
|
|
28
|
+
function scopeValue(ctx, friendlyName, rawName, fallback) {
|
|
29
|
+
if (ctx.has?.(friendlyName)) return ctx.str(friendlyName);
|
|
30
|
+
if (ctx.has?.(rawName)) return ctx.str(rawName);
|
|
31
|
+
return fallback;
|
|
32
|
+
}
|
|
33
|
+
async function prepareAiMonitorScope(ctx, input) {
|
|
34
|
+
const hasPlatform = Boolean(ctx.has?.("platform"));
|
|
35
|
+
const hasEnvironment = Boolean(ctx.has?.("environment"));
|
|
36
|
+
const hasRawToken = Boolean(ctx.has?.("data-token"));
|
|
37
|
+
const hasRawSource = Boolean(ctx.has?.("report-source"));
|
|
38
|
+
if ((hasPlatform || hasEnvironment) && (hasRawToken || hasRawSource)) {
|
|
39
|
+
throw new CliValidationError("Use either the friendly scope flags or the advanced compatibility flags, not both.", {
|
|
40
|
+
code: "CONFLICTING_AI_MONITOR_SCOPE_FLAGS"
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
if (hasRawToken || hasRawSource) return input;
|
|
44
|
+
if (hasPlatform && hasEnvironment) return input;
|
|
45
|
+
const result = await executeCapabilityWithEnvelope(
|
|
46
|
+
ctx.host(),
|
|
47
|
+
"ai-monitor",
|
|
48
|
+
"ai_monitor.platform.list",
|
|
49
|
+
{}
|
|
50
|
+
);
|
|
51
|
+
const choices = Array.isArray(result.data?.items) ? result.data.items : [];
|
|
52
|
+
const match = (value, candidates, kind) => {
|
|
53
|
+
const normalized = value.trim().toLowerCase();
|
|
54
|
+
const matches = kind === "platform" ? candidates.filter((item) => item.platform_id.toLowerCase() === normalized || item.platform_name.trim().toLowerCase() === normalized) : candidates;
|
|
55
|
+
if (matches.length > 1) {
|
|
56
|
+
throw new CliValidationError(`Ambiguous ${kind} '${value}'.`, { code: "AMBIGUOUS_AI_MONITOR_SCOPE", hint: "Use the id shown by: ai-monitor platform list" });
|
|
57
|
+
}
|
|
58
|
+
return matches[0];
|
|
59
|
+
};
|
|
60
|
+
let platform;
|
|
61
|
+
if (hasPlatform) {
|
|
62
|
+
platform = match(ctx.str("platform"), choices, "platform");
|
|
63
|
+
if (!platform) throw new CliValidationError(`Unknown Agent platform '${ctx.str("platform")}'.`, { code: "INVALID_AI_MONITOR_PLATFORM", hint: "Run: ai-monitor platform list" });
|
|
64
|
+
} else if (choices.length === 1) {
|
|
65
|
+
platform = choices[0];
|
|
66
|
+
} else if (choices.length === 0) {
|
|
67
|
+
throw new CliValidationError("No Agent platform is available for the current account.", {
|
|
68
|
+
code: "AI_MONITOR_SCOPE_UNAVAILABLE",
|
|
69
|
+
hint: "Check the AI Monitor platform configuration or contact an administrator."
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
if (hasEnvironment) {
|
|
73
|
+
const candidates = platform ? [platform] : choices;
|
|
74
|
+
const environmentMatches = candidates.flatMap((item) => item.environments.filter((environment) => environment.environment_id.toLowerCase() === ctx.str("environment").trim().toLowerCase() || environment.environment_name.trim().toLowerCase() === ctx.str("environment").trim().toLowerCase()).map((environment) => ({ platform: item, environment })));
|
|
75
|
+
if (environmentMatches.length !== 1) {
|
|
76
|
+
throw new CliValidationError(
|
|
77
|
+
environmentMatches.length > 1 ? `Ambiguous runtime environment '${ctx.str("environment")}'.` : `Unknown runtime environment '${ctx.str("environment")}'.`,
|
|
78
|
+
{ code: "INVALID_AI_MONITOR_ENVIRONMENT", hint: "Run: ai-monitor platform list" }
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
|
+
platform = environmentMatches[0].platform;
|
|
82
|
+
return { ...input, data_token: platform.platform_id, report_source: environmentMatches[0].environment.environment_id };
|
|
83
|
+
}
|
|
84
|
+
if (!platform) {
|
|
85
|
+
throw new CliValidationError("Multiple Agent platforms are available; choose one.", {
|
|
86
|
+
code: "AI_MONITOR_SCOPE_REQUIRED",
|
|
87
|
+
hint: "Run: ai-monitor platform list, then pass --platform and optionally --environment."
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (platform.environments.length === 0) {
|
|
91
|
+
throw new CliValidationError(`No runtime environment is available for '${platform.platform_name}'.`, {
|
|
92
|
+
code: "AI_MONITOR_ENVIRONMENT_UNAVAILABLE",
|
|
93
|
+
hint: "Run: ai-monitor platform list"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
if (platform.environments.length !== 1) {
|
|
97
|
+
throw new CliValidationError(`Multiple runtime environments are available for '${platform.platform_name}'.`, {
|
|
98
|
+
code: "AI_MONITOR_ENVIRONMENT_REQUIRED",
|
|
99
|
+
hint: "Pass --environment using a value from: ai-monitor platform list"
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
return { ...input, data_token: platform.platform_id, report_source: platform.environments[0].environment_id };
|
|
103
|
+
}
|
|
104
|
+
function validateDateRange(ctx) {
|
|
105
|
+
const start = optionalString(ctx, "start-date");
|
|
106
|
+
const end = optionalString(ctx, "end-date");
|
|
107
|
+
if (start === void 0 !== (end === void 0)) {
|
|
108
|
+
throw new CliValidationError("--start-date and --end-date must be provided together.", {
|
|
109
|
+
code: "INVALID_DATE_RANGE"
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
if (start && end && start > end) {
|
|
113
|
+
throw new CliValidationError("--start-date must not be later than --end-date.", {
|
|
114
|
+
code: "INVALID_DATE_RANGE"
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
function normalizedSortBy(ctx) {
|
|
119
|
+
const value = ctx.str("sort-by");
|
|
120
|
+
const values = {
|
|
121
|
+
"start-time": "start_time",
|
|
122
|
+
"end-time": "end_time",
|
|
123
|
+
duration: "duration",
|
|
124
|
+
"total-tokens": "total_tokens",
|
|
125
|
+
"span-count": "span_count",
|
|
126
|
+
"error-span-count": "error_span_count",
|
|
127
|
+
"recorded-costs": "recorded_costs"
|
|
128
|
+
};
|
|
129
|
+
const normalized = values[value];
|
|
130
|
+
if (!normalized) {
|
|
131
|
+
throw new CliValidationError("--sort-by has an unsupported value.", {
|
|
132
|
+
code: "INVALID_SORT_FIELD",
|
|
133
|
+
hint: `Use one of: ${Object.keys(values).join(", ")}.`
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
return normalized;
|
|
137
|
+
}
|
|
138
|
+
function normalizedSortOrder(ctx) {
|
|
139
|
+
const value = ctx.str("sort-order");
|
|
140
|
+
if (value !== "asc" && value !== "desc") {
|
|
141
|
+
throw new CliValidationError("--sort-order must be asc or desc.", {
|
|
142
|
+
code: "INVALID_SORT_ORDER"
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return value;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
// src/commands/ai-monitor/read-shared.ts
|
|
149
|
+
var scopeFlags = [
|
|
150
|
+
{ name: "platform", type: "string", desc: "Agent platform name or ID from platform list.", minLength: 1, maxLength: 255 },
|
|
151
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or ID from platform list.", minLength: 1, maxLength: 255 },
|
|
152
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility platform key; default AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
153
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility runtime key; default __default__.", minLength: 1, maxLength: 255 }
|
|
154
|
+
];
|
|
155
|
+
function buildScopeInput(ctx) {
|
|
156
|
+
return {
|
|
157
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
158
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__")
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
function invalid(name, message) {
|
|
162
|
+
throw new CliValidationError(`--${name} ${message}`, { code: "INVALID_AI_MONITOR_INPUT" });
|
|
163
|
+
}
|
|
164
|
+
function readFields(ctx, fields) {
|
|
165
|
+
const input = {};
|
|
166
|
+
for (const field of fields) {
|
|
167
|
+
if (!ctx.has?.(field.name) && field.default === void 0 && !field.required) continue;
|
|
168
|
+
const value = !ctx.has?.(field.name) && field.default !== void 0 ? field.default : field.type === "json" ? ctx.json(field.name) : field.type === "number" ? ctx.num(field.name) : field.type === "boolean" ? ctx.bool(field.name) : ctx.str(field.name).trim();
|
|
169
|
+
if (field.choices && !field.choices.includes(value)) invalid(field.name, `must be one of: ${field.choices.join(", ")}.`);
|
|
170
|
+
if (field.integer && !Number.isSafeInteger(value)) invalid(field.name, "must be a safe integer.");
|
|
171
|
+
if (field.array) {
|
|
172
|
+
if (!Array.isArray(value)) invalid(field.name, "must be a JSON array.");
|
|
173
|
+
if (field.minItems !== void 0 && value.length < field.minItems) invalid(field.name, `must contain at least ${field.minItems} items.`);
|
|
174
|
+
if (field.maxItems !== void 0 && value.length > field.maxItems) invalid(field.name, `must contain at most ${field.maxItems} items.`);
|
|
175
|
+
if (field.stringItems && value.some((item) => typeof item !== "string" || !item.trim())) invalid(field.name, "must contain nonempty strings.");
|
|
176
|
+
if (field.itemChoices && value.some((item) => !field.itemChoices.includes(item))) invalid(field.name, "contains an unsupported value.");
|
|
177
|
+
}
|
|
178
|
+
input[field.name.replace(/-/g, "_")] = value;
|
|
179
|
+
}
|
|
180
|
+
return input;
|
|
181
|
+
}
|
|
182
|
+
function buildReadInput(ctx, spec) {
|
|
183
|
+
const input = { ...buildScopeInput(ctx), ...readFields(ctx, spec.fields) };
|
|
184
|
+
for (const [start, end] of [
|
|
185
|
+
["start_date", "end_date"],
|
|
186
|
+
["period_start", "period_end"],
|
|
187
|
+
["before_last_seen_at", "before_issue_id"],
|
|
188
|
+
["before_occurred_at", "before_finding_id"],
|
|
189
|
+
["before_created_at", "before_task_id"]
|
|
190
|
+
]) {
|
|
191
|
+
if (input[start] === void 0 !== (input[end] === void 0)) invalid(start.replace(/_/g, "-"), `and --${end.replace(/_/g, "-")} must be provided together.`);
|
|
192
|
+
if (start.endsWith("date") || start === "period_start") {
|
|
193
|
+
if (input[start] && input[end] && String(input[start]) > String(input[end])) invalid(start.replace(/_/g, "-"), "must not be later than the end date.");
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
if (spec.id === "ai_monitor.diagnosis.list" && Boolean(input.entity_type) !== Boolean(input.entity_key)) invalid("entity-type", "and --entity-key must be provided together.");
|
|
197
|
+
if (spec.id === "ai_monitor.diagnosis.report" && input.entity_type !== "global" && !input.entity_key) invalid("entity-key", "is required for non-global reports.");
|
|
198
|
+
if (spec.id === "ai_monitor.security.task_findings" && input.after_ordinal !== void 0 && input.trace_id !== void 0) invalid("after-ordinal", "cannot be combined with --trace-id.");
|
|
199
|
+
return input;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// src/commands/ai-monitor/read-command-specs.ts
|
|
203
|
+
var READ_COMMAND_SPECS = [
|
|
204
|
+
{
|
|
205
|
+
id: "ai_monitor.bad_trace.list",
|
|
206
|
+
description: "List formal Bad Trace observations; dates filter warehouse observation pd, quality flags use AND.",
|
|
207
|
+
outputDescription: "Latest observation per company/Trace with formal quality flags, evidence and pagination.",
|
|
208
|
+
fields: [
|
|
209
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
210
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
211
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
212
|
+
{ "name": "filter-groups", "type": "json", "desc": "Strict page filter group tree as JSON (at most 10 rules and depth 2).", "sensitive": true },
|
|
213
|
+
{ "name": "status", "type": "string", "desc": "Exact status. Choices: STATUS_CODE_OK, STATUS_CODE_ERROR, STATUS_CODE_UNSET.", "choices": ["STATUS_CODE_OK", "STATUS_CODE_ERROR", "STATUS_CODE_UNSET"] },
|
|
214
|
+
{ "name": "user-cancelled", "type": "boolean", "desc": "Filter explicit user cancellation (true or false)." },
|
|
215
|
+
{ "name": "quality-flags", "type": "json", "desc": "JSON array of formal quality flag names; all supplied flags must match.", "array": true, "minItems": 1, "maxItems": 32, "itemChoices": ["l0_trace_error", "l0_step_error", "l0_client_aborted", "l0_model_downgraded", "l0_context_pruned", "l0_output_truncated", "l0_empty_output", "l0_no_end_turn", "l1_slow", "l1_expensive", "l1_heavy", "l2_infra_llm_error", "l2_infra_instant_death", "l2_infra_auth_or_license", "l2_infra_upstream_down", "l2_tool_error", "l2_tool_param_fail", "l2_tool_result_overflow", "l2_tool_context_overflow", "l2_tool_query_empty", "l2_model_downgraded", "l2_model_thinking_heavy", "l2_model_output_truncated", "l2_model_not_found", "l2_prompt_runaway", "l2_prompt_forced_stop", "l2_prompt_verbose_output", "l2_prompt_identity_leak", "l2_arch_deep_nesting", "l2_arch_tool_overload", "l2_arch_mcp_unavailable", "l2_arch_max_turns_hit"], "stringItems": true },
|
|
216
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
217
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
218
|
+
{ "name": "search", "type": "string", "desc": "Search text.", "minLength": 1, "maxLength": 500 },
|
|
219
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
220
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true }
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
id: "ai_monitor.bad_trace.count",
|
|
225
|
+
description: "Count formal Bad Traces with the same filters as bad_trace.list.",
|
|
226
|
+
outputDescription: "Count and applied filters.",
|
|
227
|
+
fields: [
|
|
228
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
229
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
230
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
231
|
+
{ "name": "filter-groups", "type": "json", "desc": "Strict page filter group tree as JSON (at most 10 rules and depth 2).", "sensitive": true },
|
|
232
|
+
{ "name": "status", "type": "string", "desc": "Exact status. Choices: STATUS_CODE_OK, STATUS_CODE_ERROR, STATUS_CODE_UNSET.", "choices": ["STATUS_CODE_OK", "STATUS_CODE_ERROR", "STATUS_CODE_UNSET"] },
|
|
233
|
+
{ "name": "user-cancelled", "type": "boolean", "desc": "Filter explicit user cancellation (true or false)." },
|
|
234
|
+
{ "name": "quality-flags", "type": "json", "desc": "JSON array of formal quality flag names; all supplied flags must match.", "array": true, "minItems": 1, "maxItems": 32, "itemChoices": ["l0_trace_error", "l0_step_error", "l0_client_aborted", "l0_model_downgraded", "l0_context_pruned", "l0_output_truncated", "l0_empty_output", "l0_no_end_turn", "l1_slow", "l1_expensive", "l1_heavy", "l2_infra_llm_error", "l2_infra_instant_death", "l2_infra_auth_or_license", "l2_infra_upstream_down", "l2_tool_error", "l2_tool_param_fail", "l2_tool_result_overflow", "l2_tool_context_overflow", "l2_tool_query_empty", "l2_model_downgraded", "l2_model_thinking_heavy", "l2_model_output_truncated", "l2_model_not_found", "l2_prompt_runaway", "l2_prompt_forced_stop", "l2_prompt_verbose_output", "l2_prompt_identity_leak", "l2_arch_deep_nesting", "l2_arch_tool_overload", "l2_arch_mcp_unavailable", "l2_arch_max_turns_hit"], "stringItems": true },
|
|
235
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
236
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
237
|
+
{ "name": "search", "type": "string", "desc": "Search text.", "minLength": 1, "maxLength": 500 }
|
|
238
|
+
]
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
id: "ai_monitor.bad_trace.get",
|
|
242
|
+
description: "Read the latest formal Bad Trace observation in the authenticated scope.",
|
|
243
|
+
outputDescription: "Formal Bad Trace observation and evidence, or not-found error.",
|
|
244
|
+
fields: [
|
|
245
|
+
{ "name": "trace-id", "type": "string", "desc": "Exact Trace ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
id: "ai_monitor.overview.get",
|
|
250
|
+
description: "Read dashboard metrics, trends and expensive or slow traces.",
|
|
251
|
+
outputDescription: "Dashboard summary, trend, agents and insight evidence.",
|
|
252
|
+
fields: [
|
|
253
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
254
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
255
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
256
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
257
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
258
|
+
]
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
id: "ai_monitor.agent.list",
|
|
262
|
+
description: "Read Agent execution statistics and recorded costs.",
|
|
263
|
+
outputDescription: "Current and previous period statistics plus recorded costs by Agent.",
|
|
264
|
+
fields: [
|
|
265
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
266
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
267
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
268
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
269
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: "ai_monitor.agent.get",
|
|
274
|
+
description: "Read execution statistics and daily trend for one Agent.",
|
|
275
|
+
outputDescription: "Agent period metrics, daily trend and recorded costs.",
|
|
276
|
+
fields: [
|
|
277
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
278
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
279
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
280
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "required": true, "minLength": 1, "maxLength": 255 },
|
|
281
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
282
|
+
]
|
|
283
|
+
},
|
|
284
|
+
{
|
|
285
|
+
id: "ai_monitor.tool.list",
|
|
286
|
+
description: "List observed Tool execution statistics.",
|
|
287
|
+
outputDescription: "Tool call counts, errors and latency statistics.",
|
|
288
|
+
fields: [
|
|
289
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
290
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
291
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
292
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
293
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
id: "ai_monitor.tool.get",
|
|
298
|
+
description: "Read Tool metrics, time series and error types.",
|
|
299
|
+
outputDescription: "Tool metrics, time series and error type distribution.",
|
|
300
|
+
fields: [
|
|
301
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
302
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
303
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
304
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
305
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
306
|
+
{ "name": "tool-name", "type": "string", "desc": "Exact observed Tool name.", "required": true, "minLength": 1, "maxLength": 255 }
|
|
307
|
+
]
|
|
308
|
+
},
|
|
309
|
+
{
|
|
310
|
+
id: "ai_monitor.tool.calls",
|
|
311
|
+
description: "Read paginated Tool calls and execution results.",
|
|
312
|
+
outputDescription: "Call items, total and aggregate call statistics.",
|
|
313
|
+
fields: [
|
|
314
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
315
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
316
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
317
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
318
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
319
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
320
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
321
|
+
{ "name": "tool-name", "type": "string", "desc": "Exact observed Tool name.", "required": true, "minLength": 1, "maxLength": 255 },
|
|
322
|
+
{ "name": "search", "type": "string", "desc": "Search text.", "minLength": 1, "maxLength": 255 },
|
|
323
|
+
{ "name": "status-filter", "type": "json", "desc": "JSON array of Tool call statuses.", "array": true, "maxItems": 20, "stringItems": true },
|
|
324
|
+
{ "name": "sort-by", "type": "string", "desc": 'Sort field (gateway field name). Choices: start_time_unix_nano, duration_ms. Default: "start_time_unix_nano".', "default": "start_time_unix_nano", "choices": ["start_time_unix_nano", "duration_ms"] },
|
|
325
|
+
{ "name": "sort-order", "type": "string", "desc": 'Sort direction. Choices: asc, desc. Default: "desc".', "default": "desc", "choices": ["asc", "desc"] }
|
|
326
|
+
]
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
id: "ai_monitor.model.list",
|
|
330
|
+
description: "List the latest model monitoring statistics.",
|
|
331
|
+
outputDescription: "Model and Agent pairs, issue indicators and total count; latest snapshot date is returned per row.",
|
|
332
|
+
fields: [
|
|
333
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
334
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
335
|
+
{ "name": "search", "type": "string", "desc": "Search text.", "minLength": 1, "maxLength": 255 },
|
|
336
|
+
{ "name": "has-issue", "type": "boolean", "desc": "Select models with or without recorded issues." },
|
|
337
|
+
{ "name": "issue-type", "type": "string", "desc": "Model issue type. Choices: thinking_heavy, truncated, not_found.", "choices": ["thinking_heavy", "truncated", "not_found"] }
|
|
338
|
+
]
|
|
339
|
+
},
|
|
340
|
+
{
|
|
341
|
+
id: "ai_monitor.model.get",
|
|
342
|
+
description: "Read model summary and historical trend.",
|
|
343
|
+
outputDescription: "Summary at stats_date (latest by default), and trend in the selected date range.",
|
|
344
|
+
fields: [
|
|
345
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 30.", "default": 30, "min": 1, "max": 90, "integer": true },
|
|
346
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
347
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
348
|
+
{ "name": "model-key", "type": "string", "desc": "Exact model monitoring key.", "minLength": 1, "maxLength": 255, "required": true },
|
|
349
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
350
|
+
{ "name": "stats-date", "type": "string", "desc": "Summary snapshot date (YYYY-MM-DD); latest when omitted.", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
id: "ai_monitor.model.compare",
|
|
355
|
+
description: "Compare model and Agent pairs using the monitoring summary metrics.",
|
|
356
|
+
outputDescription: "One summary per selected model and Agent pair.",
|
|
357
|
+
fields: [
|
|
358
|
+
{ "name": "models", "type": "json", "desc": "JSON array of 2 to 10 objects with model_key and optional agent.", "required": true, "array": true, "minItems": 2, "maxItems": 10, "sensitive": true },
|
|
359
|
+
{ "name": "stats-date", "type": "string", "desc": "Summary snapshot date (YYYY-MM-DD); latest when omitted.", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
|
|
360
|
+
]
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
id: "ai_monitor.model.agent_channels",
|
|
364
|
+
description: "Read model usage by Agent and Channel over a window ending at the latest data date.",
|
|
365
|
+
outputDescription: "Agent and Channel usage, errors and latency; latest-date window semantics match the model page.",
|
|
366
|
+
fields: [
|
|
367
|
+
{ "name": "model-key", "type": "string", "desc": "Exact model monitoring key.", "minLength": 1, "maxLength": 255, "required": true },
|
|
368
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 30.", "default": 30, "min": 1, "max": 90, "integer": true },
|
|
369
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 50.", "default": 50, "min": 1, "max": 100, "integer": true }
|
|
370
|
+
]
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
id: "ai_monitor.model.traces",
|
|
374
|
+
description: "Read model-related bad traces over a window ending at the latest data date.",
|
|
375
|
+
outputDescription: "Bad Trace items and total count with model issue evidence.",
|
|
376
|
+
fields: [
|
|
377
|
+
{ "name": "model-key", "type": "string", "desc": "Exact model monitoring key.", "minLength": 1, "maxLength": 255, "required": true },
|
|
378
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 30.", "default": 30, "min": 1, "max": 90, "integer": true },
|
|
379
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
380
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true }
|
|
381
|
+
]
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
id: "ai_monitor.skill.list",
|
|
385
|
+
description: "List observed Skill usage statistics.",
|
|
386
|
+
outputDescription: "Skill totals, daily Trace counts and Agent call distribution.",
|
|
387
|
+
fields: [
|
|
388
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
389
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
390
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
391
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
392
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
393
|
+
]
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
id: "ai_monitor.skill.get",
|
|
397
|
+
description: "Read observed usage and trend for one Skill.",
|
|
398
|
+
outputDescription: "Skill totals, daily Trace counts and Agent call distribution.",
|
|
399
|
+
fields: [
|
|
400
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
401
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
402
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
403
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
404
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
405
|
+
{ "name": "skill-name", "type": "string", "desc": "Exact observed Skill name.", "required": true, "minLength": 1, "maxLength": 255 }
|
|
406
|
+
]
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
id: "ai_monitor.skill.traces",
|
|
410
|
+
description: "Read paginated traces using a Skill.",
|
|
411
|
+
outputDescription: "Trace items and total count.",
|
|
412
|
+
fields: [
|
|
413
|
+
{ "name": "last-days", "type": "number", "desc": "Lookback days when no explicit date range is supplied. Default: 7.", "default": 7, "min": 1, "max": 30, "integer": true },
|
|
414
|
+
{ "name": "start-date", "type": "string", "desc": "Inclusive start date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
415
|
+
{ "name": "end-date", "type": "string", "desc": "Inclusive end date (YYYY-MM-DD).", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
416
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
417
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
418
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
419
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
420
|
+
{ "name": "skill-name", "type": "string", "desc": "Exact observed Skill name.", "required": true, "minLength": 1, "maxLength": 255 },
|
|
421
|
+
{ "name": "sort-by", "type": "string", "desc": 'Sort field (gateway field name). Choices: duration, token_count_total, span_cnt, error_span_cnt, start_time, end_time. Default: "start_time".', "default": "start_time", "choices": ["duration", "token_count_total", "span_cnt", "error_span_cnt", "start_time", "end_time"] },
|
|
422
|
+
{ "name": "sort-order", "type": "string", "desc": 'Sort direction. Choices: asc, desc. Default: "desc".', "default": "desc", "choices": ["asc", "desc"] }
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
id: "ai_monitor.cost.summary",
|
|
427
|
+
description: "Read Token cost summary. Uses a [start, end) interval, maximum 90 days.",
|
|
428
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
429
|
+
fields: [
|
|
430
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
431
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
432
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
433
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
434
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
435
|
+
]
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
id: "ai_monitor.cost.trend",
|
|
439
|
+
description: "Read Token consumption trend. Uses a [start, end) interval, maximum 90 days.",
|
|
440
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
441
|
+
fields: [
|
|
442
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
443
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
444
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
445
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
446
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
id: "ai_monitor.cost.actual_summary",
|
|
451
|
+
description: "Read recorded monetary cost summary. Uses a [start, end) interval, maximum 90 days.",
|
|
452
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
453
|
+
fields: [
|
|
454
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
455
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
456
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
457
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
458
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
459
|
+
]
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
id: "ai_monitor.cost.actual_trend",
|
|
463
|
+
description: "Read recorded monetary cost trend. Uses a [start, end) interval, maximum 90 days.",
|
|
464
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
465
|
+
fields: [
|
|
466
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
467
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
468
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
469
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
470
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
471
|
+
]
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
id: "ai_monitor.cost.actual_change",
|
|
475
|
+
description: "Compare recorded monetary cost with the previous equal period. Uses a [start, end) interval, maximum 90 days.",
|
|
476
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
477
|
+
fields: [
|
|
478
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
479
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
480
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
481
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
482
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
483
|
+
]
|
|
484
|
+
},
|
|
485
|
+
{
|
|
486
|
+
id: "ai_monitor.cost.insight",
|
|
487
|
+
description: "Read the existing cost overview insight. Uses a [start, end) interval, maximum 90 days.",
|
|
488
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
489
|
+
fields: [
|
|
490
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
491
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
492
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
493
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
494
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
495
|
+
]
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
id: "ai_monitor.cost.value_health",
|
|
499
|
+
description: "Read usage value and technical health indicators. Uses a [start, end) interval, maximum 90 days.",
|
|
500
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
501
|
+
fields: [
|
|
502
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
503
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
504
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
505
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
506
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
507
|
+
]
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
id: "ai_monitor.cost.distribution",
|
|
511
|
+
description: "Read Trace cost and Token distributions. Uses a [start, end) interval, maximum 90 days.",
|
|
512
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
513
|
+
fields: [
|
|
514
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
515
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
516
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
517
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
518
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
519
|
+
]
|
|
520
|
+
},
|
|
521
|
+
{
|
|
522
|
+
id: "ai_monitor.cost.subject_change",
|
|
523
|
+
description: "Read subject cost changes against the previous equal period. Uses a [start, end) interval, maximum 90 days.",
|
|
524
|
+
outputDescription: "Existing cost analysis payload including metric version, coverage and warnings where available.",
|
|
525
|
+
fields: [
|
|
526
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
527
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
528
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
529
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
530
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 }
|
|
531
|
+
]
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
id: "ai_monitor.cost.rankings",
|
|
535
|
+
description: "Rank subjects by Token consumption.",
|
|
536
|
+
outputDescription: "Subject rankings, effective subject and coverage metadata.",
|
|
537
|
+
fields: [
|
|
538
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
539
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
540
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
541
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
542
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
543
|
+
{ "name": "subject", "type": "string", "desc": "Subject dimension. Choices: user, agent, actual_model, primary_model.", "required": true, "choices": ["user", "agent", "actual_model", "primary_model"] },
|
|
544
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 10.", "default": 10, "min": 1, "max": 50, "integer": true }
|
|
545
|
+
]
|
|
546
|
+
},
|
|
547
|
+
{
|
|
548
|
+
id: "ai_monitor.cost.subject_rankings",
|
|
549
|
+
description: "Read paginated subject consumption rankings by cost or Token.",
|
|
550
|
+
outputDescription: "Ranking items and service pagination metadata.",
|
|
551
|
+
fields: [
|
|
552
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
553
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
554
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
555
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
556
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
557
|
+
{ "name": "dimension", "type": "string", "desc": "Ranking dimension. Choices: user, agent, primary_model, trace.", "required": true, "choices": ["user", "agent", "primary_model", "trace"] },
|
|
558
|
+
{ "name": "metric", "type": "string", "desc": "Ranking metric. Choices: cost, token.", "required": true, "choices": ["cost", "token"] },
|
|
559
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 10.", "default": 10, "min": 1, "max": 50, "integer": true },
|
|
560
|
+
{ "name": "page", "type": "number", "desc": "One-based page number.", "min": 1, "max": 1e6, "integer": true }
|
|
561
|
+
]
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
id: "ai_monitor.cost.subject_get",
|
|
565
|
+
description: "Read cost metrics for a subject.",
|
|
566
|
+
outputDescription: "Subject metrics, peer comparison and value health.",
|
|
567
|
+
fields: [
|
|
568
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
569
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
570
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
571
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
572
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
573
|
+
{ "name": "subject", "type": "string", "desc": "Subject dimension. Choices: user, agent, actual_model, primary_model.", "required": true, "choices": ["user", "agent", "actual_model", "primary_model"] },
|
|
574
|
+
{ "name": "subject-key", "type": "string", "desc": "Exact subject key returned by rankings.", "required": true, "minLength": 1, "maxLength": 255 }
|
|
575
|
+
]
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
id: "ai_monitor.cost.attribution",
|
|
579
|
+
description: "Read cost attribution and supporting Trace evidence for a subject.",
|
|
580
|
+
outputDescription: "Attribution drivers, associations, evidence and coverage.",
|
|
581
|
+
fields: [
|
|
582
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
583
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
584
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
585
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
586
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
587
|
+
{ "name": "subject", "type": "string", "desc": "Subject dimension. Choices: user, agent, actual_model, primary_model.", "required": true, "choices": ["user", "agent", "actual_model", "primary_model"] },
|
|
588
|
+
{ "name": "subject-key", "type": "string", "desc": "Exact subject key returned by rankings.", "required": true, "minLength": 1, "maxLength": 255 }
|
|
589
|
+
]
|
|
590
|
+
},
|
|
591
|
+
{
|
|
592
|
+
id: "ai_monitor.cost.driver_get",
|
|
593
|
+
description: "Read existing drilldown evidence for a cost attribution driver.",
|
|
594
|
+
outputDescription: "Driver evidence and availability; this does not start AI analysis.",
|
|
595
|
+
fields: [
|
|
596
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
597
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
598
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
599
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
600
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
601
|
+
{ "name": "subject", "type": "string", "desc": "Subject dimension. Choices: user, agent, actual_model, primary_model.", "required": true, "choices": ["user", "agent", "actual_model", "primary_model"] },
|
|
602
|
+
{ "name": "subject-key", "type": "string", "desc": "Exact subject key returned by rankings.", "required": true, "minLength": 1, "maxLength": 255 },
|
|
603
|
+
{ "name": "driver-id", "type": "string", "desc": "Attribution driver ID. Choices: turn_cnt, llm_span_cnt, tool_cnt, tool_span_cnt, tool_error_span_cnt, max_request_messages_count, max_context_size_chars, trace_input_chars, llm_output_chars, thinking_output_chars, max_tokens_rate, subagent_rate, max_agent_depth, model_mismatch_rate, context_pruned_rate, client_aborted_rate, tracker_recovered_rate.", "required": true, "choices": ["turn_cnt", "llm_span_cnt", "tool_cnt", "tool_span_cnt", "tool_error_span_cnt", "max_request_messages_count", "max_context_size_chars", "trace_input_chars", "llm_output_chars", "thinking_output_chars", "max_tokens_rate", "subagent_rate", "max_agent_depth", "model_mismatch_rate", "context_pruned_rate", "client_aborted_rate", "tracker_recovered_rate"] }
|
|
604
|
+
]
|
|
605
|
+
},
|
|
606
|
+
{
|
|
607
|
+
id: "ai_monitor.cost.trace_cost",
|
|
608
|
+
description: "Read Trace cost overview, optionally for one Agent.",
|
|
609
|
+
outputDescription: "Trace cost overview and metric coverage.",
|
|
610
|
+
fields: [
|
|
611
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
612
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
613
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
614
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
615
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
616
|
+
{ "name": "agent-key", "type": "string", "desc": "Exact Agent key.", "minLength": 1, "maxLength": 255 }
|
|
617
|
+
]
|
|
618
|
+
},
|
|
619
|
+
{
|
|
620
|
+
id: "ai_monitor.cost.change",
|
|
621
|
+
description: "Compare Token consumption with the previous equal [start, end) period.",
|
|
622
|
+
outputDescription: "Period summaries, decomposition and behavior drivers.",
|
|
623
|
+
fields: [
|
|
624
|
+
{ "name": "start", "type": "string", "desc": "Inclusive interval start: YYYY-MM-DD or ISO timestamp with timezone.", "required": true },
|
|
625
|
+
{ "name": "end", "type": "string", "desc": "Exclusive interval end: YYYY-MM-DD or ISO timestamp with timezone; maximum interval 90 days.", "required": true },
|
|
626
|
+
{ "name": "project-ids", "type": "json", "desc": "JSON array of project IDs.", "array": true, "maxItems": 50, "stringItems": true },
|
|
627
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 },
|
|
628
|
+
{ "name": "channel", "type": "string", "desc": "Exact Agent channel.", "minLength": 1, "maxLength": 255 },
|
|
629
|
+
{ "name": "directions", "type": "string", "desc": 'Which change directions to include. Choices: increase, both. Default: "both".', "default": "both", "choices": ["increase", "both"] },
|
|
630
|
+
{ "name": "execution-status", "type": "string", "desc": "Execution status selection. Choices: final.", "choices": ["final"] }
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
id: "ai_monitor.cost.report_list",
|
|
635
|
+
description: "List the current account\u2019s existing cost analysis reports.",
|
|
636
|
+
outputDescription: "Owned cost analysis cases with run status, summary and pagination.",
|
|
637
|
+
fields: [
|
|
638
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Choices: 10, 20, 50. Default: 20.", "default": 20, "integer": true, "choices": [10, 20, 50] },
|
|
639
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9999999, "integer": true },
|
|
640
|
+
{ "name": "keyword", "type": "string", "desc": "Case title keyword.", "maxLength": 80 },
|
|
641
|
+
{ "name": "status", "type": "string", "desc": "Exact status. Choices: pending, running, completed, failed, cancelled.", "choices": ["pending", "running", "completed", "failed", "cancelled"] },
|
|
642
|
+
{ "name": "period-start", "type": "string", "desc": "Inclusive historical report period start date.", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
643
|
+
{ "name": "period-end", "type": "string", "desc": "Inclusive historical report period end date.", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" }
|
|
644
|
+
]
|
|
645
|
+
},
|
|
646
|
+
{
|
|
647
|
+
id: "ai_monitor.cost.report_get",
|
|
648
|
+
description: "Read an existing owned cost analysis report.",
|
|
649
|
+
outputDescription: "Run progress, frozen range and compatible report; no new analysis is started.",
|
|
650
|
+
fields: [
|
|
651
|
+
{ "name": "case-id", "type": "string", "desc": "Existing investigation case ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
652
|
+
{ "name": "run-id", "type": "string", "desc": "Existing run ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
{
|
|
656
|
+
id: "ai_monitor.security.overview",
|
|
657
|
+
description: "Read security audit overview for the selected company.",
|
|
658
|
+
outputDescription: "Risk totals, categories and recent tasks.",
|
|
659
|
+
fields: []
|
|
660
|
+
},
|
|
661
|
+
{
|
|
662
|
+
id: "ai_monitor.security.issues",
|
|
663
|
+
description: "List security issues using the existing cursor pagination.",
|
|
664
|
+
outputDescription: "Issue items, has_more and next_cursor.",
|
|
665
|
+
fields: [
|
|
666
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
667
|
+
{ "name": "decision", "type": "string", "desc": "Security issue review state. Choices: pending, confirmed, false_positive.", "choices": ["pending", "confirmed", "false_positive"] },
|
|
668
|
+
{ "name": "rule-key", "type": "string", "desc": "Exact security rule key.", "minLength": 1, "maxLength": 255 },
|
|
669
|
+
{ "name": "before-last-seen-at", "type": "string", "desc": "Issue cursor timestamp from the previous response (ISO with timezone).", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" },
|
|
670
|
+
{ "name": "before-issue-id", "type": "string", "desc": "Issue cursor ID paired with before-last-seen-at.", "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
671
|
+
]
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
id: "ai_monitor.security.issue_get",
|
|
675
|
+
description: "Read a security issue and recent findings and reviews.",
|
|
676
|
+
outputDescription: "Issue details, recent findings and reviews.",
|
|
677
|
+
fields: [
|
|
678
|
+
{ "name": "issue-id", "type": "string", "desc": "Existing security issue ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
679
|
+
]
|
|
680
|
+
},
|
|
681
|
+
{
|
|
682
|
+
id: "ai_monitor.security.issue_findings",
|
|
683
|
+
description: "Read additional findings for a security issue.",
|
|
684
|
+
outputDescription: "Finding items and next_cursor.",
|
|
685
|
+
fields: [
|
|
686
|
+
{ "name": "issue-id", "type": "string", "desc": "Existing security issue ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
687
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
688
|
+
{ "name": "before-occurred-at", "type": "string", "desc": "Finding cursor timestamp from the previous response (ISO with timezone).", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" },
|
|
689
|
+
{ "name": "before-finding-id", "type": "string", "desc": "Finding cursor ID paired with before-occurred-at.", "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
690
|
+
]
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
id: "ai_monitor.security.evidence",
|
|
694
|
+
description: "Read security finding evidence and source availability.",
|
|
695
|
+
outputDescription: "Finding details, evidence and source Trace availability.",
|
|
696
|
+
fields: [
|
|
697
|
+
{ "name": "task-finding-id", "type": "string", "desc": "Existing security task finding ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
698
|
+
]
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
id: "ai_monitor.security.tasks",
|
|
702
|
+
description: "List existing security audit tasks.",
|
|
703
|
+
outputDescription: "Task items, list snapshot and next cursor.",
|
|
704
|
+
fields: [
|
|
705
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
706
|
+
{ "name": "list-snapshot-at", "type": "string", "desc": "Stable list snapshot timestamp from the first page.", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" },
|
|
707
|
+
{ "name": "before-created-at", "type": "string", "desc": "Task cursor timestamp from the previous response (ISO with timezone).", "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$" },
|
|
708
|
+
{ "name": "before-task-id", "type": "string", "desc": "Task cursor ID paired with before-created-at.", "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
709
|
+
]
|
|
710
|
+
},
|
|
711
|
+
{
|
|
712
|
+
id: "ai_monitor.security.task_get",
|
|
713
|
+
description: "Read security audit task progress and detail.",
|
|
714
|
+
outputDescription: "The existing task detail DTO.",
|
|
715
|
+
fields: [
|
|
716
|
+
{ "name": "task-id", "type": "string", "desc": "Existing task ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
717
|
+
]
|
|
718
|
+
},
|
|
719
|
+
{
|
|
720
|
+
id: "ai_monitor.security.task_traces",
|
|
721
|
+
description: "Read paginated traces in an existing security task.",
|
|
722
|
+
outputDescription: "Task Trace items and next ordinal cursor.",
|
|
723
|
+
fields: [
|
|
724
|
+
{ "name": "task-id", "type": "string", "desc": "Existing task ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
725
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
726
|
+
{ "name": "after-ordinal", "type": "number", "desc": "Exclusive ordinal cursor from the previous response.", "min": 0, "max": 9007199254740991, "integer": true }
|
|
727
|
+
]
|
|
728
|
+
},
|
|
729
|
+
{
|
|
730
|
+
id: "ai_monitor.security.task_findings",
|
|
731
|
+
description: "Read risk traces and findings in an existing task.",
|
|
732
|
+
outputDescription: "Risk Trace items with findings and next ordinal cursor.",
|
|
733
|
+
fields: [
|
|
734
|
+
{ "name": "task-id", "type": "string", "desc": "Existing task ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
735
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
736
|
+
{ "name": "after-ordinal", "type": "number", "desc": "Exclusive ordinal cursor from the previous response.", "min": 0, "max": 9007199254740991, "integer": true },
|
|
737
|
+
{ "name": "trace-id", "type": "string", "desc": "Exact Trace ID.", "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
738
|
+
]
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
id: "ai_monitor.security.rules",
|
|
742
|
+
description: "List security detection rules and effective bindings.",
|
|
743
|
+
outputDescription: "Rule items, total and pagination.",
|
|
744
|
+
fields: [
|
|
745
|
+
{ "name": "page", "type": "number", "desc": "One-based page number. Default: 1.", "default": 1, "min": 1, "max": 9007199254740991, "integer": true },
|
|
746
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
747
|
+
{ "name": "status", "type": "string", "desc": 'Exact status. Choices: all, enabled, disabled. Default: "all".', "default": "all", "choices": ["all", "enabled", "disabled"] },
|
|
748
|
+
{ "name": "query", "type": "string", "desc": "Rule search query.", "minLength": 1, "maxLength": 255 }
|
|
749
|
+
]
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
id: "ai_monitor.security.rule_get",
|
|
753
|
+
description: "Read a detection rule and its effective binding.",
|
|
754
|
+
outputDescription: "Rule definition and selected scope binding.",
|
|
755
|
+
fields: [
|
|
756
|
+
{ "name": "rule-key", "type": "string", "desc": "Exact security rule key.", "required": true, "minLength": 1, "maxLength": 255 }
|
|
757
|
+
]
|
|
758
|
+
},
|
|
759
|
+
{
|
|
760
|
+
id: "ai_monitor.diagnosis.list",
|
|
761
|
+
description: "Read paginated diagnosis task history in one data scope.",
|
|
762
|
+
outputDescription: "Task summaries and best-effort pagination; no new diagnosis is started.",
|
|
763
|
+
fields: [
|
|
764
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
765
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
766
|
+
{ "name": "entity-type", "type": "string", "desc": "Entity type. Choices: trace, conversation, tool, prompt, global.", "choices": ["trace", "conversation", "tool", "prompt", "global"] },
|
|
767
|
+
{ "name": "entity-key", "type": "string", "desc": "Entity key; pair with entity-type for history, required for non-global reports.", "minLength": 1, "maxLength": 512 }
|
|
768
|
+
]
|
|
769
|
+
},
|
|
770
|
+
{
|
|
771
|
+
id: "ai_monitor.diagnosis.queue",
|
|
772
|
+
description: "Read queued and running diagnosis tasks.",
|
|
773
|
+
outputDescription: "Task summaries, queue positions, and pagination.",
|
|
774
|
+
fields: [
|
|
775
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
776
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true }
|
|
777
|
+
]
|
|
778
|
+
},
|
|
779
|
+
{
|
|
780
|
+
id: "ai_monitor.diagnosis.get",
|
|
781
|
+
description: "Read one diagnosis task state without starting or retrying it.",
|
|
782
|
+
outputDescription: "Public task state, current step, queue position and errors.",
|
|
783
|
+
fields: [
|
|
784
|
+
{ "name": "task-id", "type": "string", "desc": "Existing task ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
{
|
|
788
|
+
id: "ai_monitor.diagnosis.report",
|
|
789
|
+
description: "Read the latest existing diagnosis report for an entity.",
|
|
790
|
+
outputDescription: "Latest report or null when no report exists; never starts a model request.",
|
|
791
|
+
fields: [
|
|
792
|
+
{ "name": "entity-type", "type": "string", "desc": 'Entity type. Choices: trace, conversation, tool, prompt, global. Default: "global".', "default": "global", "choices": ["trace", "conversation", "tool", "prompt", "global"] },
|
|
793
|
+
{ "name": "entity-key", "type": "string", "desc": "Entity key; pair with entity-type for history, required for non-global reports.", "minLength": 1, "maxLength": 512 }
|
|
794
|
+
]
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
id: "ai_monitor.investigation.modes",
|
|
798
|
+
description: "List supported investigation modes and sample requirements.",
|
|
799
|
+
outputDescription: "Analysis mode definitions for the selected entity type.",
|
|
800
|
+
fields: [
|
|
801
|
+
{ "name": "entity-type", "type": "string", "desc": 'Entity type. Choices: trace, agent, model, tool, conversation, skill, cost_analysis. Default: "trace".', "default": "trace", "choices": ["trace", "agent", "model", "tool", "conversation", "skill", "cost_analysis"] }
|
|
802
|
+
]
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
id: "ai_monitor.investigation.list",
|
|
806
|
+
description: "List accessible investigation cases in one data scope.",
|
|
807
|
+
outputDescription: "Case summaries and best-effort pagination, respecting owner and scope visibility.",
|
|
808
|
+
fields: [
|
|
809
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
810
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
811
|
+
{ "name": "entity-type", "type": "string", "desc": "Entity type. Choices: trace, agent, model, tool, conversation, skill, cost_analysis.", "choices": ["trace", "agent", "model", "tool", "conversation", "skill", "cost_analysis"] },
|
|
812
|
+
{ "name": "status", "type": "string", "desc": "Exact status. Choices: pending, running, completed, failed, cancelled.", "choices": ["pending", "running", "completed", "failed", "cancelled"] },
|
|
813
|
+
{ "name": "analysis-mode", "type": "string", "desc": "Investigation analysis mode ID.", "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
814
|
+
{ "name": "search", "type": "string", "desc": "Search text.", "minLength": 1, "maxLength": 500 },
|
|
815
|
+
{ "name": "agent", "type": "string", "desc": "Exact Agent name.", "minLength": 1, "maxLength": 255 }
|
|
816
|
+
]
|
|
817
|
+
},
|
|
818
|
+
{
|
|
819
|
+
id: "ai_monitor.investigation.get",
|
|
820
|
+
description: "Read one accessible investigation case.",
|
|
821
|
+
outputDescription: "Case details, selection, and optionally its existing runs.",
|
|
822
|
+
fields: [
|
|
823
|
+
{ "name": "case-id", "type": "string", "desc": "Existing investigation case ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
824
|
+
{ "name": "include-runs", "type": "boolean", "desc": "Include existing run summaries; no new run is started. Default: false.", "default": false }
|
|
825
|
+
]
|
|
826
|
+
},
|
|
827
|
+
{
|
|
828
|
+
id: "ai_monitor.investigation.runs",
|
|
829
|
+
description: "List existing runs for an accessible investigation case.",
|
|
830
|
+
outputDescription: "Run summaries and pagination.",
|
|
831
|
+
fields: [
|
|
832
|
+
{ "name": "limit", "type": "number", "desc": "Maximum items per page. Default: 20.", "default": 20, "min": 1, "max": 100, "integer": true },
|
|
833
|
+
{ "name": "offset", "type": "number", "desc": "Zero-based item offset. Default: 0.", "default": 0, "min": 0, "max": 9007199254740991, "integer": true },
|
|
834
|
+
{ "name": "case-id", "type": "string", "desc": "Existing investigation case ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
835
|
+
]
|
|
836
|
+
},
|
|
837
|
+
{
|
|
838
|
+
id: "ai_monitor.investigation.run_get",
|
|
839
|
+
description: "Read a specific investigation run and its existing result.",
|
|
840
|
+
outputDescription: "Run status, progress, result, completeness and errors; no run is created.",
|
|
841
|
+
fields: [
|
|
842
|
+
{ "name": "case-id", "type": "string", "desc": "Existing investigation case ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" },
|
|
843
|
+
{ "name": "run-id", "type": "string", "desc": "Existing run ID.", "required": true, "minLength": 1, "maxLength": 512, "pattern": "^\\S+$" }
|
|
844
|
+
]
|
|
845
|
+
},
|
|
846
|
+
{
|
|
847
|
+
id: "ai_monitor.trace.export",
|
|
848
|
+
description: "Export a bounded batch of traces with spans and a result manifest.",
|
|
849
|
+
outputDescription: "A base64 ZIP archive with SHA-256, byte length and a per-trace manifest. Partial failures remain explicit.",
|
|
850
|
+
fields: [
|
|
851
|
+
{ "name": "trace-ids", "type": "json", "desc": "JSON array of 1 to 100 exact Trace IDs.", "required": true, "array": true, "minItems": 1, "maxItems": 100, "stringItems": true }
|
|
852
|
+
]
|
|
853
|
+
},
|
|
854
|
+
{
|
|
855
|
+
id: "ai_monitor.conversation.export",
|
|
856
|
+
description: "Export conversations and all their trace spans within export limits.",
|
|
857
|
+
outputDescription: "A base64 ZIP archive with SHA-256, byte length and per-conversation/trace completeness. At most 200 traces per batch.",
|
|
858
|
+
fields: [
|
|
859
|
+
{ "name": "conversation-ids", "type": "json", "desc": "JSON array of 1 to 20 exact Conversation IDs.", "required": true, "array": true, "minItems": 1, "maxItems": 20, "stringItems": true }
|
|
860
|
+
]
|
|
861
|
+
}
|
|
862
|
+
];
|
|
863
|
+
|
|
864
|
+
// src/commands/ai-monitor/archive.ts
|
|
865
|
+
import { createHash } from "crypto";
|
|
866
|
+
import { lstat, open, unlink } from "fs/promises";
|
|
867
|
+
import { resolve } from "path";
|
|
868
|
+
async function ensureNewArchivePath(file) {
|
|
869
|
+
try {
|
|
870
|
+
await lstat(resolve(file));
|
|
871
|
+
} catch (error) {
|
|
872
|
+
if (error.code === "ENOENT") return;
|
|
873
|
+
throw new CliValidationError("Cannot inspect --output destination.", { code: "EXPORT_OUTPUT_UNAVAILABLE" });
|
|
874
|
+
}
|
|
875
|
+
throw new CliValidationError("--output already exists; choose a new file.", { code: "EXPORT_OUTPUT_EXISTS" });
|
|
876
|
+
}
|
|
877
|
+
async function saveArchive(result, file) {
|
|
878
|
+
const payload = result;
|
|
879
|
+
const archive = payload?.archive;
|
|
880
|
+
const invalid2 = () => new CliApiError("The export archive failed integrity validation.", { code: "INVALID_EXPORT_ARCHIVE" });
|
|
881
|
+
if (!archive || archive.encoding !== "base64" || archive.media_type !== "application/zip" || typeof archive.content_base64 !== "string" || !/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(archive.content_base64) || !Number.isSafeInteger(archive.byte_length) || archive.byte_length < 0 || typeof archive.sha256 !== "string" || !/^[a-f0-9]{64}$/i.test(archive.sha256)) throw invalid2();
|
|
882
|
+
const bytes = Buffer.from(archive.content_base64, "base64");
|
|
883
|
+
if (bytes.toString("base64") !== archive.content_base64 || bytes.length !== archive.byte_length || createHash("sha256").update(bytes).digest("hex") !== archive.sha256.toLowerCase()) throw invalid2();
|
|
884
|
+
const output = resolve(file);
|
|
885
|
+
let handle;
|
|
886
|
+
try {
|
|
887
|
+
handle = await open(output, "wx", 384);
|
|
888
|
+
} catch (error) {
|
|
889
|
+
throw new CliValidationError(
|
|
890
|
+
error.code === "EEXIST" ? "--output already exists; choose a new file." : "Cannot create --output file.",
|
|
891
|
+
{ code: error.code === "EEXIST" ? "EXPORT_OUTPUT_EXISTS" : "EXPORT_OUTPUT_UNAVAILABLE" }
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
try {
|
|
895
|
+
await handle.writeFile(bytes);
|
|
896
|
+
await handle.close();
|
|
897
|
+
} catch {
|
|
898
|
+
await handle.close().catch(() => void 0);
|
|
899
|
+
await unlink(output).catch(() => void 0);
|
|
900
|
+
throw new CliValidationError("Could not finish writing the export file.", { code: "EXPORT_WRITE_FAILED" });
|
|
901
|
+
}
|
|
902
|
+
const { content_base64: _contents, ...metadata } = archive;
|
|
903
|
+
const { archive: _archive, ...rest } = payload;
|
|
904
|
+
return { ...rest, archive: metadata, output_file: output };
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
// src/commands/ai-monitor/read.ts
|
|
908
|
+
var readCommands = READ_COMMAND_SPECS.map((spec) => {
|
|
909
|
+
const [, resource, action] = spec.id.split(".");
|
|
910
|
+
const isExport = action === "export";
|
|
911
|
+
return createAiMonitorCapabilityCommand({
|
|
912
|
+
resource: resource.replace(/_/g, "-"),
|
|
913
|
+
command: action.replace(/_/g, "-"),
|
|
914
|
+
capabilityId: spec.id,
|
|
915
|
+
description: spec.description,
|
|
916
|
+
helpText: spec.outputDescription + (isExport ? " --output is required. The ZIP is verified and written to a new private file; existing files are never overwritten. --validate and --dry-run never write files." : " Read-only: this command never starts, retries, or cancels analysis. Reuse the same platform/environment across related queries."),
|
|
917
|
+
flags: [...scopeFlags, ...spec.fields, ...isExport ? [{ name: "output", type: "string", required: true, minLength: 1, desc: "New local ZIP path; existing files are never overwritten." }] : []],
|
|
918
|
+
risk: "read",
|
|
919
|
+
buildInput: (ctx) => buildReadInput(ctx, spec),
|
|
920
|
+
prepareInput: async (ctx, input) => {
|
|
921
|
+
if (isExport) await ensureNewArchivePath(ctx.str("output"));
|
|
922
|
+
return prepareAiMonitorScope(ctx, input);
|
|
923
|
+
},
|
|
924
|
+
...isExport ? { postProcess: (result, _input, ctx) => saveArchive(result, ctx.str("output")) } : {}
|
|
925
|
+
});
|
|
926
|
+
});
|
|
927
|
+
|
|
928
|
+
// src/commands/ai-monitor/trace/get.ts
|
|
929
|
+
function buildTraceGetInput(ctx) {
|
|
930
|
+
return {
|
|
931
|
+
trace_id: ctx.str("trace-id"),
|
|
932
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
933
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__")
|
|
934
|
+
};
|
|
935
|
+
}
|
|
936
|
+
var traceGet = createAiMonitorCapabilityCommand({
|
|
937
|
+
resource: "trace",
|
|
938
|
+
command: "get",
|
|
939
|
+
capabilityId: "ai_monitor.trace.get",
|
|
940
|
+
description: "Get one trace snapshot and its spans from your company.",
|
|
941
|
+
flags: [
|
|
942
|
+
{ name: "trace-id", type: "string", required: true, desc: "Trace identifier.", minLength: 1, maxLength: 512, pattern: "^\\S+$" },
|
|
943
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
944
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
945
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
946
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 }
|
|
947
|
+
],
|
|
948
|
+
risk: "read",
|
|
949
|
+
buildInput: buildTraceGetInput,
|
|
950
|
+
prepareInput: prepareAiMonitorScope
|
|
951
|
+
});
|
|
952
|
+
|
|
953
|
+
// src/commands/ai-monitor/quality-flags.ts
|
|
954
|
+
var QUALITY_FLAGS = [
|
|
955
|
+
"l0_trace_error",
|
|
956
|
+
"l0_step_error",
|
|
957
|
+
"l0_client_aborted",
|
|
958
|
+
"l0_model_downgraded",
|
|
959
|
+
"l0_context_pruned",
|
|
960
|
+
"l0_output_truncated",
|
|
961
|
+
"l0_empty_output",
|
|
962
|
+
"l0_no_end_turn",
|
|
963
|
+
"l1_slow",
|
|
964
|
+
"l1_expensive",
|
|
965
|
+
"l1_heavy",
|
|
966
|
+
"l2_infra_llm_error",
|
|
967
|
+
"l2_infra_instant_death",
|
|
968
|
+
"l2_infra_auth_or_license",
|
|
969
|
+
"l2_infra_upstream_down",
|
|
970
|
+
"l2_tool_error",
|
|
971
|
+
"l2_tool_param_fail",
|
|
972
|
+
"l2_tool_result_overflow",
|
|
973
|
+
"l2_tool_context_overflow",
|
|
974
|
+
"l2_tool_query_empty",
|
|
975
|
+
"l2_model_downgraded",
|
|
976
|
+
"l2_model_thinking_heavy",
|
|
977
|
+
"l2_model_output_truncated",
|
|
978
|
+
"l2_model_not_found",
|
|
979
|
+
"l2_prompt_runaway",
|
|
980
|
+
"l2_prompt_forced_stop",
|
|
981
|
+
"l2_prompt_verbose_output",
|
|
982
|
+
"l2_prompt_identity_leak",
|
|
983
|
+
"l2_arch_deep_nesting",
|
|
984
|
+
"l2_arch_tool_overload",
|
|
985
|
+
"l2_arch_mcp_unavailable",
|
|
986
|
+
"l2_arch_max_turns_hit"
|
|
987
|
+
];
|
|
988
|
+
|
|
989
|
+
// src/commands/ai-monitor/advanced-filters.ts
|
|
990
|
+
var advancedFilterFlags = [
|
|
991
|
+
{ name: "filter-groups", type: "json", sensitive: true, desc: "Strict page filter group tree as JSON; maximum 10 rules and depth 2." },
|
|
992
|
+
{ name: "status", type: "string", choices: ["STATUS_CODE_OK", "STATUS_CODE_ERROR", "STATUS_CODE_UNSET"], desc: "Exact Trace status: STATUS_CODE_OK, STATUS_CODE_ERROR, or STATUS_CODE_UNSET." },
|
|
993
|
+
{ name: "user-cancelled", type: "boolean", desc: "Filter explicit user cancellation (true or false), independently of Trace status." },
|
|
994
|
+
{ name: "quality-flags", type: "json", array: true, minItems: 1, maxItems: QUALITY_FLAGS.length, itemChoices: [...QUALITY_FLAGS], desc: 'JSON array of formal L0/L1/L2 flags; all flags must match. Startup failure: ["l2_infra_instant_death"].' }
|
|
995
|
+
];
|
|
996
|
+
function buildAdvancedFilterInput(ctx) {
|
|
997
|
+
const input = readFields(ctx, advancedFilterFlags);
|
|
998
|
+
if (input.filter_groups !== void 0) {
|
|
999
|
+
const root = input.filter_groups;
|
|
1000
|
+
if (!root || typeof root !== "object" || Array.isArray(root) || root.type !== "group") {
|
|
1001
|
+
throw new CliValidationError("--filter-groups must be a page filter group object.", { code: "INVALID_AI_MONITOR_FILTERS" });
|
|
1002
|
+
}
|
|
1003
|
+
}
|
|
1004
|
+
return input;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
// src/commands/ai-monitor/trace/list.ts
|
|
1008
|
+
function buildTraceListInput(ctx) {
|
|
1009
|
+
return {
|
|
1010
|
+
...buildAdvancedFilterInput(ctx),
|
|
1011
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
1012
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__"),
|
|
1013
|
+
last_days: ctx.num("last-days"),
|
|
1014
|
+
start_date: optionalString(ctx, "start-date"),
|
|
1015
|
+
end_date: optionalString(ctx, "end-date"),
|
|
1016
|
+
agent: optionalString(ctx, "agent"),
|
|
1017
|
+
channel: optionalString(ctx, "channel"),
|
|
1018
|
+
search: optionalString(ctx, "search"),
|
|
1019
|
+
limit: ctx.num("limit"),
|
|
1020
|
+
offset: ctx.num("offset"),
|
|
1021
|
+
sort_by: normalizedSortBy(ctx),
|
|
1022
|
+
sort_order: normalizedSortOrder(ctx)
|
|
1023
|
+
};
|
|
1024
|
+
}
|
|
1025
|
+
function flattenTraceListResult(result) {
|
|
1026
|
+
if (!result || typeof result !== "object" || Array.isArray(result)) return result;
|
|
1027
|
+
const envelope = result;
|
|
1028
|
+
const data = envelope.data;
|
|
1029
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return result;
|
|
1030
|
+
const { data: _data, ...metadata } = envelope;
|
|
1031
|
+
return { ...data, ...metadata };
|
|
1032
|
+
}
|
|
1033
|
+
var traceList = createAiMonitorCapabilityCommand({
|
|
1034
|
+
resource: "trace",
|
|
1035
|
+
command: "list",
|
|
1036
|
+
capabilityId: "ai_monitor.trace.list",
|
|
1037
|
+
description: "List traces in your company.",
|
|
1038
|
+
helpText: "Explicit --start-date and --end-date override --last-days. recorded-costs sorts recorded amounts within fee-unit groups; it does not sum across currencies.",
|
|
1039
|
+
flags: [
|
|
1040
|
+
...advancedFilterFlags,
|
|
1041
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1042
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1043
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
1044
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 },
|
|
1045
|
+
{ name: "last-days", type: "number", default: 7, desc: "Lookback in days when no explicit date range is provided. Default: 7.", min: 1, max: 30 },
|
|
1046
|
+
{ name: "start-date", type: "string", desc: "Inclusive start date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1047
|
+
{ name: "end-date", type: "string", desc: "Inclusive end date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1048
|
+
{ name: "agent", type: "string", desc: "Filter by exact agent name.", minLength: 1, maxLength: 255 },
|
|
1049
|
+
{ name: "channel", type: "string", desc: "Filter by exact agent channel.", minLength: 1, maxLength: 255 },
|
|
1050
|
+
{ name: "search", type: "string", desc: "Search trace IDs and trace metadata.", minLength: 1, maxLength: 500 },
|
|
1051
|
+
{ name: "limit", type: "number", default: 20, desc: "Page size. Default: 20, max: 100.", min: 1, max: 100 },
|
|
1052
|
+
{ name: "offset", type: "number", default: 0, desc: "Zero-based page offset. Default: 0.", min: 0 },
|
|
1053
|
+
{ name: "sort-by", type: "string", default: "start-time", desc: "Sort field: start-time, end-time, duration, total-tokens, span-count, error-span-count, or recorded-costs (within fee-unit groups)." },
|
|
1054
|
+
{ name: "sort-order", type: "string", default: "desc", desc: "Sort order: asc or desc. Default: desc." }
|
|
1055
|
+
],
|
|
1056
|
+
risk: "read",
|
|
1057
|
+
validate: validateDateRange,
|
|
1058
|
+
buildInput: buildTraceListInput,
|
|
1059
|
+
prepareInput: prepareAiMonitorScope,
|
|
1060
|
+
postProcess: flattenTraceListResult
|
|
1061
|
+
});
|
|
1062
|
+
|
|
1063
|
+
// src/commands/ai-monitor/trace/count.ts
|
|
1064
|
+
function buildTraceCountInput(ctx) {
|
|
1065
|
+
return {
|
|
1066
|
+
...buildAdvancedFilterInput(ctx),
|
|
1067
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
1068
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__"),
|
|
1069
|
+
last_days: ctx.num("last-days"),
|
|
1070
|
+
start_date: optionalString(ctx, "start-date"),
|
|
1071
|
+
end_date: optionalString(ctx, "end-date"),
|
|
1072
|
+
agent: optionalString(ctx, "agent"),
|
|
1073
|
+
channel: optionalString(ctx, "channel"),
|
|
1074
|
+
search: optionalString(ctx, "search")
|
|
1075
|
+
};
|
|
1076
|
+
}
|
|
1077
|
+
var traceCount = createAiMonitorCapabilityCommand({
|
|
1078
|
+
resource: "trace",
|
|
1079
|
+
command: "count",
|
|
1080
|
+
capabilityId: "ai_monitor.trace.count",
|
|
1081
|
+
description: "Count traces matching the supplied filters.",
|
|
1082
|
+
helpText: "Uses the same filters as trace list; pagination and sorting are not applicable.",
|
|
1083
|
+
flags: [
|
|
1084
|
+
...advancedFilterFlags,
|
|
1085
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1086
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1087
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
1088
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 },
|
|
1089
|
+
{ name: "last-days", type: "number", default: 7, desc: "Lookback in days when no explicit date range is provided. Default: 7.", min: 1, max: 30 },
|
|
1090
|
+
{ name: "start-date", type: "string", desc: "Inclusive start date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1091
|
+
{ name: "end-date", type: "string", desc: "Inclusive end date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1092
|
+
{ name: "agent", type: "string", desc: "Filter by exact agent name.", minLength: 1, maxLength: 255 },
|
|
1093
|
+
{ name: "channel", type: "string", desc: "Filter by exact agent channel.", minLength: 1, maxLength: 255 },
|
|
1094
|
+
{ name: "search", type: "string", desc: "Search trace IDs and trace metadata.", minLength: 1, maxLength: 500 }
|
|
1095
|
+
],
|
|
1096
|
+
risk: "read",
|
|
1097
|
+
validate: validateDateRange,
|
|
1098
|
+
buildInput: buildTraceCountInput,
|
|
1099
|
+
prepareInput: prepareAiMonitorScope
|
|
1100
|
+
});
|
|
1101
|
+
|
|
1102
|
+
// src/commands/ai-monitor/platform/list.ts
|
|
1103
|
+
var platformList = createAiMonitorCapabilityCommand({
|
|
1104
|
+
resource: "platform",
|
|
1105
|
+
command: "list",
|
|
1106
|
+
capabilityId: "ai_monitor.platform.list",
|
|
1107
|
+
description: "List Agent platforms and their runtime environments.",
|
|
1108
|
+
helpText: "Use platform_name/environment_name for readable commands, or platform_id/environment_id for stable automation.",
|
|
1109
|
+
flags: [],
|
|
1110
|
+
risk: "read",
|
|
1111
|
+
buildInput: () => ({})
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
// src/commands/ai-monitor/conversation/list.ts
|
|
1115
|
+
var SORT_FIELDS = {
|
|
1116
|
+
"trace-count": "trace_count",
|
|
1117
|
+
"total-duration": "total_duration",
|
|
1118
|
+
"avg-duration": "avg_duration",
|
|
1119
|
+
"max-duration": "max_duration",
|
|
1120
|
+
"min-duration": "min_duration",
|
|
1121
|
+
"total-token-count": "total_token_count",
|
|
1122
|
+
"prompt-token-count": "total_token_count_prompt",
|
|
1123
|
+
"completion-token-count": "total_token_count_completion",
|
|
1124
|
+
"total-error-span-count": "total_error_span_count",
|
|
1125
|
+
"total-span-count": "total_span_count",
|
|
1126
|
+
"error-trace-count": "error_trace_count",
|
|
1127
|
+
"start-time": "start_time",
|
|
1128
|
+
"end-time": "end_time",
|
|
1129
|
+
"recorded-costs": "recorded_costs"
|
|
1130
|
+
};
|
|
1131
|
+
function normalizedSortBy2(ctx) {
|
|
1132
|
+
const value = ctx.str("sort-by");
|
|
1133
|
+
const normalized = SORT_FIELDS[value];
|
|
1134
|
+
if (!normalized) {
|
|
1135
|
+
throw new CliValidationError("--sort-by has an unsupported value.", {
|
|
1136
|
+
code: "INVALID_CONVERSATION_SORT_FIELD",
|
|
1137
|
+
hint: `Use one of: ${Object.keys(SORT_FIELDS).join(", ")}.`
|
|
1138
|
+
});
|
|
1139
|
+
}
|
|
1140
|
+
return normalized;
|
|
1141
|
+
}
|
|
1142
|
+
function buildConversationListInput(ctx) {
|
|
1143
|
+
return {
|
|
1144
|
+
...buildAdvancedFilterInput(ctx),
|
|
1145
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
1146
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__"),
|
|
1147
|
+
last_days: ctx.num("last-days"),
|
|
1148
|
+
start_date: optionalString(ctx, "start-date"),
|
|
1149
|
+
end_date: optionalString(ctx, "end-date"),
|
|
1150
|
+
agent: optionalString(ctx, "agent"),
|
|
1151
|
+
channel: optionalString(ctx, "channel"),
|
|
1152
|
+
search: optionalString(ctx, "search"),
|
|
1153
|
+
limit: ctx.num("limit"),
|
|
1154
|
+
offset: ctx.num("offset"),
|
|
1155
|
+
sort_by: normalizedSortBy2(ctx),
|
|
1156
|
+
sort_order: normalizedSortOrder(ctx)
|
|
1157
|
+
};
|
|
1158
|
+
}
|
|
1159
|
+
function flattenConversationListResult(result) {
|
|
1160
|
+
if (!result || typeof result !== "object" || Array.isArray(result)) return result;
|
|
1161
|
+
const data = result.data;
|
|
1162
|
+
if (!data || typeof data !== "object" || Array.isArray(data)) return result;
|
|
1163
|
+
const { data: _data, ...metadata } = result;
|
|
1164
|
+
return { ...data, ...metadata };
|
|
1165
|
+
}
|
|
1166
|
+
var conversationList = createAiMonitorCapabilityCommand({
|
|
1167
|
+
resource: "conversation",
|
|
1168
|
+
command: "list",
|
|
1169
|
+
capabilityId: "ai_monitor.conversation.list",
|
|
1170
|
+
description: "List conversations in your company.",
|
|
1171
|
+
helpText: "Explicit --start-date and --end-date override --last-days. recorded-costs sorts recorded amounts within fee-unit groups; it does not sum across currencies.",
|
|
1172
|
+
flags: [
|
|
1173
|
+
...advancedFilterFlags,
|
|
1174
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1175
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1176
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
1177
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 },
|
|
1178
|
+
{ name: "last-days", type: "number", default: 7, desc: "Lookback in days when no explicit date range is provided. Default: 7.", min: 1, max: 30 },
|
|
1179
|
+
{ name: "start-date", type: "string", desc: "Inclusive start date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1180
|
+
{ name: "end-date", type: "string", desc: "Inclusive end date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1181
|
+
{ name: "agent", type: "string", desc: "Filter by exact agent name.", minLength: 1, maxLength: 255 },
|
|
1182
|
+
{ name: "channel", type: "string", desc: "Filter by exact agent channel.", minLength: 1, maxLength: 255 },
|
|
1183
|
+
{ name: "search", type: "string", desc: "Search conversation IDs and conversation metadata.", minLength: 1, maxLength: 500 },
|
|
1184
|
+
{ name: "limit", type: "number", default: 20, desc: "Page size. Default: 20, max: 100.", min: 1, max: 100 },
|
|
1185
|
+
{ name: "offset", type: "number", default: 0, desc: "Zero-based page offset. Default: 0.", min: 0 },
|
|
1186
|
+
{ name: "sort-by", type: "string", default: "start-time", desc: "Sort field: trace-count, total-duration, avg-duration, max-duration, min-duration, total-token-count, prompt-token-count, completion-token-count, total-error-span-count, total-span-count, error-trace-count, start-time, end-time, or recorded-costs (within fee-unit groups)." },
|
|
1187
|
+
{ name: "sort-order", type: "string", default: "desc", desc: "Sort order: asc or desc. Default: desc." }
|
|
1188
|
+
],
|
|
1189
|
+
risk: "read",
|
|
1190
|
+
validate: validateDateRange,
|
|
1191
|
+
buildInput: buildConversationListInput,
|
|
1192
|
+
prepareInput: prepareAiMonitorScope,
|
|
1193
|
+
postProcess: flattenConversationListResult
|
|
1194
|
+
});
|
|
1195
|
+
|
|
1196
|
+
// src/commands/ai-monitor/conversation/count.ts
|
|
1197
|
+
function buildConversationCountInput(ctx) {
|
|
1198
|
+
return {
|
|
1199
|
+
...buildAdvancedFilterInput(ctx),
|
|
1200
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
1201
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__"),
|
|
1202
|
+
last_days: ctx.num("last-days"),
|
|
1203
|
+
start_date: optionalString(ctx, "start-date"),
|
|
1204
|
+
end_date: optionalString(ctx, "end-date"),
|
|
1205
|
+
agent: optionalString(ctx, "agent"),
|
|
1206
|
+
channel: optionalString(ctx, "channel"),
|
|
1207
|
+
search: optionalString(ctx, "search")
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
var conversationCount = createAiMonitorCapabilityCommand({
|
|
1211
|
+
resource: "conversation",
|
|
1212
|
+
command: "count",
|
|
1213
|
+
capabilityId: "ai_monitor.conversation.count",
|
|
1214
|
+
description: "Count conversations matching the supplied filters.",
|
|
1215
|
+
helpText: "Uses the same filters as conversation list without fetching conversation rows.",
|
|
1216
|
+
flags: [
|
|
1217
|
+
...advancedFilterFlags,
|
|
1218
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1219
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1220
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
1221
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 },
|
|
1222
|
+
{ name: "last-days", type: "number", default: 7, desc: "Lookback in days when no explicit date range is provided. Default: 7.", min: 1, max: 30 },
|
|
1223
|
+
{ name: "start-date", type: "string", desc: "Inclusive start date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1224
|
+
{ name: "end-date", type: "string", desc: "Inclusive end date in YYYY-MM-DD format.", pattern: "^\\d{4}-\\d{2}-\\d{2}$" },
|
|
1225
|
+
{ name: "agent", type: "string", desc: "Filter by exact agent name.", minLength: 1, maxLength: 255 },
|
|
1226
|
+
{ name: "channel", type: "string", desc: "Filter by exact agent channel.", minLength: 1, maxLength: 255 },
|
|
1227
|
+
{ name: "search", type: "string", desc: "Search conversation IDs and conversation metadata.", minLength: 1, maxLength: 500 }
|
|
1228
|
+
],
|
|
1229
|
+
risk: "read",
|
|
1230
|
+
validate: validateDateRange,
|
|
1231
|
+
buildInput: buildConversationCountInput,
|
|
1232
|
+
prepareInput: prepareAiMonitorScope
|
|
1233
|
+
});
|
|
1234
|
+
|
|
1235
|
+
// src/commands/ai-monitor/conversation/get.ts
|
|
1236
|
+
function buildConversationGetInput(ctx) {
|
|
1237
|
+
return {
|
|
1238
|
+
...ctx.has?.("include-spans") ? { include_spans: ctx.bool("include-spans") } : {},
|
|
1239
|
+
...ctx.has?.("span-limit") ? { span_limit: ctx.num("span-limit") } : {},
|
|
1240
|
+
...ctx.has?.("span-offset") ? { span_offset: ctx.num("span-offset") } : {},
|
|
1241
|
+
conversation_id: ctx.str("conversation-id").trim(),
|
|
1242
|
+
data_token: scopeValue(ctx, "platform", "data-token", "AE-AGENT"),
|
|
1243
|
+
report_source: scopeValue(ctx, "environment", "report-source", "__default__")
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1246
|
+
var conversationGet = createAiMonitorCapabilityCommand({
|
|
1247
|
+
resource: "conversation",
|
|
1248
|
+
command: "get",
|
|
1249
|
+
capabilityId: "ai_monitor.conversation.get",
|
|
1250
|
+
description: "Get all traces in one conversation.",
|
|
1251
|
+
helpText: "Pass data.items[].te_agent_conversation_id from conversation list output as --conversation-id. The detail response returns data.conversation_id. Keep the same platform/environment scope.",
|
|
1252
|
+
flags: [
|
|
1253
|
+
{ name: "include-spans", type: "boolean", desc: "Include bounded Trace snapshots with spans. Default: false." },
|
|
1254
|
+
{ name: "span-limit", type: "number", min: 1, max: 100, desc: "Maximum Trace snapshots in this span page. Default: 20; max: 100." },
|
|
1255
|
+
{ name: "span-offset", type: "number", min: 0, desc: "Zero-based Trace snapshot offset. Default: 0." },
|
|
1256
|
+
{ name: "conversation-id", type: "string", required: true, desc: "Conversation ID.", minLength: 1, maxLength: 512, pattern: "^\\S+$" },
|
|
1257
|
+
{ name: "platform", type: "string", desc: "Agent platform name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1258
|
+
{ name: "environment", type: "string", desc: "Runtime environment name or id. Discover values with `platform list`.", minLength: 1, maxLength: 255 },
|
|
1259
|
+
{ name: "data-token", type: "string", desc: "Advanced compatibility flag for the Agent platform key. Default: AE-AGENT.", minLength: 1, maxLength: 255 },
|
|
1260
|
+
{ name: "report-source", type: "string", desc: "Advanced compatibility flag for the runtime environment key. Default: __default__.", minLength: 1, maxLength: 255 }
|
|
1261
|
+
],
|
|
1262
|
+
risk: "read",
|
|
1263
|
+
buildInput: buildConversationGetInput,
|
|
1264
|
+
prepareInput: prepareAiMonitorScope
|
|
1265
|
+
});
|
|
1266
|
+
|
|
1267
|
+
// src/commands/ai-monitor/index.ts
|
|
1268
|
+
registerCapabilityGatewayRoute("ai-monitor", {
|
|
1269
|
+
gatewayDomain: "ai-monitor",
|
|
1270
|
+
capabilityPrefixes: ["ai_monitor."]
|
|
1271
|
+
});
|
|
1272
|
+
var commands = [platformList, traceList, traceCount, traceGet, conversationList, conversationCount, conversationGet, ...readCommands];
|
|
1273
|
+
var ai_monitor_default = commands;
|
|
1274
|
+
|
|
1275
|
+
export {
|
|
1276
|
+
readCommands,
|
|
1277
|
+
traceGet,
|
|
1278
|
+
traceList,
|
|
1279
|
+
traceCount,
|
|
1280
|
+
platformList,
|
|
1281
|
+
conversationList,
|
|
1282
|
+
conversationCount,
|
|
1283
|
+
conversationGet,
|
|
1284
|
+
ai_monitor_default
|
|
1285
|
+
};
|