@huawei-iac-tools/landingzone-workbench 0.0.0-stage → 0.0.2
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/LICENSE +201 -0
- package/README.md +85 -2
- package/cordis.patch.yml +21 -0
- package/knowledge/account-qualification.md +128 -0
- package/knowledge/blueprints/_base/blueprint.json +481 -0
- package/knowledge/blueprints/_base/defaults.json +127 -0
- package/knowledge/blueprints/foundation-lz/blueprint.json +43 -0
- package/knowledge/blueprints/foundation-lz/defaults.json +47 -0
- package/knowledge/blueprints/full-lz/blueprint.json +11 -0
- package/knowledge/blueprints/full-lz/defaults.json +8 -0
- package/knowledge/config.json +43 -0
- package/knowledge/error-rules.json +14 -0
- package/knowledge/ic-policies.json +21 -0
- package/knowledge/modules/account-structure.md +101 -0
- package/knowledge/modules/compliance/config-rms.md +212 -0
- package/knowledge/modules/compliance/cts.md +179 -0
- package/knowledge/modules/compliance/obs-lts.md +155 -0
- package/knowledge/modules/ic-policies.json +21 -0
- package/knowledge/modules/identity-center.md +603 -0
- package/knowledge/modules/module-layers.md +169 -0
- package/knowledge/modules/network/er.md +222 -0
- package/knowledge/modules/network/nat-eip.md +123 -0
- package/knowledge/modules/network/ram-share.md +92 -0
- package/knowledge/modules/network/vpc-subnet.md +142 -0
- package/knowledge/modules/organization-security/scp.md +122 -0
- package/knowledge/modules/organizations.md +212 -0
- package/knowledge/modules/recommended-config.md +157 -0
- package/knowledge/modules/recommended-rules.json +175 -0
- package/knowledge/modules/scp-policies.json +111 -0
- package/knowledge/modules/security/aad.md +94 -0
- package/knowledge/modules/security/cfw.md +105 -0
- package/knowledge/modules/security/waf.md +110 -0
- package/knowledge/param-mappings.json +133 -0
- package/knowledge/prompts.md +83 -0
- package/knowledge/resource-types.json +1162 -0
- package/knowledge/scp-policies.json +111 -0
- package/knowledge/state-machine.md +33 -0
- package/lib/client.js +21 -0
- package/lib/index.js +28592 -0
- package/lib/types/account-role.d.ts +19 -0
- package/lib/types/account-scope.d.ts +10 -0
- package/lib/types/agency.d.ts +38 -0
- package/lib/types/client/DropdownSelect.d.ts +49 -0
- package/lib/types/client/LoginGate.d.ts +20 -0
- package/lib/types/client/PanelIcon.d.ts +11 -0
- package/lib/types/client/WorkbenchShell.d.ts +21 -0
- package/lib/types/client/account-role.d.ts +15 -0
- package/lib/types/client/credential-status.d.ts +15 -0
- package/lib/types/client/huawei-mark.d.ts +37 -0
- package/lib/types/client/index.d.ts +26 -0
- package/lib/types/client/layout-ref.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/AdviceCard.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/AuditBar.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/ChangeSummaryCard.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/ChangesCard.d.ts +27 -0
- package/lib/types/client/pages/ConfigPage/ComplianceDetail.d.ts +25 -0
- package/lib/types/client/pages/ConfigPage/ComplianceSummaryCard.d.ts +31 -0
- package/lib/types/client/pages/ConfigPage/FindingsCard.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/GlossaryDrawer.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/OrgComplianceDetail.d.ts +15 -0
- package/lib/types/client/pages/ConfigPage/Pager.d.ts +32 -0
- package/lib/types/client/pages/ConfigPage/ResourceDrawer.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/ResourcesTable.d.ts +35 -0
- package/lib/types/client/pages/ConfigPage/RollupPanel.d.ts +17 -0
- package/lib/types/client/pages/ConfigPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/ConfigPage/StatusCards.d.ts +26 -0
- package/lib/types/client/pages/ConfigPage/UncoveredDialog.d.ts +22 -0
- package/lib/types/client/pages/ConfigPage/config-api.d.ts +101 -0
- package/lib/types/client/pages/ConfigPage/config-store.d.ts +57 -0
- package/lib/types/client/pages/ConfigPage/index.d.ts +21 -0
- package/lib/types/client/pages/ConfigPage/paging.d.ts +46 -0
- package/lib/types/client/pages/ConfigPage/scope-options.d.ts +51 -0
- package/lib/types/client/pages/CostPage/AccountAllocation.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountBars.d.ts +20 -0
- package/lib/types/client/pages/CostPage/AccountColumns.d.ts +24 -0
- package/lib/types/client/pages/CostPage/AccountDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/AccountSwitcher.d.ts +25 -0
- package/lib/types/client/pages/CostPage/AdviceCard.d.ts +43 -0
- package/lib/types/client/pages/CostPage/AdviceFindings.d.ts +43 -0
- package/lib/types/client/pages/CostPage/BillingPanels.d.ts +23 -0
- package/lib/types/client/pages/CostPage/BudgetCard.d.ts +36 -0
- package/lib/types/client/pages/CostPage/GlossaryDrawer.d.ts +16 -0
- package/lib/types/client/pages/CostPage/KpiRow.d.ts +23 -0
- package/lib/types/client/pages/CostPage/MarkdownBlock.d.ts +16 -0
- package/lib/types/client/pages/CostPage/ReportView.d.ts +17 -0
- package/lib/types/client/pages/CostPage/ResourceColumns.d.ts +19 -0
- package/lib/types/client/pages/CostPage/ResourceDonut.d.ts +18 -0
- package/lib/types/client/pages/CostPage/ResourcesCard.d.ts +40 -0
- package/lib/types/client/pages/CostPage/RuleDetailDrawer.d.ts +23 -0
- package/lib/types/client/pages/CostPage/SavingView.d.ts +38 -0
- package/lib/types/client/pages/CostPage/ServiceDonut.d.ts +17 -0
- package/lib/types/client/pages/CostPage/TrendChart.d.ts +24 -0
- package/lib/types/client/pages/CostPage/budget-input.d.ts +30 -0
- package/lib/types/client/pages/CostPage/cost-api.d.ts +266 -0
- package/lib/types/client/pages/CostPage/cost-store.d.ts +25 -0
- package/lib/types/client/pages/CostPage/format.d.ts +37 -0
- package/lib/types/client/pages/CostPage/index.d.ts +34 -0
- package/lib/types/client/pages/CostPage/trend-fold.d.ts +32 -0
- package/lib/types/client/pages/CostPage/useEcharts.d.ts +70 -0
- package/lib/types/client/pages/OrgStructurePage/AccountStatsCard.d.ts +22 -0
- package/lib/types/client/pages/OrgStructurePage/CoreAccountsCard.d.ts +18 -0
- package/lib/types/client/pages/OrgStructurePage/CreateAccountDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/ManageUsersDialog.d.ts +28 -0
- package/lib/types/client/pages/OrgStructurePage/MemberAccountsTable.d.ts +32 -0
- package/lib/types/client/pages/OrgStructurePage/MoveAccountDialog.d.ts +29 -0
- package/lib/types/client/pages/OrgStructurePage/OrgGlossaryDrawer.d.ts +13 -0
- package/lib/types/client/pages/OrgStructurePage/OrgTreeCard.d.ts +31 -0
- package/lib/types/client/pages/OrgStructurePage/index.d.ts +21 -0
- package/lib/types/client/pages/OrgStructurePage/org-api.d.ts +166 -0
- package/lib/types/client/pages/OverviewPage/AnchorRow.d.ts +24 -0
- package/lib/types/client/pages/OverviewPage/AttentionList.d.ts +29 -0
- package/lib/types/client/pages/OverviewPage/OverviewCharts.d.ts +79 -0
- package/lib/types/client/pages/OverviewPage/OverviewGlossaryDrawer.d.ts +15 -0
- package/lib/types/client/pages/OverviewPage/index.d.ts +22 -0
- package/lib/types/client/pages/OverviewPage/overview-api.d.ts +115 -0
- package/lib/types/client/pages/ResourcePage/AccountResourceList.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/GlossaryDrawer.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/components/MetricCards.d.ts +19 -0
- package/lib/types/client/pages/ResourcePage/components/MultiSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/PanelPager.d.ts +26 -0
- package/lib/types/client/pages/ResourcePage/components/RankBars.d.ts +25 -0
- package/lib/types/client/pages/ResourcePage/components/ScopeSelect.d.ts +27 -0
- package/lib/types/client/pages/ResourcePage/components/SourceConfigModal.d.ts +21 -0
- package/lib/types/client/pages/ResourcePage/components/SyncControls.d.ts +18 -0
- package/lib/types/client/pages/ResourcePage/components/TrendChart.d.ts +14 -0
- package/lib/types/client/pages/ResourcePage/components/useColumnWidths.d.ts +12 -0
- package/lib/types/client/pages/ResourcePage/format.d.ts +9 -0
- package/lib/types/client/pages/ResourcePage/index.d.ts +20 -0
- package/lib/types/client/pages/ResourcePage/summary-api.d.ts +205 -0
- package/lib/types/client/pages/SetupPage/AskPanel.d.ts +21 -0
- package/lib/types/client/pages/SetupPage/ChatEmbed.d.ts +40 -0
- package/lib/types/client/pages/SetupPage/ChatTab.d.ts +17 -0
- package/lib/types/client/pages/SetupPage/FormTab.d.ts +12 -0
- package/lib/types/client/pages/SetupPage/FormTabV2.d.ts +14 -0
- package/lib/types/client/pages/SetupPage/ProgressTreeView.d.ts +15 -0
- package/lib/types/client/pages/SetupPage/StageFlow.d.ts +16 -0
- package/lib/types/client/pages/SetupPage/index.d.ts +10 -0
- package/lib/types/client/pages/SetupPage/progress-types.d.ts +36 -0
- package/lib/types/client/pages/SetupPage/session-binding.d.ts +38 -0
- package/lib/types/client/pages/SetupPage/session-store.d.ts +57 -0
- package/lib/types/client/pages/SetupPage/sessions-ref.d.ts +5 -0
- package/lib/types/client/pages/SetupPage/setup-replan.d.ts +13 -0
- package/lib/types/client/pages/SetupPage/wb-api.d.ts +192 -0
- package/lib/types/client/pages/list-preview.d.ts +36 -0
- package/lib/types/client/permission-mode.d.ts +53 -0
- package/lib/types/client/store.d.ts +22 -0
- package/lib/types/collect.d.ts +78 -0
- package/lib/types/config/account-scope.d.ts +61 -0
- package/lib/types/config/advice-findings.d.ts +31 -0
- package/lib/types/config/advice-prompt.d.ts +60 -0
- package/lib/types/config/advice.d.ts +116 -0
- package/lib/types/config/cts.d.ts +30 -0
- package/lib/types/config/evidence/rules.d.ts +31 -0
- package/lib/types/config/evidence/types.d.ts +103 -0
- package/lib/types/config/failure-note.d.ts +46 -0
- package/lib/types/config/fingerprint-cache.d.ts +45 -0
- package/lib/types/config/identity.d.ts +67 -0
- package/lib/types/config/query.d.ts +49 -0
- package/lib/types/config/rms.d.ts +412 -0
- package/lib/types/config/routes.d.ts +32 -0
- package/lib/types/config/types.d.ts +785 -0
- package/lib/types/config/views.d.ts +158 -0
- package/lib/types/cost/accounts.d.ts +29 -0
- package/lib/types/cost/advice-findings.d.ts +77 -0
- package/lib/types/cost/advice-model.d.ts +19 -0
- package/lib/types/cost/advice-prompt.d.ts +73 -0
- package/lib/types/cost/advice-subagent-types.d.ts +6 -0
- package/lib/types/cost/advice-subagent.d.ts +116 -0
- package/lib/types/cost/advice-types.d.ts +63 -0
- package/lib/types/cost/advice.d.ts +125 -0
- package/lib/types/cost/aggregate.d.ts +157 -0
- package/lib/types/cost/assume.d.ts +43 -0
- package/lib/types/cost/bss.d.ts +166 -0
- package/lib/types/cost/budget-overview.d.ts +38 -0
- package/lib/types/cost/budget.d.ts +56 -0
- package/lib/types/cost/cache.d.ts +58 -0
- package/lib/types/cost/caliber.d.ts +40 -0
- package/lib/types/cost/console-links.d.ts +27 -0
- package/lib/types/cost/credentials.d.ts +38 -0
- package/lib/types/cost/data-window.d.ts +38 -0
- package/lib/types/cost/evidence/catalog.d.ts +35 -0
- package/lib/types/cost/evidence/index.d.ts +70 -0
- package/lib/types/cost/evidence/inventory.d.ts +44 -0
- package/lib/types/cost/evidence/pricing.d.ts +72 -0
- package/lib/types/cost/evidence/projects.d.ts +18 -0
- package/lib/types/cost/evidence/rules.d.ts +66 -0
- package/lib/types/cost/evidence/state.d.ts +38 -0
- package/lib/types/cost/evidence/thresholds.d.ts +68 -0
- package/lib/types/cost/evidence/types.d.ts +288 -0
- package/lib/types/cost/evidence/utilization.d.ts +37 -0
- package/lib/types/cost/history.d.ts +36 -0
- package/lib/types/cost/ledger.d.ts +97 -0
- package/lib/types/cost/normalize.d.ts +37 -0
- package/lib/types/cost/period-projection.d.ts +57 -0
- package/lib/types/cost/plan-check.d.ts +102 -0
- package/lib/types/cost/plan-db.d.ts +73 -0
- package/lib/types/cost/plan-types.d.ts +183 -0
- package/lib/types/cost/plan.d.ts +63 -0
- package/lib/types/cost/quote.d.ts +45 -0
- package/lib/types/cost/report.d.ts +136 -0
- package/lib/types/cost/resources.d.ts +108 -0
- package/lib/types/cost/routes.d.ts +38 -0
- package/lib/types/cost/scope.d.ts +42 -0
- package/lib/types/cost/types.d.ts +335 -0
- package/lib/types/cost/unit-prices-derive.d.ts +19 -0
- package/lib/types/cost/unit-prices.d.ts +23 -0
- package/lib/types/db.d.ts +228 -0
- package/lib/types/host-log.d.ts +7 -0
- package/lib/types/http.d.ts +42 -0
- package/lib/types/index.d.ts +30 -0
- package/lib/types/inventory.d.ts +286 -0
- package/lib/types/obs.d.ts +16 -0
- package/lib/types/org/aggregate.d.ts +36 -0
- package/lib/types/org/churn.d.ts +10 -0
- package/lib/types/org/orgs.d.ts +258 -0
- package/lib/types/org/routes.d.ts +28 -0
- package/lib/types/org-types.d.ts +156 -0
- package/lib/types/per-service.d.ts +39 -0
- package/lib/types/setup/blueprint-loader.d.ts +81 -0
- package/lib/types/setup/caller.d.ts +105 -0
- package/lib/types/setup/engine.d.ts +41 -0
- package/lib/types/setup/form-store.d.ts +13 -0
- package/lib/types/setup/nodes/n1-check.d.ts +14 -0
- package/lib/types/setup/nodes/n10-governance.d.ts +6 -0
- package/lib/types/setup/nodes/n11-infra.d.ts +6 -0
- package/lib/types/setup/nodes/n12-reconcile.d.ts +6 -0
- package/lib/types/setup/nodes/n2-region.d.ts +6 -0
- package/lib/types/setup/nodes/n3-blueprint.d.ts +6 -0
- package/lib/types/setup/nodes/n4-modules.d.ts +6 -0
- package/lib/types/setup/nodes/n5-details.d.ts +6 -0
- package/lib/types/setup/nodes/n6-plan.d.ts +6 -0
- package/lib/types/setup/nodes/n7-verify.d.ts +6 -0
- package/lib/types/setup/nodes/n8-approve.d.ts +6 -0
- package/lib/types/setup/nodes/n9-buildmode.d.ts +6 -0
- package/lib/types/setup/plan-state.d.ts +10 -0
- package/lib/types/setup/prompt-loader.d.ts +16 -0
- package/lib/types/setup/routes.d.ts +22 -0
- package/lib/types/setup/session-notify.d.ts +30 -0
- package/lib/types/setup/tools.d.ts +19 -0
- package/lib/types/setup/types.d.ts +157 -0
- package/lib/types/sse-bus.d.ts +23 -0
- package/lib/types/tools/config-facts.d.ts +16 -0
- package/lib/types/tools/cost-facts.d.ts +10 -0
- package/lib/types/tools/register.d.ts +18 -0
- package/lib/types/wb-conventions.d.ts +140 -0
- package/package.json +77 -4
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type NodeId, type FormState, type FormPatch, type FormView, type EngineResult } from './types.ts';
|
|
2
|
+
import { type FormValidator } from './form-store.ts';
|
|
3
|
+
import { type Blueprint } from './blueprint-loader.ts';
|
|
4
|
+
export interface NodeContext {
|
|
5
|
+
readonly planDir: string;
|
|
6
|
+
readonly form: FormState;
|
|
7
|
+
readonly logger: LoggerLike;
|
|
8
|
+
}
|
|
9
|
+
export interface LoggerLike {
|
|
10
|
+
info(m: string): void;
|
|
11
|
+
warn(m: string): void;
|
|
12
|
+
}
|
|
13
|
+
/** advance 返回形状:view 可省略(引擎统一组装) */
|
|
14
|
+
export type NodeAdvanceResult = Omit<EngineResult, 'view'> & Partial<Pick<EngineResult, 'view'>>;
|
|
15
|
+
export interface NodeHandler {
|
|
16
|
+
readonly id: NodeId;
|
|
17
|
+
/** 输入条件满足且未完成(线性路由找它) */
|
|
18
|
+
canEnter(ctx: NodeContext): Promise<boolean>;
|
|
19
|
+
/** 完成判据(state-machine.md complete 表达式求值) */
|
|
20
|
+
isComplete(ctx: NodeContext): Promise<boolean>;
|
|
21
|
+
/** 唯一推进入口(引擎 submit 调用)。view 由引擎统一组装,可省略 */
|
|
22
|
+
advance(ctx: NodeContext, patch: FormPatch): Promise<NodeAdvanceResult>;
|
|
23
|
+
}
|
|
24
|
+
export declare const HANDLERS: Record<NodeId, NodeHandler>;
|
|
25
|
+
declare const validator: FormValidator;
|
|
26
|
+
export { validator as defaultValidator };
|
|
27
|
+
export declare function buildFormView(form: FormState, bp: Blueprint): FormView;
|
|
28
|
+
export declare class SetupEngine {
|
|
29
|
+
private readonly logger;
|
|
30
|
+
constructor(logger?: LoggerLike);
|
|
31
|
+
/** 线性路由:NODE_ORDER 找第一个 !isComplete 的节点 */
|
|
32
|
+
currentNode(ctx: NodeContext): Promise<NodeId>;
|
|
33
|
+
/** 唯一写入口(路由 POST 与 wb_lz_form 工具都调它) */
|
|
34
|
+
submit(planDir: string, patch: FormPatch, _actor: 'chat' | 'panel', expectedVersion: number): Promise<EngineResult>;
|
|
35
|
+
/** 无 form 资质模式:直接跑 n1 的资质检查(结果写 qualification.json,form 建立时由 initForm 合并) */
|
|
36
|
+
private runQualificationOnly;
|
|
37
|
+
/** 只读快照(GET):不写盘不发 SSE。无 form 时返回 DRAFT 态(读 qualification.json 的先行资质),不再 400——
|
|
38
|
+
* 资质通过后、首建前,SSE 触发的 refresh GET 靠它拿到合法快照 */
|
|
39
|
+
snapshot(planDir: string): Promise<EngineResult>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=engine.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type FormState, type FormPatch } from './types.ts';
|
|
2
|
+
import { type Blueprint } from './blueprint-loader.ts';
|
|
3
|
+
declare const FORM_FILE = "form.json";
|
|
4
|
+
export declare function readForm(planDir: string): Promise<FormState | null>;
|
|
5
|
+
export declare function initForm(planDir: string, blueprintId: string, region: string): Promise<FormState>;
|
|
6
|
+
export interface FormValidator {
|
|
7
|
+
/** 返回 每节 → invalidReason 列表(空数组=该节可确认) */
|
|
8
|
+
validateSections(form: FormState, blueprint: Blueprint): Promise<ReadonlyMap<string, readonly string[]>>;
|
|
9
|
+
}
|
|
10
|
+
export declare function writeForm(planDir: string, patch: FormPatch, expectedVersion: number, validator: FormValidator): Promise<FormState>;
|
|
11
|
+
export { FORM_FILE };
|
|
12
|
+
export declare function setTopLevel(planDir: string, mutate: (form: FormState) => void, expectedVersion: number): Promise<FormState>;
|
|
13
|
+
//# sourceMappingURL=form-store.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* N1 资质检查 — M2 S2-2 真实现(13 项探测并行 + 企业实名 + 主账号校验)。
|
|
3
|
+
*
|
|
4
|
+
* 移植自旧插件 checks.ts runChecks(分层判定逻辑保留),差异:
|
|
5
|
+
* - 接 WbCaller(桥/直签名)而非旧 McpCaller
|
|
6
|
+
* - 探测项 Promise.allSettled 并行(旧版串行循环——07 篇 S2-2 要求)
|
|
7
|
+
* - 判定阈值从 knowledge/account-qualification.md 读(不硬编码 2/1)
|
|
8
|
+
* - caller 未就绪 → 降级为本地占位通过(M0 行为,日志可见)
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/setup/nodes/n1-check
|
|
11
|
+
*/
|
|
12
|
+
import type { NodeHandler } from '../engine.ts';
|
|
13
|
+
export declare const n1Check: NodeHandler;
|
|
14
|
+
//# sourceMappingURL=n1-check.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type PlanStatus = 'open' | 'close';
|
|
2
|
+
/** 读方案状态;无文件/解析失败 → null(调用方按"不可用"处理) */
|
|
3
|
+
export declare function readPlanStatus(planDir: string): Promise<PlanStatus | null>;
|
|
4
|
+
/** 原子写方案状态(tmp+rename,与 form-store 同款纪律) */
|
|
5
|
+
export declare function writePlanStatus(planDir: string, status: PlanStatus): Promise<void>;
|
|
6
|
+
/** 同步读(路由 resolve 用) */
|
|
7
|
+
export declare function readPlanStatusSync(planDir: string): PlanStatus | null;
|
|
8
|
+
/** 同步写(旧代码路径兼容) */
|
|
9
|
+
export declare function writePlanStatusSync(planDir: string, status: PlanStatus): void;
|
|
10
|
+
//# sourceMappingURL=plan-state.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 一条话术模板:userMessage(给人)/ nextAction(给 AI 的下一步指令) */
|
|
2
|
+
export interface PromptTemplate {
|
|
3
|
+
readonly userMessage?: string;
|
|
4
|
+
readonly nextAction?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* 取话术:优先模板插值,模板缺失用 fallback(不抛错——话术缺失不该阻断主线)。
|
|
8
|
+
* @returns { message, nextAction }
|
|
9
|
+
*/
|
|
10
|
+
export declare function prompt(key: string, vars?: Record<string, string | number>, fallback?: PromptTemplate): {
|
|
11
|
+
message: string;
|
|
12
|
+
nextAction: string;
|
|
13
|
+
};
|
|
14
|
+
/** 测试用:清缓存(话术热改重载) */
|
|
15
|
+
export declare function clearPromptCache(): void;
|
|
16
|
+
//# sourceMappingURL=prompt-loader.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type WebServerLike } from '../http.ts';
|
|
2
|
+
import type { SetupEngine } from './engine.ts';
|
|
3
|
+
/** 双前缀目录匹配(T1 更名 + T2 存量兼容) */
|
|
4
|
+
export declare function isBuildDir(name: string): boolean;
|
|
5
|
+
/** GA6:解析唯一活跃方案(!discarded 且 n12 未完成)。0 个/多个 抛错。 */
|
|
6
|
+
export declare function resolveActivePlanDir(explicit?: string): string;
|
|
7
|
+
export declare function registerSetupRoutes(opts: {
|
|
8
|
+
readonly webServer: WebServerLike;
|
|
9
|
+
readonly engine: SetupEngine;
|
|
10
|
+
readonly broadcast: (event: {
|
|
11
|
+
tool: string;
|
|
12
|
+
} & Record<string, unknown>) => void;
|
|
13
|
+
readonly logger: {
|
|
14
|
+
info(m: string): void;
|
|
15
|
+
warn(m: string): void;
|
|
16
|
+
};
|
|
17
|
+
/** C-4:宿主 sessionController(表单→会话通知注入)。传 getter 避免注入时序依赖。 */
|
|
18
|
+
readonly sessionController?: () => import('./session-notify.ts').NotifySessionController | null;
|
|
19
|
+
/** 文件日志(index.ts 的 fileLog)——路由/引擎每个请求落盘,定位用 */
|
|
20
|
+
readonly fileLog?: (msg: string) => void;
|
|
21
|
+
}): Array<() => void>;
|
|
22
|
+
//# sourceMappingURL=routes.d.ts.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* C-4 表单→会话变更通知(双向同步缺环,2026-11-15 用户定稿)。
|
|
3
|
+
*
|
|
4
|
+
* 【2026-11-16 通道改版终局】host 侧注入停用——实测两条 host 通道均不可用:
|
|
5
|
+
* ① hostSessions.retain:客户端 API(host SessionStore 只有 create)
|
|
6
|
+
* ② sessionController.prompt:resolveAgent 对空壳会话返回 {error} 不解包 →
|
|
7
|
+
* prompt rejected(session/agent-busy)
|
|
8
|
+
* 现行通道 = 客户端:wb-api.notifySession(sessions-ref → retain → prompt('queue')),
|
|
9
|
+
* FormTabV2 在 SSE setup-form 事件后调用——与用户在 ChatEmbed 手打字同一条验证路径。
|
|
10
|
+
* 本文件仅保留接口类型(routes 引用)与停用说明;host 逻辑已删。
|
|
11
|
+
*
|
|
12
|
+
* @module @huaweidevtools/landingzone-workbench/setup/session-notify
|
|
13
|
+
*/
|
|
14
|
+
/** 宿主 sessionController 的最小面(停用前的接口形状,保留供未来复用参考)。 */
|
|
15
|
+
export interface NotifySessionController {
|
|
16
|
+
prompt(request: {
|
|
17
|
+
sessionId: string;
|
|
18
|
+
content: Array<{
|
|
19
|
+
type: 'text';
|
|
20
|
+
text: string;
|
|
21
|
+
}>;
|
|
22
|
+
mode?: string;
|
|
23
|
+
}, signal: AbortSignal): Promise<unknown>;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 【停用】host 侧注入入口。保留签名(routes 调用点不破坏编译),恒 return。
|
|
27
|
+
* 真实通知由客户端通道完成(见 src/client/pages/SetupPage/wb-api.ts notifySession)。
|
|
28
|
+
*/
|
|
29
|
+
export declare function notifyFormChange(_planDir: string, _body: Record<string, unknown>, _ctrl: NotifySessionController | null): Promise<void>;
|
|
30
|
+
//# sourceMappingURL=session-notify.d.ts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
2
|
+
import { type FormPatch } from './types.ts';
|
|
3
|
+
/** 工具共用的引擎依赖注入(routes 同款解析:planDir 缺省=唯一活跃方案) */
|
|
4
|
+
export interface WbLzToolsDeps {
|
|
5
|
+
readonly engine: SetupEngineLike;
|
|
6
|
+
/** resolveActivePlanDir(来自 setup/routes,含 GA6 回退与歧义报错) */
|
|
7
|
+
readonly resolvePlanDir: (explicit?: string) => string;
|
|
8
|
+
readonly logger: {
|
|
9
|
+
info(m: string): void;
|
|
10
|
+
warn(m: string): void;
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
/** 引擎最小面(SetupEngine 结构子集,便于测试注入) */
|
|
14
|
+
export interface SetupEngineLike {
|
|
15
|
+
submit(planDir: string, patch: FormPatch, actor: 'chat' | 'panel', expectedVersion: number): Promise<unknown>;
|
|
16
|
+
snapshot(planDir: string): Promise<unknown>;
|
|
17
|
+
}
|
|
18
|
+
export declare function createWbLzTools(deps: WbLzToolsDeps): ToolDefinition[];
|
|
19
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 初始搭建引擎 — 全部公共类型(唯一类型源)。
|
|
3
|
+
*
|
|
4
|
+
* 逐字对齐 src/doc/05-concrete-spec.md §一(含 GA4 budgetCeiling / GA1 执行作业 /
|
|
5
|
+
* GA6 planDir 可选回退 / 09 G2 单活跃 discarded / G4 schemaVersion)。
|
|
6
|
+
* 改任何字段名=改规格=改 05 篇——参数名会出现在工具 schema 与面板 API 里,是协议的一部分。
|
|
7
|
+
*
|
|
8
|
+
* @module @huaweidevtools/landingzone-workbench/setup/types
|
|
9
|
+
*/
|
|
10
|
+
export type NodeId = 'n1-check' | 'n2-region' | 'n3-blueprint' | 'n4-modules' | 'n5-details' | 'n6-plan' | 'n7-verify' | 'n8-approve' | 'n9-buildmode' | 'n10-governance' | 'n11-infra' | 'n12-reconcile';
|
|
11
|
+
export declare const NODE_ORDER: readonly NodeId[];
|
|
12
|
+
/** 主线两大段(进度树分组用):n1-n8=确认需求,n9-n12=执行 */
|
|
13
|
+
export declare const PLANNING_NODES: readonly NodeId[];
|
|
14
|
+
export declare const EXECUTION_NODES: readonly NodeId[];
|
|
15
|
+
export type NodeStatus = 'pending' | 'in-progress' | 'blocked' | 'done' | 'failed';
|
|
16
|
+
/** 字段值来源(方案文档与对账按它统计"蓝图默认 N 项/用户决策 M 项") */
|
|
17
|
+
export type FieldSource = 'blueprint' | 'user';
|
|
18
|
+
/** 蓝图节 id(=模块 id) */
|
|
19
|
+
export type SectionId = string;
|
|
20
|
+
export declare const FORM_SCHEMA_VERSION: 1;
|
|
21
|
+
export interface FormState {
|
|
22
|
+
/** 表结构版本(G4):readForm 遇未知版本报错不猜 */
|
|
23
|
+
schemaVersion: number;
|
|
24
|
+
/** 必填。选定的蓝图 id('full-lz' | 'foundation-lz',N3 写入) */
|
|
25
|
+
blueprintId: string;
|
|
26
|
+
/** 必填。region id(如 'cn-north-4',N2 写入) */
|
|
27
|
+
region: string;
|
|
28
|
+
/** 必填。乐观锁版本号,每次成功写 +1;面板 POST 必须带 expectedVersion 匹配 */
|
|
29
|
+
version: number;
|
|
30
|
+
/** N4 写入。锁定模块不在内(隐含全选) */
|
|
31
|
+
modules: {
|
|
32
|
+
readonly enhanced: readonly string[];
|
|
33
|
+
readonly extended: readonly string[];
|
|
34
|
+
};
|
|
35
|
+
/** 字段路径 → 值。行级补丁直接写叶子路径(如 'accounts.accountNames.opsAccount') */
|
|
36
|
+
readonly filled: Record<string, unknown>;
|
|
37
|
+
/** 与 filled 同键集合。filled 有值但 source 缺键时按 'blueprint' 处理 */
|
|
38
|
+
readonly source: Record<string, FieldSource>;
|
|
39
|
+
/** 参数确认状态(N5 写入):过参数确认子节点的节 id 列表 */
|
|
40
|
+
readonly confirmed: {
|
|
41
|
+
readonly sections: readonly SectionId[];
|
|
42
|
+
allConfirmed: boolean;
|
|
43
|
+
};
|
|
44
|
+
/** 模块选择确认(n4→n5 门槛,用户定稿 2026-11-17):确认前不展示配置详情 */
|
|
45
|
+
modulesConfirmed: boolean;
|
|
46
|
+
/** N9 写入。null=未选 */
|
|
47
|
+
buildPlan: {
|
|
48
|
+
governance: 'api' | 'terraform';
|
|
49
|
+
infra: 'api' | 'terraform';
|
|
50
|
+
} | null;
|
|
51
|
+
/** 预算上限(元/月):null=未设置(N6 后可填);0=无上限。N8 审批门:>0 且 totalMonthly 超过 → BUDGET_EXCEEDED */
|
|
52
|
+
budgetCeiling: number | null;
|
|
53
|
+
/** 审批状态(N8 写入) */
|
|
54
|
+
approvalStatus: 'none' | 'architecture_confirmed' | 'approved' | 'rejected';
|
|
55
|
+
/** N8 approved 时置 true(执行钥匙);rework 调整时回 false */
|
|
56
|
+
archived: boolean;
|
|
57
|
+
/** 资源清单冻结文档的 specHash(N8 写入;N10/N11 校验) */
|
|
58
|
+
frozenSpecHash: string | null;
|
|
59
|
+
/** 用户首轮资质(N1 写入后随表走) */
|
|
60
|
+
qualificationPassed: boolean;
|
|
61
|
+
/** 单活跃方案约束(G2):显式废弃标记。discarded=true 的方案不参与活跃解析 */
|
|
62
|
+
discarded: boolean;
|
|
63
|
+
updatedAt: string;
|
|
64
|
+
}
|
|
65
|
+
export interface FormPatch {
|
|
66
|
+
/** 字段路径 → 值。值 null=删除该键;对象/数组默认整体替换,map 行级语法见 form-store */
|
|
67
|
+
readonly patch?: Record<string, unknown>;
|
|
68
|
+
/** 按节回填推荐(清 source、filled 回 defaults),先于 accept 执行 */
|
|
69
|
+
readonly resetSections?: readonly string[];
|
|
70
|
+
/** 按节填入推荐(只填空,不覆盖 user 值);支持 '__remaining__' */
|
|
71
|
+
readonly acceptRecommended?: readonly string[];
|
|
72
|
+
/** 参数确认(N5);'__all__'=总确认。⚠️仅当用户亲口确认后 AI/面板才可传 */
|
|
73
|
+
readonly confirmSections?: readonly string[];
|
|
74
|
+
/** 模块多选整体替换(N4) */
|
|
75
|
+
readonly modules?: {
|
|
76
|
+
enhanced?: readonly string[];
|
|
77
|
+
extended?: readonly string[];
|
|
78
|
+
};
|
|
79
|
+
/** 模块选择确认(n4→n5 门槛):确认后模块区收起为摘要、L4 详情展开 */
|
|
80
|
+
readonly modulesConfirmed?: boolean;
|
|
81
|
+
readonly region?: string;
|
|
82
|
+
readonly blueprintId?: string;
|
|
83
|
+
readonly buildPlan?: {
|
|
84
|
+
governance: 'api' | 'terraform';
|
|
85
|
+
infra: 'api' | 'terraform';
|
|
86
|
+
};
|
|
87
|
+
/** 预算上限(元/月):null=未设置,0=无上限。form 级字段,不属任何节 */
|
|
88
|
+
readonly budgetCeiling?: number | null;
|
|
89
|
+
readonly approval?: {
|
|
90
|
+
status: 'architecture_confirmed' | 'approved' | 'rejected';
|
|
91
|
+
};
|
|
92
|
+
/** N10 高危放行(用户确认后传) */
|
|
93
|
+
readonly confirmHighRisk?: boolean;
|
|
94
|
+
/** 显式废弃当前方案(T3:归档当前→允许新建) */
|
|
95
|
+
readonly discard?: boolean;
|
|
96
|
+
}
|
|
97
|
+
export interface FormViewField {
|
|
98
|
+
readonly path: string;
|
|
99
|
+
readonly label: string;
|
|
100
|
+
readonly type: 'enum' | 'string' | 'boolean' | 'number' | 'object-map' | 'array' | 'policy-refs';
|
|
101
|
+
readonly value: unknown;
|
|
102
|
+
readonly source: FieldSource | 'missing';
|
|
103
|
+
readonly required: boolean;
|
|
104
|
+
readonly recommendBadge: boolean;
|
|
105
|
+
readonly options?: ReadonlyArray<{
|
|
106
|
+
value: string;
|
|
107
|
+
label: string;
|
|
108
|
+
recommend?: boolean;
|
|
109
|
+
}>;
|
|
110
|
+
/** 付费字段附月费(元),enum 型按当前值算(月费表来自 knowledge 费用映射) */
|
|
111
|
+
readonly monthlyCost?: number;
|
|
112
|
+
/** 校验失败原因(requiredWhen 命中且缺值等) */
|
|
113
|
+
readonly invalidReason?: string;
|
|
114
|
+
/** 行级/结构编辑提示(object-map/array 的结构说明) */
|
|
115
|
+
readonly note?: string;
|
|
116
|
+
}
|
|
117
|
+
export interface FormViewSection {
|
|
118
|
+
readonly id: SectionId;
|
|
119
|
+
readonly label: string;
|
|
120
|
+
readonly revealed: boolean;
|
|
121
|
+
readonly confirmed: boolean;
|
|
122
|
+
readonly fields: ReadonlyArray<FormViewField>;
|
|
123
|
+
}
|
|
124
|
+
export interface FormView {
|
|
125
|
+
readonly blueprint: {
|
|
126
|
+
readonly id: string;
|
|
127
|
+
readonly label: string;
|
|
128
|
+
readonly desc: string;
|
|
129
|
+
};
|
|
130
|
+
readonly sections: ReadonlyArray<FormViewSection>;
|
|
131
|
+
/** 完成度:done=已确认节数;missing=当前缺的 required 字段 label */
|
|
132
|
+
readonly progress: {
|
|
133
|
+
readonly done: number;
|
|
134
|
+
readonly total: number;
|
|
135
|
+
readonly missing: readonly string[];
|
|
136
|
+
};
|
|
137
|
+
readonly nextSection: string | null;
|
|
138
|
+
}
|
|
139
|
+
export interface EngineResult {
|
|
140
|
+
readonly node: NodeId;
|
|
141
|
+
readonly nodeStatus: NodeStatus;
|
|
142
|
+
readonly form: FormState;
|
|
143
|
+
readonly view: FormView;
|
|
144
|
+
readonly message: string;
|
|
145
|
+
readonly nextAction: string;
|
|
146
|
+
readonly haltReason?: string;
|
|
147
|
+
readonly planDir: string;
|
|
148
|
+
}
|
|
149
|
+
export type SetupErrorCode = 'VERSION_CONFLICT' | 'INVALID_REGION' | 'ARCHIVED_READONLY' | 'CONFIRM_NOT_ALLOWED' | 'NOT_QUALIFIED' | 'BLUEPRINT_UNKNOWN' | 'DRIFT_BLOCKED' | 'EXECUTION_BUSY' | 'EXECUTION_CANCELED' | 'BUDGET_EXCEEDED' | 'PLAN_NOT_FOUND' | 'PLAN_DIR_AMBIGUOUS' | 'SCHEMA_VERSION_UNSUPPORTED';
|
|
150
|
+
export declare class SetupEngineError extends Error {
|
|
151
|
+
readonly code: SetupErrorCode;
|
|
152
|
+
readonly userHint: string;
|
|
153
|
+
constructor(code: SetupErrorCode, userHint: string);
|
|
154
|
+
}
|
|
155
|
+
/** SetupEngineError → HTTP 状态码(routes 层用) */
|
|
156
|
+
export declare function errorCodeToStatus(code: SetupErrorCode): 400 | 409 | 422;
|
|
157
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSE 事件总线 — host→client 单向通知通道。
|
|
3
|
+
*
|
|
4
|
+
* 参考 aishell-landing-zone 的 sse-bus.ts。
|
|
5
|
+
* 工作台 chat 里 agent 调 landing_zone_* 工具后,host broadcast 事件,
|
|
6
|
+
* client EventSource 收到后刷新进展树。
|
|
7
|
+
*/
|
|
8
|
+
import type { IncomingMessage, ServerResponse } from 'node:http';
|
|
9
|
+
/** 一条给 client 的事件载荷。 */
|
|
10
|
+
export interface WbEvent {
|
|
11
|
+
readonly tool: string;
|
|
12
|
+
readonly phase?: string;
|
|
13
|
+
/** 阶段说明文字(资源同步等长流程用)。 */
|
|
14
|
+
readonly detail?: string;
|
|
15
|
+
readonly planDir?: string;
|
|
16
|
+
readonly at: string;
|
|
17
|
+
}
|
|
18
|
+
export declare class SseBus {
|
|
19
|
+
private readonly clients;
|
|
20
|
+
handleEvents: (req: IncomingMessage, res: ServerResponse) => void;
|
|
21
|
+
broadcast(event: WbEvent): void;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=sse-bus.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 工具入参。 */
|
|
2
|
+
export interface ConfigFactsOptions {
|
|
3
|
+
/** 账号 domainId;缺省表示组织视角。 */
|
|
4
|
+
readonly account?: string | undefined;
|
|
5
|
+
/** 追加合规明细(账号视角)或组织级合规汇总(组织视角)。 */
|
|
6
|
+
readonly includeCompliance?: boolean | undefined;
|
|
7
|
+
/** 追加变更事件流。 */
|
|
8
|
+
readonly includeChanges?: boolean | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 组装配置审计事实快照。
|
|
12
|
+
*
|
|
13
|
+
* @returns 可直接交给模型的 JSON 对象;所有数字都来自与看板同一套聚合。
|
|
14
|
+
*/
|
|
15
|
+
export declare function buildConfigFacts(options?: ConfigFactsOptions): Promise<Record<string, unknown>>;
|
|
16
|
+
//# sourceMappingURL=config-facts.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 组装费用事实快照。
|
|
3
|
+
*
|
|
4
|
+
* @param cycleArg 账期;非法或缺省时用当前月。
|
|
5
|
+
* @param accountArg 账号 domainId;缺省表示主账号(全组织)视角。
|
|
6
|
+
* @param costTypeArg 成本口径;缺省用默认口径(原始成本,能看到当天)。
|
|
7
|
+
* @returns 可直接交给模型的事实对象(全部来自与看板同一套聚合)。
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildCostFacts(cycleArg?: string, accountArg?: string, costTypeArg?: string): Promise<Record<string, unknown>>;
|
|
10
|
+
//# sourceMappingURL=cost-facts.d.ts.map
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ToolDefinition } from '@deepseek-ai/dsh-tools';
|
|
2
|
+
/** 创建工具定义。 */
|
|
3
|
+
export declare function createCostFactsTool(): ToolDefinition;
|
|
4
|
+
/**
|
|
5
|
+
* 创建「配置审计事实」工具。
|
|
6
|
+
*
|
|
7
|
+
* 为什么也要走工具、不让模型自己说:面板上的数字与 Agent 说话用的数字必须是同一份。
|
|
8
|
+
* 工具返回的就是 /api/wb/config/* 背后的同一套聚合,所以它能引用的只有这些数 ——
|
|
9
|
+
* 编不出"大约三百个资源"这种估算。
|
|
10
|
+
*
|
|
11
|
+
* 三个参数刻意做得很小:
|
|
12
|
+
* · account —— 看板上选中的账号原样传入(缺省是组织视角);
|
|
13
|
+
* · include_compliance —— 合规明细(账号视角)或组织级合规汇总(组织视角,逐账号 assume,约 1–2 秒);
|
|
14
|
+
* · include_changes —— 变更事件流(回看最近 20 个资源的历史,约 1 秒)。
|
|
15
|
+
* 默认不取后两者:不是所有问题都需要它们,而它们都要额外打十几次接口。
|
|
16
|
+
*/
|
|
17
|
+
export declare function createConfigFactsTool(): ToolDefinition;
|
|
18
|
+
//# sourceMappingURL=register.d.ts.map
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workbench-wide 临时约定(第一版口径)——前后端共用的唯一出处。
|
|
3
|
+
*
|
|
4
|
+
* 这里收口的是"现在先这么定、以后大概率会调"的约定。每条都写明:
|
|
5
|
+
* 约定是什么、当前选了哪个值、为什么。改动约定只改这一个文件,
|
|
6
|
+
* 不允许把魔法值散落进页面或路由代码。
|
|
7
|
+
*
|
|
8
|
+
* 纯常量模块:零 import,host(Node)与 client(浏览器 bundle)共用。
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/wb-conventions
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* 云上资源清单从哪来。
|
|
14
|
+
*
|
|
15
|
+
* 当前选择 `aggregator`(RMS 资源聚合器 RMS_test,id
|
|
16
|
+
* 98fc97389bc04bafa4dddb96dea180f0):用户拍板纳管率分母用组织口径(2026-11-04),
|
|
17
|
+
* 不接受逐账号 AK/SK 或 all-resources 直查路线。实测 4 个贡献账号共 740 条
|
|
18
|
+
* (IaC_team 336 / EquipDept_team 251 / AiDevSpace_team 117 / ProdService_mng 36)。
|
|
19
|
+
* 限制:聚合数据无 tags/properties——闲置/归属 tab 在此模式下受限(明细仍由
|
|
20
|
+
* 直查接口提供);主账号自身资源不在分母(主账号未开记录器)。
|
|
21
|
+
*
|
|
22
|
+
* 2026-11-11(子账号登录模式,doc/SUBACCOUNT-PER-SERVICE-COLLECT.md):通道改为
|
|
23
|
+
* **运行时探测**——聚合器查询通 → 组织聚合;401/403(成员凭据)→ 逐服务采集
|
|
24
|
+
* (per-service.ts,拍板①;RMS 直查 list-all-resources 依赖资源记录器,已证伪
|
|
25
|
+
* 弃用)。下面的旧常量仅供无调用方的存量分支引用,新代码一律走
|
|
26
|
+
* inventory.ts 的 resolveChannel()。
|
|
27
|
+
*/
|
|
28
|
+
export declare const RMS_AGGREGATOR_ID = "98fc97389bc04bafa4dddb96dea180f0";
|
|
29
|
+
/** 旧通道选择(编译期);存量路径(fetchTypeCounts/明细工具路由)仍读它,
|
|
30
|
+
* 同步主链路与页面已改走运行时探测(resolveChannel)。 */
|
|
31
|
+
export declare const RMS_DATA_SOURCE: {
|
|
32
|
+
readonly kind: 'list-all-resources';
|
|
33
|
+
} | {
|
|
34
|
+
readonly kind: 'aggregator';
|
|
35
|
+
readonly aggregatorId: string;
|
|
36
|
+
};
|
|
37
|
+
/** RMS 全局域名(无区域前缀)。 */
|
|
38
|
+
export declare const RMS_HOST = "rms.myhuaweicloud.com";
|
|
39
|
+
/** IAM 校验路由区域。IAM 是全局服务,区域只影响路由不影响结果。 */
|
|
40
|
+
export declare const IAM_ROUTE_REGION = "cn-north-4";
|
|
41
|
+
/** RMS ListAllResources 分页大小(API 上限 200)。 */
|
|
42
|
+
export declare const RMS_PAGE_LIMIT = 200;
|
|
43
|
+
/** RMS 分页页数上限(50 × 200 = 1 万条,第一版口径)。 */
|
|
44
|
+
export declare const RMS_MAX_PAGES = 50;
|
|
45
|
+
/**
|
|
46
|
+
* 归属标签候选 key,按优先级排列;页面默认选第一个在数据里命中的。
|
|
47
|
+
* 命中不到时页面允许从数据里实际出现的 tag key 中自选。
|
|
48
|
+
*/
|
|
49
|
+
export declare const OWNER_TAG_KEYS: readonly string[];
|
|
50
|
+
/**
|
|
51
|
+
* 闲置判定第一版口径:EIP 未绑定(绑定目标字段为空/缺失即"无主")。
|
|
52
|
+
* 扩展其他类型(未挂载云盘、闲置安全组等)时在这里加规则。
|
|
53
|
+
*
|
|
54
|
+
* 字段映射说明:RMS publicips 的 properties 里绑定目标放在
|
|
55
|
+
* `associateInstanceId`(associateInstanceType=PORT 时指向网卡端口;未绑定时
|
|
56
|
+
* 空或缺失)——**没有**顶层 `port_id` 字段(那是 VPC API 的叫法),别改回去。
|
|
57
|
+
*/
|
|
58
|
+
export declare const IDLE_RULES: readonly {
|
|
59
|
+
readonly provider: string;
|
|
60
|
+
readonly type: string;
|
|
61
|
+
/** properties 里表示"绑定目标"的字段,为空/缺失即视为闲置。 */
|
|
62
|
+
readonly boundField: string;
|
|
63
|
+
readonly label: string;
|
|
64
|
+
}[];
|
|
65
|
+
/** RMS ep_id 的"未归集企业项目"哨兵值:RMS 返回字符串,'0'/'' = 未归集。 */
|
|
66
|
+
export declare const EP_ID_NONE = "0";
|
|
67
|
+
/**
|
|
68
|
+
* ep_id 归一化(入库前唯一出口):非字符串/空串/垃圾值一律按 '0' 未归集。
|
|
69
|
+
* 垃圾值实测来源:RMS 记录器对个别资源(如 CCE 自动创建的 lts.topics)会把
|
|
70
|
+
* 缺失的 ep 记成字符串 "undefined"(2026-11-12 动态 diff 实测 4 行)。
|
|
71
|
+
*/
|
|
72
|
+
export declare function normalizeEpId(raw: unknown): string;
|
|
73
|
+
/**
|
|
74
|
+
* 归集率分母豁免的全局/账号级服务(评审决策③):这些 provider 没有企业项目
|
|
75
|
+
* 概念,ep_id 恒为 '0',计入分母会永久拉低归集率。粒度先按 provider 级,
|
|
76
|
+
* 实测发现同一 provider 下部分 type 支持 EP 时再细化为 provider.type 清单。
|
|
77
|
+
*/
|
|
78
|
+
export declare const EP_EXEMPT_PROVIDERS: readonly string[];
|
|
79
|
+
/** SQLite 库文件落点(相对 cwd):与 plan-* 目录同根,便于备份迁移。 */
|
|
80
|
+
export declare const WORKBENCH_DB_REL: readonly [".dsh", "landing-zone", "workbench.db"];
|
|
81
|
+
/** 趋势图窗口(天)。 */
|
|
82
|
+
export declare const TREND_DAYS = 30;
|
|
83
|
+
/**
|
|
84
|
+
* 指标目标线缺省值(纳管率 80% / 归集率 60%,设计 §3.1)。
|
|
85
|
+
* 用户可在资源页「配置项」弹层里改,持久化在 platform_config
|
|
86
|
+
* (db.getMetricTargets);这两个常量只是库内未配置时的回退。
|
|
87
|
+
*/
|
|
88
|
+
export declare const DEFAULT_COVERAGE_TARGET_PERCENT = 80;
|
|
89
|
+
export declare const DEFAULT_EP_TARGET_PERCENT = 60;
|
|
90
|
+
/**
|
|
91
|
+
* 委托名:各子账号在 IAM 创建的同名委托,授权治理账号只读其资源清单
|
|
92
|
+
* (归集率的子账号数据源;未建委托的账号不计入归集率分母)。
|
|
93
|
+
* 子账号侧建委托时:委托方=子账号,被委托方=治理主账号 domain,
|
|
94
|
+
* 权限给 RMS 只读(RMS ReadOnlyAccess)。
|
|
95
|
+
*/
|
|
96
|
+
export declare const AGENCY_NAME = "lz-resource-collect";
|
|
97
|
+
/**
|
|
98
|
+
* 委托回退名:Organizations 为「组织内创建」的账号**自动创建**的委托,信任
|
|
99
|
+
* 企业主账号——绝大多数成员账号天然存在(邀请加入/手工创建的账号没有)。
|
|
100
|
+
* 2026-11-23 实测(AiAgents):该委托可 assume 且授权范围含 EPS 列表只读;
|
|
101
|
+
* 「lz-resource-collect 按指南建好」的账号为零(委托配置指南发出后无人配置,
|
|
102
|
+
* can't find assumeToDomainName),故 assume 失败回退到它才是现实可用的链路。
|
|
103
|
+
*/
|
|
104
|
+
export declare const AGENCY_FALLBACK_NAME = "OrganizationAccountAccessAgency";
|
|
105
|
+
/** 委托临时凭据有效期(秒,API 限 15min~24h)。 */
|
|
106
|
+
export declare const AGENCY_STS_DURATION_SECONDS = 3600;
|
|
107
|
+
/** rank 指标取值约束(排序键白名单,路由层校验用)。 */
|
|
108
|
+
export declare const RANK_METRICS: readonly ['total', 'coverage', 'ep_rate'];
|
|
109
|
+
/**
|
|
110
|
+
* tfstate 落点契约:与 aishell-deploy 对齐——每个部署工作区一个
|
|
111
|
+
* `terraform.tfstate`(工作区由 .deployment.json 标识)。landing-zone 插件
|
|
112
|
+
* 的 iac 阶段产物也按此识别。
|
|
113
|
+
*/
|
|
114
|
+
export declare const TFSTATE_FILE_NAMES: readonly string[];
|
|
115
|
+
/** 除 terraform.tfstate 外也接受的后缀。 */
|
|
116
|
+
export declare const TFSTATE_SUFFIXES: readonly string[];
|
|
117
|
+
/** 扫描时跳过的目录名(构建产物 / VCS / terraform 插件缓存)。 */
|
|
118
|
+
export declare const TFSTATE_SKIP_DIRS: readonly string[];
|
|
119
|
+
/** 允许进入的隐藏目录(.dsh 下是 landing-zone 的 plan-* 工作区)。 */
|
|
120
|
+
export declare const TFSTATE_ALLOWED_HIDDEN_DIR = ".dsh";
|
|
121
|
+
/** 扫描深度上限与文件数上限,防止大工作区拖垮路由。 */
|
|
122
|
+
export declare const TFSTATE_MAX_DEPTH = 6;
|
|
123
|
+
export declare const TFSTATE_MAX_FILES = 200;
|
|
124
|
+
/**
|
|
125
|
+
* terraform 资源类型 → RMS (provider, type) 映射。
|
|
126
|
+
*
|
|
127
|
+
* 纳管率分子反查按此映射调用 `GET all-resources?type=provider.type`(小名单),
|
|
128
|
+
* 不拉全量。RMS 的 type 全集见 ListProviders;Flexus 轻量实例归 hcss/l-instance
|
|
129
|
+
* (底层 Nova 实例不进 ecs/cloudservers)。映射缺失的类型在页面上标"未映射"。
|
|
130
|
+
* 新资源类型在此补一行。
|
|
131
|
+
*/
|
|
132
|
+
export declare const TF_TO_RMS_TYPE: Readonly<Record<string, {
|
|
133
|
+
readonly provider: string;
|
|
134
|
+
readonly type: string;
|
|
135
|
+
}>>;
|
|
136
|
+
/** 页面展示用的数据源标签(跟随 RMS_DATA_SOURCE 变化)。 */
|
|
137
|
+
export declare function rmsSourceLabel(): string;
|
|
138
|
+
/** 云服务 provider → 中文名称(展示用;未收录的显示 provider 原名)。 */
|
|
139
|
+
export declare const PROVIDER_NAMES: Readonly<Record<string, string>>;
|
|
140
|
+
//# sourceMappingURL=wb-conventions.d.ts.map
|