@thinkingai/ae-cli 6.1.28 → 6.1.29
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 +24 -4
- package/README.zh.md +24 -4
- package/bin/ae-cli.js +5 -0
- package/bin/runtime-capabilities.json +5 -0
- package/cli-installation-guide.md +24 -3
- package/dist/{auth-NKD5Z5BQ.js → auth-OBQ5KVQM.js} +30 -12
- package/dist/{automation-K32V2NKP.js → automation-NAR5DDGL.js} +6 -6
- package/dist/{capability-4CGSL7PK.js → capability-LFSVNI5B.js} +54 -26
- package/dist/chunk-2UW3Y463.js +2289 -0
- package/dist/{chunk-QW3R6O7L.js → chunk-3SDHJOCR.js} +57 -15
- package/dist/chunk-6HAUVWOQ.js +132 -0
- package/dist/{chunk-KHS64JZQ.js → chunk-72NJKS7O.js} +4 -4
- package/dist/{chunk-UUD5RB36.js → chunk-7JAVT5TK.js} +3 -3
- package/dist/{chunk-GTPWDLTE.js → chunk-CVCTFLSO.js} +35 -14
- package/dist/{chunk-P7KL7IOH.js → chunk-H3K5UGYC.js} +2 -2
- package/dist/{chunk-P6VFCH3P.js → chunk-IN7KKL6K.js} +2 -2
- package/dist/{chunk-T44M3PLZ.js → chunk-JEUXDY3B.js} +1 -1
- package/dist/{chunk-LMCYSVVA.js → chunk-JNVVJ273.js} +51 -37
- package/dist/{chunk-JJJIP2XQ.js → chunk-N6XBLRB7.js} +2 -2
- package/dist/{chunk-QSAR3GHY.js → chunk-OAWPT7VP.js} +2 -2
- package/dist/{chunk-UF244C5C.js → chunk-PWXDWMCW.js} +7 -7
- package/dist/{chunk-2IYIYSUO.js → chunk-QVRIDN42.js} +2 -2
- package/dist/chunk-QZLRHGVH.js +222 -0
- package/dist/{chunk-GI5BMEZO.js → chunk-QZUVLFNR.js} +1 -1
- package/dist/{chunk-2UWS5CUP.js → chunk-RJHGDWSC.js} +3 -3
- package/dist/{chunk-UJ7UPRXK.js → chunk-VCZE3IWO.js} +10 -8
- package/dist/{chunk-X7DRLE62.js → chunk-YVG6QD3V.js} +1 -1
- package/dist/{chunk-ZW4VMY5H.js → chunk-Z3Q2AEIN.js} +152 -98
- package/dist/{community-report-client-S2K3A3Q6.js → community-report-client-TJVCLZ3K.js} +1 -1
- package/dist/compat-check-CII6B74E.js +32 -0
- package/dist/{config-ASSAAIOI.js → config-YZ6O2UQ2.js} +38 -6
- package/dist/{context-6RWLVOM5.js → context-F6FCGTF3.js} +4 -4
- package/dist/{data-integration-EXSUPUDZ.js → data-integration-6UAZO4GG.js} +207 -24
- package/dist/{evaluation-5YT4QLCL.js → evaluation-4LO2O4AF.js} +4 -4
- package/dist/index.js +297 -70
- package/dist/{local-data-upload-client-7HCPGIS3.js → local-data-upload-client-KCMG6J62.js} +1 -1
- package/dist/{memory-VCYLVPMI.js → memory-HHPX3NF2.js} +6 -6
- package/dist/{metadata-YGI5M6OF.js → metadata-TIFY24LW.js} +16 -8
- package/dist/{model-DPJHSD73.js → model-7UHGWYVR.js} +4 -4
- package/dist/{personal-semantic-preference-76TBKAPY.js → personal-semantic-preference-WKJEGPTM.js} +7 -6
- package/dist/{project-semantic-XOEBO2Q5.js → project-semantic-EIQVZNHW.js} +11 -10
- package/dist/{sync-7PP6KQ75.js → sync-RV3OPCTI.js} +8 -7
- package/dist/{te-agent-PJVAPKBD.js → te-agent-5ENVZJUH.js} +11 -7
- package/dist/{te-analysis-OX62G5VD.js → te-analysis-USIK6ZZG.js} +185 -33
- package/dist/{te-community-QN3WMPNT.js → te-community-WE2UU4XV.js} +720 -228
- package/dist/{te-dataops-UKD2XN3E.js → te-dataops-XNMO7MBF.js} +6 -5
- package/dist/{te-engage-X3DIXPRA.js → te-engage-6C3HCFQR.js} +13 -12
- package/dist/{te-experiment-MEIIK3DP.js → te-experiment-LVTRI3QK.js} +55 -21
- package/dist/{te-kb-73EWDFDF.js → te-kb-TUPGMVBY.js} +409 -85
- package/dist/{te-system-IE7NCKC3.js → te-system-YM657FKO.js} +6 -6
- package/dist/{te-team-MGQ5CNRW.js → te-team-G4VEJJNL.js} +7 -6
- package/dist/{things-4JIBCA55.js → things-22KQWC23.js} +7 -7
- package/dist/{update-AX66IFMJ.js → update-XX4ILU7X.js} +11 -7
- package/dist/{workspace-Q5NMEKEN.js → workspace-LYDAP647.js} +6 -6
- package/package.json +17 -7
- package/skills/ae-agent/references/resource-package.md +4 -0
- package/skills/ae-analysis/SKILL.md +14 -10
- package/skills/ae-analysis/references/agent_review_preflight.md +52 -11
- package/skills/ae-analysis/references/agent_review_priorities_comparisons.md +5 -3
- package/skills/ae-analysis/references/agent_review_submit_to_page.md +57 -25
- package/skills/ae-analysis/references/command_index.md +7 -3
- package/skills/ae-analysis/references/governance_recommendation_export.md +31 -17
- package/skills/ae-analysis/references/governance_recommendation_run_update.md +13 -0
- package/skills/ae-analysis/references/project_semantic_knowledge_wiki.md +9 -1
- package/skills/ae-analysis/references/scenario_append.md +6 -0
- package/skills/ae-analysis/references/scenario_begin.md +11 -0
- package/skills/ae-analysis/references/scenario_collect.md +10 -2
- package/skills/ae-analysis/references/scenario_evaluation.md +6 -18
- package/skills/ae-analysis/references/scenario_get.md +15 -0
- package/skills/ae-analysis/references/scenario_list.md +64 -0
- package/skills/ae-analysis/scripts/project-semantic-knowledge-wiki/company-kb.mjs +14 -1
- package/skills/ae-community/SKILL.md +77 -27
- package/skills/ae-community/references/community-analyzing-theme-comment.md +10 -8
- package/skills/ae-community/references/community-data-quality.md +68 -0
- package/skills/ae-community/references/community-query-evidence.md +85 -0
- package/skills/ae-community/references/community-scenario-capabilities.md +137 -0
- package/skills/ae-community/references/community-weekly-report.md +6 -3
- package/skills/ae-community/references/get_channel_info.md +7 -4
- package/skills/ae-community/references/get_comment_tag_analysis.md +3 -3
- package/skills/ae-community/references/get_comments_summary.md +4 -4
- package/skills/ae-community/references/get_corpus_tags.md +3 -3
- package/skills/ae-community/references/get_daily_summary.md +3 -3
- package/skills/ae-community/references/get_hot_topics.md +3 -3
- package/skills/ae-community/references/get_livestream_analysis.md +3 -3
- package/skills/ae-community/references/get_livestream_detail.md +4 -4
- package/skills/ae-community/references/get_livestream_list.md +3 -3
- package/skills/ae-community/references/get_livestream_overview.md +3 -3
- package/skills/ae-community/references/get_livestream_room_metrics.md +3 -3
- package/skills/ae-community/references/get_livestream_rooms.md +3 -3
- package/skills/ae-community/references/get_overview_metrics.md +3 -3
- package/skills/ae-community/references/get_post_detail.md +4 -4
- package/skills/ae-community/references/get_risk_content.md +5 -5
- package/skills/ae-community/references/get_sentiment_overview.md +4 -4
- package/skills/ae-community/references/get_tag_trends.md +3 -3
- package/skills/ae-community/references/get_topic_detail.md +3 -3
- package/skills/ae-community/references/list_sources.md +28 -0
- package/skills/ae-community/references/list_spaces.md +39 -0
- package/skills/ae-community/references/search_posts.md +21 -7
- package/skills/ae-data-integration/SKILL.md +6 -4
- package/skills/ae-data-integration/references/error-handling.md +1 -0
- package/skills/ae-data-integration/references/handoff.md +1 -1
- package/skills/ae-data-integration/references/sink-upload.md +11 -0
- package/skills/ae-data-integration/references/source-inspect.md +2 -1
- package/skills/ae-data-integration/references/transform.md +1 -1
- package/skills/ae-data-integration/references/ue-mapping.md +1 -1
- package/skills/ae-experiment/SKILL.md +7 -1
- package/skills/ae-experiment/references/manage_experiment.md +18 -1
- package/skills/ae-experiment/references/query_experiment_detail.md +7 -0
- package/skills/ae-experiment/references/save_experiment.md +76 -2
- package/skills/ae-experiment/references/save_submit_experiment.md +7 -0
- package/skills/ae-kb/SKILL.md +33 -6
- package/skills/ae-kb/references/publication.md +81 -0
- package/skills/ae-kb/references/query-workflow.md +14 -1
- package/skills/ae-metadata/SKILL.md +2 -2
- package/skills/ae-metadata/references/metadata_data_table_get.md +35 -0
- package/dist/chunk-ELCR235M.js +0 -1429
|
@@ -2,7 +2,7 @@ import { createRequire as __createRequire } from 'node:module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
LocalDataUploadError,
|
|
4
4
|
logger
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
6
6
|
|
|
7
7
|
// src/core/local-data-upload-client.ts
|
|
8
8
|
import { createHash } from "crypto";
|
|
@@ -4,18 +4,18 @@ import {
|
|
|
4
4
|
getMemoryCli,
|
|
5
5
|
patchMemoryCli,
|
|
6
6
|
postMemoryCli
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QZUVLFNR.js";
|
|
8
8
|
import {
|
|
9
9
|
currentAgentSpaceId
|
|
10
10
|
} from "./chunk-RK6GLDGI.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-N6XBLRB7.js";
|
|
12
|
+
import "./chunk-RJHGDWSC.js";
|
|
13
13
|
import "./chunk-Y74WTIKJ.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-H3K5UGYC.js";
|
|
15
|
+
import "./chunk-JNVVJ273.js";
|
|
16
16
|
import {
|
|
17
17
|
CliValidationError
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
19
19
|
|
|
20
20
|
// src/commands/memory/shared.ts
|
|
21
21
|
var MEMORY_SERVICE = "memory";
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
withAsyncArtifactLifecycle
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-PWXDWMCW.js";
|
|
5
5
|
import {
|
|
6
6
|
createCapabilityCommand
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-QW3R6O7L.js";
|
|
7
|
+
} from "./chunk-VCZE3IWO.js";
|
|
9
8
|
import {
|
|
10
9
|
registerCapabilityGatewayRoute
|
|
11
10
|
} from "./chunk-KPQY44JQ.js";
|
|
12
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-QZLRHGVH.js";
|
|
12
|
+
import "./chunk-3SDHJOCR.js";
|
|
13
13
|
import "./chunk-Y74WTIKJ.js";
|
|
14
|
-
import "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-2UW3Y463.js";
|
|
15
|
+
import "./chunk-H3K5UGYC.js";
|
|
16
|
+
import "./chunk-JNVVJ273.js";
|
|
17
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
17
18
|
|
|
18
19
|
// src/commands/metadata/shared.ts
|
|
19
20
|
function createCapabilityCommand2(config) {
|
|
@@ -150,7 +151,14 @@ var dataTableGet = createCapabilityCommand2({
|
|
|
150
151
|
resource: "data-table",
|
|
151
152
|
command: "get",
|
|
152
153
|
capabilityId: "metadata.data_table.get",
|
|
153
|
-
description: "Get one metadata data table detail. Requires metadata view permission.",
|
|
154
|
+
description: "Get one metadata data table detail, including saved SQL definitions and schedule configuration when supported by the server. Requires metadata view permission.",
|
|
155
|
+
helpText: [
|
|
156
|
+
"SQL tables on supported servers include create_qp/update_qp, create_zone_offset/update_zone_offset, strategy, update_cron, and update_conf_status.",
|
|
157
|
+
"QP objects preserve SQL parameter/view-parameter definitions and saved values; they do not report values resolved for a particular execution.",
|
|
158
|
+
"The zone offsets belong to SQL parameter parsing, not the cron schedule timezone. The schedule switch status is separate from task execution status.",
|
|
159
|
+
"Use --format json for complete detail. --jq selects from the payload before envelope wrapping, for example --jq .update_qp.taSqlVo.sqlVoParams.",
|
|
160
|
+
"Older servers may omit these fields; null means unavailable configuration, not an empty parameter list."
|
|
161
|
+
].join("\n"),
|
|
154
162
|
flags: [
|
|
155
163
|
{ name: "project-id", type: "number", required: true, desc: "Numeric project ID.", alias: "p" },
|
|
156
164
|
{ name: "data-table-id", type: "number", required: true, desc: "Data table ID." },
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
getClaudeConfigDir,
|
|
16
16
|
getSandboxModels,
|
|
17
17
|
postSandboxModelSelection
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-RJHGDWSC.js";
|
|
19
19
|
import "./chunk-Y74WTIKJ.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
20
|
+
import "./chunk-H3K5UGYC.js";
|
|
21
|
+
import "./chunk-JNVVJ273.js";
|
|
22
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
23
23
|
|
|
24
24
|
// src/commands/model/index.ts
|
|
25
25
|
import { existsSync, readFileSync } from "fs";
|
package/dist/{personal-semantic-preference-76TBKAPY.js → personal-semantic-preference-WKJEGPTM.js}
RENAMED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { createRequire as __createRequire } from 'node:module'; const require = __createRequire(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
createCapabilityCommand
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-QW3R6O7L.js";
|
|
4
|
+
} from "./chunk-VCZE3IWO.js";
|
|
6
5
|
import {
|
|
7
6
|
registerCapabilityGatewayRoute
|
|
8
7
|
} from "./chunk-KPQY44JQ.js";
|
|
9
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-QZLRHGVH.js";
|
|
9
|
+
import "./chunk-3SDHJOCR.js";
|
|
10
10
|
import "./chunk-Y74WTIKJ.js";
|
|
11
|
-
import "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-2UW3Y463.js";
|
|
12
|
+
import "./chunk-H3K5UGYC.js";
|
|
13
|
+
import "./chunk-JNVVJ273.js";
|
|
14
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
14
15
|
|
|
15
16
|
// src/commands/personal-semantic-preference/shared.ts
|
|
16
17
|
function createPersonalSemanticPreferenceCommand(config) {
|
|
@@ -3,22 +3,23 @@ import {
|
|
|
3
3
|
assertOutputPathAvailable,
|
|
4
4
|
downloadAnalysisArtifact,
|
|
5
5
|
withAsyncArtifactLifecycle
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PWXDWMCW.js";
|
|
7
|
+
import {
|
|
8
|
+
registerCapabilityGatewayRoute,
|
|
9
|
+
resolveGatewayDomain
|
|
10
|
+
} from "./chunk-KPQY44JQ.js";
|
|
11
|
+
import "./chunk-QZLRHGVH.js";
|
|
7
12
|
import {
|
|
8
13
|
CapabilityGatewayError,
|
|
9
14
|
dryRunCapability,
|
|
10
15
|
executeCapabilityWithEnvelope,
|
|
11
16
|
validateCapability
|
|
12
|
-
} from "./chunk-
|
|
13
|
-
import {
|
|
14
|
-
registerCapabilityGatewayRoute,
|
|
15
|
-
resolveGatewayDomain
|
|
16
|
-
} from "./chunk-KPQY44JQ.js";
|
|
17
|
-
import "./chunk-ELCR235M.js";
|
|
17
|
+
} from "./chunk-3SDHJOCR.js";
|
|
18
18
|
import "./chunk-Y74WTIKJ.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-2UW3Y463.js";
|
|
20
|
+
import "./chunk-H3K5UGYC.js";
|
|
21
|
+
import "./chunk-JNVVJ273.js";
|
|
22
|
+
import "./chunk-Z3Q2AEIN.js";
|
|
22
23
|
|
|
23
24
|
// src/commands/project-semantic/asset-package/materializer.ts
|
|
24
25
|
import { createHash, randomBytes } from "crypto";
|
|
@@ -24,8 +24,8 @@ import {
|
|
|
24
24
|
} from "./chunk-RK6GLDGI.js";
|
|
25
25
|
import {
|
|
26
26
|
require_lib
|
|
27
|
-
} from "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
} from "./chunk-QVRIDN42.js";
|
|
28
|
+
import "./chunk-JEUXDY3B.js";
|
|
29
29
|
import {
|
|
30
30
|
TeAgentApiError,
|
|
31
31
|
TeAgentCredentialsError,
|
|
@@ -33,16 +33,17 @@ import {
|
|
|
33
33
|
postSandboxSyncPull,
|
|
34
34
|
postToMainApp,
|
|
35
35
|
uploadToMainApp
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-RJHGDWSC.js";
|
|
37
37
|
import {
|
|
38
38
|
printError
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-QZLRHGVH.js";
|
|
40
40
|
import "./chunk-Y74WTIKJ.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
41
|
+
import "./chunk-2UW3Y463.js";
|
|
42
|
+
import "./chunk-H3K5UGYC.js";
|
|
43
|
+
import "./chunk-JNVVJ273.js";
|
|
43
44
|
import {
|
|
44
45
|
__toESM
|
|
45
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
46
47
|
|
|
47
48
|
// src/commands/sync/index.ts
|
|
48
49
|
var import_jszip = __toESM(require_lib(), 1);
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
workspaceResourcePath,
|
|
12
12
|
workspaceTargetFlags,
|
|
13
13
|
workspaceTargetPath
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7JAVT5TK.js";
|
|
15
15
|
import {
|
|
16
16
|
currentAgentSpaceId
|
|
17
17
|
} from "./chunk-RK6GLDGI.js";
|
|
@@ -27,23 +27,23 @@ import {
|
|
|
27
27
|
requestResourcePackageRaw,
|
|
28
28
|
resourcePackagePreflightChange,
|
|
29
29
|
uploadAgentApi
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-N6XBLRB7.js";
|
|
31
31
|
import {
|
|
32
32
|
TeAgentApiError,
|
|
33
33
|
resolveTeClaudeBaseUrl
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-RJHGDWSC.js";
|
|
35
35
|
import {
|
|
36
36
|
buildCapabilityGatewayUrl,
|
|
37
37
|
callCapabilityApi
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-3SDHJOCR.js";
|
|
39
39
|
import "./chunk-Y74WTIKJ.js";
|
|
40
|
-
import "./chunk-
|
|
40
|
+
import "./chunk-H3K5UGYC.js";
|
|
41
41
|
import {
|
|
42
42
|
getConfigDir
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-JNVVJ273.js";
|
|
44
44
|
import {
|
|
45
45
|
CliValidationError
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
47
47
|
|
|
48
48
|
// src/commands/te-agent/notifications.ts
|
|
49
49
|
import { openSync, closeSync, fstatSync, readSync } from "fs";
|
|
@@ -63,6 +63,7 @@ function requestApprovalCli(ctx, method, path2, body, options = {}) {
|
|
|
63
63
|
body,
|
|
64
64
|
{
|
|
65
65
|
apiBaseUrl: resolveApprovalApiBaseUrl(ctx.host()),
|
|
66
|
+
includeClientContextInBody: false,
|
|
66
67
|
...options,
|
|
67
68
|
retryOnInvalidTokenForbidden: false
|
|
68
69
|
}
|
|
@@ -4459,11 +4460,13 @@ function exportBody(ctx) {
|
|
|
4459
4460
|
payload: {
|
|
4460
4461
|
roots: references(ctx, "roots"),
|
|
4461
4462
|
excluded: references(ctx, "excluded"),
|
|
4463
|
+
...ctx.str("view") ? { view: ctx.str("view") } : {},
|
|
4462
4464
|
...ctx.str("fileNameBase") ? { fileNameBase: ctx.str("fileNameBase") } : {}
|
|
4463
4465
|
}
|
|
4464
4466
|
};
|
|
4465
4467
|
}
|
|
4466
4468
|
function validateExport(ctx) {
|
|
4469
|
+
if (ctx.str("view") && !["working", "published"].includes(ctx.str("view"))) throw new CliValidationError("--view must be working or published");
|
|
4467
4470
|
exportBody(ctx);
|
|
4468
4471
|
if (ctx.str("requestKey")) id(ctx, "requestKey", "request-key");
|
|
4469
4472
|
const base = ctx.str("fileNameBase");
|
|
@@ -4483,6 +4486,7 @@ var exportResourcePackage = {
|
|
|
4483
4486
|
{ name: "scope", type: "string", required: true, desc: "Export scope: personal or company" },
|
|
4484
4487
|
{ name: "roots", type: "string", required: true, desc: "JSON, @file, or stdin (-) array of root resources" },
|
|
4485
4488
|
{ name: "excluded", type: "string", desc: "JSON or @file array of dependencies to exclude" },
|
|
4489
|
+
{ name: "view", type: "string", desc: "Knowledge base content: working (default) or published" },
|
|
4486
4490
|
{ name: "file-name-base", type: "string", desc: "Optional output ZIP base name" },
|
|
4487
4491
|
{ name: "request-key", type: "string", desc: "Optional idempotency key; reuse only for the same export" },
|
|
4488
4492
|
{ name: "output", type: "string", desc: "Local ZIP path; defaults to the artifact filename" },
|
|
@@ -7,12 +7,19 @@ import {
|
|
|
7
7
|
waitForAnalysisRun,
|
|
8
8
|
withAsyncArtifactLifecycle,
|
|
9
9
|
withInterruptSignal
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PWXDWMCW.js";
|
|
11
11
|
import {
|
|
12
12
|
createCapabilityCommand,
|
|
13
13
|
definitionIntentSnapshotFlag,
|
|
14
14
|
modelDefinitionIntentSnapshotFlag
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-VCZE3IWO.js";
|
|
16
|
+
import {
|
|
17
|
+
registerCapabilityGatewayRoute,
|
|
18
|
+
resolveGatewayDomain
|
|
19
|
+
} from "./chunk-KPQY44JQ.js";
|
|
20
|
+
import {
|
|
21
|
+
withOutputMetadata
|
|
22
|
+
} from "./chunk-QZLRHGVH.js";
|
|
16
23
|
import {
|
|
17
24
|
CapabilityGatewayError,
|
|
18
25
|
buildCapabilityGatewayUrl,
|
|
@@ -26,22 +33,16 @@ import {
|
|
|
26
33
|
uploadInputFile,
|
|
27
34
|
validateCapability,
|
|
28
35
|
validateCapabilityWithEnvelope
|
|
29
|
-
} from "./chunk-
|
|
30
|
-
import {
|
|
31
|
-
registerCapabilityGatewayRoute,
|
|
32
|
-
resolveGatewayDomain
|
|
33
|
-
} from "./chunk-KPQY44JQ.js";
|
|
34
|
-
import {
|
|
35
|
-
withOutputMetadata
|
|
36
|
-
} from "./chunk-ELCR235M.js";
|
|
36
|
+
} from "./chunk-3SDHJOCR.js";
|
|
37
37
|
import "./chunk-Y74WTIKJ.js";
|
|
38
|
+
import "./chunk-2UW3Y463.js";
|
|
38
39
|
import {
|
|
39
40
|
getCliToken
|
|
40
|
-
} from "./chunk-
|
|
41
|
-
import "./chunk-
|
|
41
|
+
} from "./chunk-H3K5UGYC.js";
|
|
42
|
+
import "./chunk-JNVVJ273.js";
|
|
42
43
|
import {
|
|
43
44
|
CliValidationError
|
|
44
|
-
} from "./chunk-
|
|
45
|
+
} from "./chunk-Z3Q2AEIN.js";
|
|
45
46
|
|
|
46
47
|
// src/commands/te-analysis/capability-shared.ts
|
|
47
48
|
var ANALYSIS_GATEWAY_CLI_SERVICES = /* @__PURE__ */ new Set(["project", "system"]);
|
|
@@ -2120,6 +2121,33 @@ var metadataCatalogList = createAnalysisMetaCapabilityCommand({
|
|
|
2120
2121
|
var commands10 = [metadataCatalogList, metadataCatalogExport];
|
|
2121
2122
|
var catalog_default = commands10;
|
|
2122
2123
|
|
|
2124
|
+
// src/commands/te-analysis/meta/governance-recommendation/run-update.ts
|
|
2125
|
+
var metadataGovernanceRecommendationRunUpdate = createAnalysisMetaCapabilityCommand({
|
|
2126
|
+
resource: "governance-recommendation",
|
|
2127
|
+
command: "run-update",
|
|
2128
|
+
capabilityId: "metadata.governance_recommendation.run_update",
|
|
2129
|
+
description: "Renew or finish your tracked recommendation workflow; it does not cancel Agent execution.",
|
|
2130
|
+
risk: "write",
|
|
2131
|
+
flags: [
|
|
2132
|
+
projectIdFlag,
|
|
2133
|
+
{ name: "run-id", type: "string", required: true, desc: "Exact run_id returned by the tracked export." },
|
|
2134
|
+
{ name: "status", type: "string", required: true, desc: "HEARTBEAT, SUCCEEDED, FAILED or CANCELLED. Finish only after the actual workflow has ended." },
|
|
2135
|
+
{ name: "reason", type: "string", required: false, desc: "Short non-sensitive result or failure reason; never include credentials or raw logs." }
|
|
2136
|
+
],
|
|
2137
|
+
buildInput: (ctx) => {
|
|
2138
|
+
const status = ctx.str("status");
|
|
2139
|
+
if (!["HEARTBEAT", "SUCCEEDED", "FAILED", "CANCELLED"].includes(status)) {
|
|
2140
|
+
throw new Error("--status must be HEARTBEAT, SUCCEEDED, FAILED or CANCELLED.");
|
|
2141
|
+
}
|
|
2142
|
+
return {
|
|
2143
|
+
...projectInput(ctx),
|
|
2144
|
+
run_id: ctx.str("run-id"),
|
|
2145
|
+
status,
|
|
2146
|
+
...ctx.str("reason") ? { reason: ctx.str("reason") } : {}
|
|
2147
|
+
};
|
|
2148
|
+
}
|
|
2149
|
+
});
|
|
2150
|
+
|
|
2123
2151
|
// src/commands/te-analysis/meta/governance-recommendation/export.ts
|
|
2124
2152
|
var windowDaysFlag = {
|
|
2125
2153
|
name: "window-days",
|
|
@@ -2154,7 +2182,9 @@ var GOVERNANCE_RECOMMENDATION_EXPORT_HELP = [
|
|
|
2154
2182
|
"- The Agent turns that package into a submit-to-page draft with batch ai_summary, presentation_snapshot, per-item ai_summary/reasons, copied evidence_snapshot, copied source links, and relations.",
|
|
2155
2183
|
"- work_units are deterministic evidence containers from Common. They are not final page groups; the Agent clusters selected assets into one or more business-domain topics.",
|
|
2156
2184
|
"- For report and SQL items, use packaged evidence_snapshot.analysis first. Call analysis-meta agent-review evidence only for explicit definition/analysis gaps or draft validation.",
|
|
2157
|
-
"-
|
|
2185
|
+
"- Ordinary recommendations need concise reasons, a core evidence-backed report measure/calculation, business-domain/subtopic grouping, and a focused page-material review. Full definition audits, per-item comparisons and exhaustive SQL explanations are not the default; use them only for explicit audit intent or affected risk items.",
|
|
2186
|
+
"- For real page-review submission, start with --limit 20, select currently uncertified assets by business value and evidence, and expand to --limit 50 then --limit 100 only when the remaining pending review assets or visible business domains are too few.",
|
|
2187
|
+
"- Do not query review history to select candidates. Previously recommended, pending, rejected, or deferred proposals do not exclude a currently uncertified asset from manual recommendation.",
|
|
2158
2188
|
"- Expansion increases business-domain coverage; it must not submit every pending asset found. Keep a daily review capacity target such as 20-50 pending assets, hard cap around 80, and select about 3-6 visible domains.",
|
|
2159
2189
|
"- When candidates exceed the cap, rank by impact, heat, user count, dependency breadth, and under-covered domains; keep only direct context needed for selected pending assets and report overflow for later batches.",
|
|
2160
2190
|
"- Draft only business domains with pending review assets. Completed/authenticated assets are necessary context under those visible domains, not standalone work and not a reason to display a zero-pending domain.",
|
|
@@ -2167,14 +2197,28 @@ var metadataGovernanceRecommendationExport = createAnalysisMetaCapabilityCommand
|
|
|
2167
2197
|
capabilityId: "metadata.governance_recommendation.export",
|
|
2168
2198
|
description: "Export the material package for CLI Agent asset-authentication and metric-recommendation review.",
|
|
2169
2199
|
helpText: GOVERNANCE_RECOMMENDATION_EXPORT_HELP,
|
|
2170
|
-
flags: [
|
|
2200
|
+
flags: [
|
|
2201
|
+
projectIdFlag,
|
|
2202
|
+
windowDaysFlag,
|
|
2203
|
+
limitFlag2,
|
|
2204
|
+
includeCompletedFlag,
|
|
2205
|
+
{ name: "track-run", type: "boolean", required: false, desc: "Track the complete recommendation workflow through page submission or explicit run-update. Default: false for compatibility." },
|
|
2206
|
+
{ name: "run-id", type: "string", required: false, desc: "Continue the same tracked workflow when expanding evidence. Requires --track-run true." }
|
|
2207
|
+
],
|
|
2171
2208
|
risk: "read",
|
|
2172
|
-
buildInput: (ctx) =>
|
|
2173
|
-
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2209
|
+
buildInput: (ctx) => {
|
|
2210
|
+
if (ctx.str("run-id") && optionalBoolean(ctx, "track-run") !== true) {
|
|
2211
|
+
throw new Error("--run-id requires --track-run true.");
|
|
2212
|
+
}
|
|
2213
|
+
return compactInput({
|
|
2214
|
+
...projectInput(ctx),
|
|
2215
|
+
window_days: optionalNumber(ctx, "window-days"),
|
|
2216
|
+
limit: optionalNumber(ctx, "limit"),
|
|
2217
|
+
include_completed: optionalBoolean(ctx, "include-completed"),
|
|
2218
|
+
track_run: optionalBoolean(ctx, "track-run"),
|
|
2219
|
+
run_id: ctx.str("run-id") || void 0
|
|
2220
|
+
});
|
|
2221
|
+
},
|
|
2178
2222
|
postProcess: (result, _input, ctx) => {
|
|
2179
2223
|
normalizeResourceUrlFields(result, resolvePublicWebHost(ctx.host()), ctx.host());
|
|
2180
2224
|
return result;
|
|
@@ -3003,6 +3047,7 @@ var metadataGovernanceRecommendationDecisions = createAnalysisMetaCapabilityComm
|
|
|
3003
3047
|
|
|
3004
3048
|
// src/commands/te-analysis/meta/governance-recommendation/index.ts
|
|
3005
3049
|
var commands11 = [
|
|
3050
|
+
metadataGovernanceRecommendationRunUpdate,
|
|
3006
3051
|
metadataGovernanceRecommendationExport,
|
|
3007
3052
|
metadataGovernanceRecommendationSubmit,
|
|
3008
3053
|
metadataGovernanceRecommendationAutoReview,
|
|
@@ -3089,23 +3134,26 @@ var SUBMIT_TO_PAGE_HELP = [
|
|
|
3089
3134
|
"- This command creates an asset certification review draft for humans. It never approves, certifies, retries, or creates metrics.",
|
|
3090
3135
|
"- Use --input-file for real drafts. The file is JSON; --project-id and --client-request-id come from CLI flags so replays keep one stable operation key.",
|
|
3091
3136
|
"- Build the file from review_material_package, preserving candidate assets, heat evidence, source_link/evidence_links, relations, report/AI-model definitions, target_revision, and hashes.",
|
|
3092
|
-
"- For dashboard items, preserve optional space_id/space_name from the
|
|
3137
|
+
"- For dashboard items, preserve optional space_id/space_name only from the authoritative packaged evidence_snapshot.definition.config, together with target_revision. Never synthesize or patch definition from space display facts. For older exports missing dashboard definition/revision, fetch analysis-meta agent-review evidence first. Not every dashboard has a space; do not invent or require one.",
|
|
3093
3138
|
"- For recurring recommendation jobs, build the draft from the latest sufficient export: start at top-20 hot dashboards, expand to top-50/top-100 only when filtering leaves too few pending review assets or visible business domains, and record the final scope in batch ai_summary.",
|
|
3139
|
+
"- Do not query review history to select candidates. Select currently uncertified assets by business value and evidence, regardless of earlier recommendations or review decisions. Submission creates human review material only.",
|
|
3094
3140
|
"- Expansion is for coverage, not unlimited workload. Target about 20-50 pending assets per daily batch, cap around 80, and balance roughly 3-6 visible domains with per-domain quotas before adding context.",
|
|
3095
3141
|
"- If more pending candidates exist, submit the ranked slice and record overflow counts/domains in batch ai_summary for later batches.",
|
|
3096
3142
|
"- presentation_snapshot should display only business-domain topics that contain pending review assets. Authenticated/completed assets may appear as context under those topics, but must not create standalone zero-pending topics.",
|
|
3097
3143
|
"- Do not author long page-visible AI summaries for hidden topics or pure authenticated context. Copy evidence, links, signals, and relations for context; spend Agent interpretation on visible domains and pending review assets.",
|
|
3098
3144
|
"- Scripts may assemble transport JSON and copy evidence, but page-visible ai_summary and analysis_explanation text must be Agent-written interpretation from verified evidence, not generated boilerplate.",
|
|
3099
|
-
"- Follow agent_review_preflight.md
|
|
3100
|
-
"-
|
|
3101
|
-
"- Each new topic must include semantic_basis with business_question, grouping_reason, and evidence_item_ids from that topic. These are Agent-authored
|
|
3145
|
+
"- Ordinary recommendations use concise item reasons and core report meaning. Follow agent_review_preflight.md for one focused independent review of every business topic/subtopic and identified risks, plus whole-packet programmatic evidence checks. Do not repeat a full definition audit or polish copy through routine correction rounds. Full audits require explicit audit intent; LOCAL_ONLY never submits.",
|
|
3146
|
+
"- Priorities are optional for ordinary recommendations. Load agent_review_priorities_comparisons.md only for a priority request, concrete comparison/conflict clues, or a full audit. Do not require comparisons or comparison_review for unexamined ordinary items; absence never proves no conflict. Supplied comparisons retain both-side evidence and classification; only POSSIBLE_CONFLICT merits a conflict badge.",
|
|
3147
|
+
"- Each new topic and second-level business subtopic must include semantic_basis with business_question, grouping_reason, and evidence_item_ids from that topic or group respectively. These are Agent-authored interpretations; legacy packets without these optional fields remain accepted.",
|
|
3148
|
+
"- Follow the Business Topics and Subtopics contract in agent_review_submit_to_page.md: business domain -> business subtopic -> dashboards -> reports -> metadata. Group dashboards answering the same subtopic question together; never create one group per source dashboard by iteration or just rename those groups. Single-dashboard groups need a definition-based reason, not a minimum-count workaround.",
|
|
3102
3149
|
"- presentation_snapshot.topics is one or more business-domain topics. Each topic must use groups[].items; do not use top-level topics[].items or raw Common work_units as the page grouping.",
|
|
3103
3150
|
"- relations should let the page render dashboard -> report -> metadata with contains/uses edges. Use an empty relations array only when the package truly has no known parent-child evidence.",
|
|
3104
3151
|
"- Each submitted item must keep source_link or evidence_links[].url so reviewers can jump to source evidence.",
|
|
3105
3152
|
"- item.ai_summary.summary is the per-item recommendation reason. It must cite concrete item evidence, not generic review boilerplate. batch ai_summary.summary is only the batch overview.",
|
|
3106
3153
|
"- When submitting manual_review_handoff leftovers, copy manual_review_handoff.auto_review_trace into source_metadata.auto_review_trace so page audit records include the assets already certified automatically.",
|
|
3107
|
-
"- For
|
|
3108
|
-
"-
|
|
3154
|
+
"- For ordinary reports, one concise, factual core measure or calculation with resolvable evidence_snapshot.analysis refs is sufficient. Preserve packaged analysis and target_revision; do not require exhaustive SQL projection explanations. A purpose-only summary is incomplete and is rejected locally before dispatch.",
|
|
3155
|
+
"- Write concise business Chinese describing purpose, recommendation basis, core meaning and known material risks; metadata dependencies need only their role and specific risks. Keep raw SQL and implementation details in evidence_snapshot. Complete field-by-field explanations remain available for explicitly requested full audits.",
|
|
3156
|
+
"- Run local structure/evidence checks once, then submit once and read detail once. Remote --validate or --dry-run remains available for uncertain inputs or new contracts, not a routine extra step. Authorization, source links, identity, and core report evidence checks remain enforced.",
|
|
3109
3157
|
"- The command output includes review_page_url when review_url is present. Return review_page_url to the user; do not prepend the Common/API host to review_url yourself.",
|
|
3110
3158
|
"",
|
|
3111
3159
|
"Input-file JSON shape:",
|
|
@@ -3125,8 +3173,9 @@ var SUBMIT_TO_PAGE_HELP = [
|
|
|
3125
3173
|
' "name": "<business-domain-name>",',
|
|
3126
3174
|
' "groups": [{',
|
|
3127
3175
|
' "id": "<second-level-group-id>",',
|
|
3128
|
-
' "name": "<
|
|
3129
|
-
' "
|
|
3176
|
+
' "name": "<business-subtopic-name>",',
|
|
3177
|
+
' "semantic_basis": { "business_question": "<specific business question>", "grouping_reason": "<shared meaning and boundary from sibling subtopics>", "evidence_item_ids": ["<supporting item id in this group>"] },',
|
|
3178
|
+
' "items": [{ "id": "<dashboard item id>" }, { "id": "<another related dashboard item id>" }, { "id": "<report item id>" }]',
|
|
3130
3179
|
" }]",
|
|
3131
3180
|
" }],",
|
|
3132
3181
|
' "relations": [{ "parent": "<dashboard item id>", "child": "<report item id>", "type": "contains" }, { "parent": "<report item id>", "child": "<metadata item id>", "type": "uses" }],',
|
|
@@ -3339,6 +3388,7 @@ function validatePresentation(presentation, itemIds) {
|
|
|
3339
3388
|
}
|
|
3340
3389
|
for (const groupValue of array2(topic.groups, "presentation_snapshot.topics[].groups")) {
|
|
3341
3390
|
const group = object(groupValue, "presentation_snapshot.topics[].groups[]");
|
|
3391
|
+
const groupItemIds = /* @__PURE__ */ new Set();
|
|
3342
3392
|
if (typeof group.id !== "string" || !group.id.trim() || typeof group.name !== "string" || !group.name.trim()) {
|
|
3343
3393
|
throw new Error("presentation_snapshot.topics[].groups[] requires nonempty string id and name.");
|
|
3344
3394
|
}
|
|
@@ -3352,6 +3402,19 @@ function validatePresentation(presentation, itemIds) {
|
|
|
3352
3402
|
}
|
|
3353
3403
|
displayed.add(item.id);
|
|
3354
3404
|
topicItemIds.add(item.id);
|
|
3405
|
+
groupItemIds.add(item.id);
|
|
3406
|
+
}
|
|
3407
|
+
if (group.semantic_basis !== void 0) {
|
|
3408
|
+
const basis = object(group.semantic_basis, "presentation_snapshot.topics[].groups[].semantic_basis");
|
|
3409
|
+
for (const field of ["business_question", "grouping_reason"]) {
|
|
3410
|
+
if (typeof basis[field] !== "string" || !basis[field].trim()) {
|
|
3411
|
+
throw new Error(`group.semantic_basis.${field} must explain the business meaning of this subtopic.`);
|
|
3412
|
+
}
|
|
3413
|
+
}
|
|
3414
|
+
const references = array2(basis.evidence_item_ids, "group.semantic_basis.evidence_item_ids");
|
|
3415
|
+
if (!references.length || references.some((id) => typeof id !== "string" || !groupItemIds.has(id))) {
|
|
3416
|
+
throw new Error("group.semantic_basis.evidence_item_ids must reference items displayed in the same group.");
|
|
3417
|
+
}
|
|
3355
3418
|
}
|
|
3356
3419
|
}
|
|
3357
3420
|
if (topic.semantic_basis !== void 0) {
|
|
@@ -11515,12 +11578,25 @@ function scenarioInput(ctx, append = false) {
|
|
|
11515
11578
|
if (!path.some((step) => analysisQueryCapabilities.has(step.capability_id))) throw new CliValidationError("query-path must reference at least one attempted analysis data query.");
|
|
11516
11579
|
if (JSON.stringify(path).length > 2e4) throw new CliValidationError("query-path must be at most 20000 characters.");
|
|
11517
11580
|
input.query_path = path;
|
|
11518
|
-
|
|
11581
|
+
const started = ctx.str("start-time");
|
|
11582
|
+
if (started) input.duration_ms = scenarioDuration(started);
|
|
11583
|
+
} else if (ctx.json("query-path") !== void 0 || ctx.str("answer-id") || ctx.str("user-message") || ctx.str("start-time")) {
|
|
11519
11584
|
throw new CliValidationError("user_feedback records user text and its target only; do not attach an answer or query path.");
|
|
11520
11585
|
}
|
|
11521
11586
|
return input;
|
|
11522
11587
|
}
|
|
11588
|
+
function scenarioTransportInput(ctx, append = false) {
|
|
11589
|
+
const input = scenarioInput(ctx, append);
|
|
11590
|
+
const field = append ? "text" : "answer";
|
|
11591
|
+
const original = input[field];
|
|
11592
|
+
const bytes = Buffer.from(original, "utf8");
|
|
11593
|
+
if (bytes.toString("utf8") !== original) {
|
|
11594
|
+
throw new CliValidationError(`${field} must contain valid Unicode text.`);
|
|
11595
|
+
}
|
|
11596
|
+
return { ...input, [field]: bytes.toString("base64"), content_encoding: "base64" };
|
|
11597
|
+
}
|
|
11523
11598
|
var commonFlags2 = [
|
|
11599
|
+
{ name: "start-time", type: "string", desc: "Exact start_time returned by scenario begin for this answer. CLI computes one question-to-answer duration; omit if not captured." },
|
|
11524
11600
|
{ name: "question-id", type: "string", desc: "Stable original scenario turn ID. Collect defaults to current turn; append must reuse the original ID." },
|
|
11525
11601
|
{ name: "answer-id", type: "string", desc: "Actual answer identifier; defaults to answer:<current-turn-id>. Revisions need a new ID." },
|
|
11526
11602
|
{ name: "query-path", type: "json", desc: "1..64 ordered references: [{capability_id,invocation_id?,client_request_id?,purpose?}]. Prefer only returned meta.invocation_id; fallback to returned gateway meta.client_request_id, never business request_id. One analysis data-query step required. Inputs/status/timing come from existing call telemetry. Never include query results." },
|
|
@@ -11568,7 +11644,7 @@ var scenarioCollect = withProjectCollectionPolicy(createAnalysisCapabilityComman
|
|
|
11568
11644
|
{ name: "question", type: "string", required: true, sensitive: true, desc: "Original user scenario question and confirmed clarifications; up to 8192 characters." },
|
|
11569
11645
|
{ name: "answer", type: "string", required: true, sensitive: true, desc: "Exact answer text to deliver, not a summary. Up to 16384 characters. Deliver the same text after collection." }
|
|
11570
11646
|
],
|
|
11571
|
-
buildInput: (ctx) =>
|
|
11647
|
+
buildInput: (ctx) => scenarioTransportInput(ctx)
|
|
11572
11648
|
}));
|
|
11573
11649
|
var scenarioAppend = withProjectCollectionPolicy(createAnalysisCapabilityCommand({
|
|
11574
11650
|
resource: "scenario",
|
|
@@ -11584,9 +11660,85 @@ var scenarioAppend = withProjectCollectionPolicy(createAnalysisCapabilityCommand
|
|
|
11584
11660
|
{ name: "entry-id", type: "string", desc: "Stable append ID; defaults to current-turn-id:entry-type. Preserve on retries, independent of text edits." },
|
|
11585
11661
|
{ name: "user-message", type: "string", sensitive: true, desc: "For answer_revision only: exact triggering follow-up request, up to 4096 characters, when not already captured as user_feedback. Preserve scope changes without inventing negative feedback." }
|
|
11586
11662
|
],
|
|
11587
|
-
buildInput: (ctx) =>
|
|
11663
|
+
buildInput: (ctx) => scenarioTransportInput(ctx, true)
|
|
11588
11664
|
}));
|
|
11589
|
-
|
|
11665
|
+
function scenarioDuration(start, now = Date.now()) {
|
|
11666
|
+
const millis = Date.parse(start);
|
|
11667
|
+
if (!/^\d{4}-\d{2}-\d{2}T.*(?:Z|[+-]\d{2}:\d{2})$/.test(start) || !Number.isFinite(millis) || !(/* @__PURE__ */ new Date(`${start.slice(0, 10)}T00:00:00Z`)).toISOString().startsWith(start.slice(0, 10)) || millis > now || now - millis > 7776e6) {
|
|
11668
|
+
throw new CliValidationError("start-time must be a real ISO-8601 timestamp within the last 90 days, copied from scenario begin.");
|
|
11669
|
+
}
|
|
11670
|
+
return now - millis;
|
|
11671
|
+
}
|
|
11672
|
+
var scenarioBegin = {
|
|
11673
|
+
service: "analysis",
|
|
11674
|
+
resource: "scenario",
|
|
11675
|
+
command: "begin",
|
|
11676
|
+
risk: "read",
|
|
11677
|
+
usesAeHost: false,
|
|
11678
|
+
description: "Capture the start of this question locally. No network request or file write. Reuse start_time when collecting the ready answer.",
|
|
11679
|
+
flags: [],
|
|
11680
|
+
execute: async () => ({ start_time: (/* @__PURE__ */ new Date()).toISOString() })
|
|
11681
|
+
};
|
|
11682
|
+
function scenarioListInput(ctx) {
|
|
11683
|
+
const input = {};
|
|
11684
|
+
for (const [flag, min, max, fallback] of [
|
|
11685
|
+
["project-id", 1, 2147483647, void 0],
|
|
11686
|
+
["days", 1, 90, 7],
|
|
11687
|
+
["limit", 1, 50, 20],
|
|
11688
|
+
["offset", 0, 2147483647, 0]
|
|
11689
|
+
]) {
|
|
11690
|
+
const value = ctx.str(flag) === "" ? fallback : Number(ctx.str(flag));
|
|
11691
|
+
if (value === void 0 || !Number.isInteger(value) || value < min || value > max) {
|
|
11692
|
+
throw new CliValidationError(`${flag} must be an integer between ${min} and ${max}.`);
|
|
11693
|
+
}
|
|
11694
|
+
input[flag.replaceAll("-", "_")] = value;
|
|
11695
|
+
}
|
|
11696
|
+
const end = ctx.str("end-time");
|
|
11697
|
+
if (end) {
|
|
11698
|
+
if (!/^\d{4}-\d{2}-\d{2}T.*(?:Z|[+-]\d{2}:\d{2})$/.test(end) || !Number.isFinite(Date.parse(end)) || !(/* @__PURE__ */ new Date(`${end.slice(0, 10)}T00:00:00Z`)).toISOString().startsWith(end.slice(0, 10))) {
|
|
11699
|
+
throw new CliValidationError("end-time must be an ISO-8601 timestamp with a timezone.");
|
|
11700
|
+
}
|
|
11701
|
+
input.end_time = end;
|
|
11702
|
+
}
|
|
11703
|
+
return input;
|
|
11704
|
+
}
|
|
11705
|
+
var scenarioList = createAnalysisCapabilityCommand({
|
|
11706
|
+
resource: "scenario",
|
|
11707
|
+
command: "list",
|
|
11708
|
+
capabilityId: "analysis.scenario.list",
|
|
11709
|
+
risk: "read",
|
|
11710
|
+
description: "Read archived scenario questions with optional answer duration, exact answers, feedback and revisions. Follow the scenario review Skill for semantic deduplication and badcase assessment.",
|
|
11711
|
+
flags: [
|
|
11712
|
+
{ name: "project-id", type: "number", required: true, desc: "Project to review. Requires project configuration permission to read collected content." },
|
|
11713
|
+
{ name: "days", type: "number", desc: "Recent calendar days including today in the deployment timezone. Default 7; range 1..90." },
|
|
11714
|
+
{ name: "limit", type: "number", desc: "Complete scenarios per page. Default 20; range 1..50." },
|
|
11715
|
+
{ name: "offset", type: "number", desc: "Scenario offset. Default 0; follow meta.next_offset until meta.has_more is false." },
|
|
11716
|
+
{ name: "end-time", type: "string", desc: "Exclusive ISO-8601 snapshot boundary. Reuse the first response meta.end_time and the same days on every subsequent page." }
|
|
11717
|
+
],
|
|
11718
|
+
buildInput: scenarioListInput
|
|
11719
|
+
});
|
|
11720
|
+
function scenarioGetInput(ctx) {
|
|
11721
|
+
const { limit, offset, ...input } = scenarioListInput(ctx);
|
|
11722
|
+
for (const key of ["open-id", "agent-session-id", "question-id"]) {
|
|
11723
|
+
input[key.replaceAll("-", "_")] = text2(ctx.str(key), key, 191);
|
|
11724
|
+
}
|
|
11725
|
+
return input;
|
|
11726
|
+
}
|
|
11727
|
+
var scenarioGet = createAnalysisCapabilityCommand({
|
|
11728
|
+
resource: "scenario",
|
|
11729
|
+
command: "get",
|
|
11730
|
+
capabilityId: "analysis.scenario.get",
|
|
11731
|
+
risk: "read",
|
|
11732
|
+
description: "Read one archived question with answer duration and linked CLI inputs, execution results, costs and errors. Missing evidence stays explicit.",
|
|
11733
|
+
flags: [
|
|
11734
|
+
...scenarioList.flags.filter((flag) => !["limit", "offset"].includes(flag.name)),
|
|
11735
|
+
{ name: "open-id", type: "string", required: true, desc: "Exact initial.open_id from scenario list. Project configuration permission is still required." },
|
|
11736
|
+
{ name: "agent-session-id", type: "string", required: true, desc: "Exact initial.agent_session_id from scenario list." },
|
|
11737
|
+
{ name: "question-id", type: "string", required: true, desc: "Exact initial.question_id from scenario list." }
|
|
11738
|
+
],
|
|
11739
|
+
buildInput: scenarioGetInput
|
|
11740
|
+
});
|
|
11741
|
+
var scenario_default = [scenarioBegin, scenarioCollect, scenarioAppend, scenarioList, scenarioGet];
|
|
11590
11742
|
|
|
11591
11743
|
// src/commands/te-analysis/index.ts
|
|
11592
11744
|
registerCapabilityGatewayRoute("analysis", { gatewayDomain: "analysis" });
|