@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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 嵌入会话区域 — 自绘消息列表(含流式+工具调用) + composer。
|
|
3
|
+
*
|
|
4
|
+
* 用 sessions.retain(sessionId) 拿 binding,从 eventSource 读消息渲染,
|
|
5
|
+
* 用 session.prompt 发消息。支持流式输出(transient chunk)和工具调用展示。
|
|
6
|
+
*
|
|
7
|
+
* @module @huaweidevtools/landingzone-workbench/client/ChatEmbed
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
type AnyBinding = {
|
|
11
|
+
readonly session: {
|
|
12
|
+
prompt(content: Array<{
|
|
13
|
+
type: string;
|
|
14
|
+
text: string;
|
|
15
|
+
}>, mode: string): Promise<unknown>;
|
|
16
|
+
};
|
|
17
|
+
readonly eventSource: {
|
|
18
|
+
getSnapshot(): {
|
|
19
|
+
entries: readonly unknown[];
|
|
20
|
+
};
|
|
21
|
+
subscribe(listener: () => void): () => void;
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
type AnySessions = {
|
|
25
|
+
retain(target: string | {
|
|
26
|
+
sessionId: string;
|
|
27
|
+
}, options: {
|
|
28
|
+
source: string;
|
|
29
|
+
}): {
|
|
30
|
+
readonly ready: Promise<AnyBinding>;
|
|
31
|
+
readonly release: () => void;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
/** 嵌入会话:消息列表 + composer。 */
|
|
35
|
+
export declare function ChatEmbed(props: {
|
|
36
|
+
sessions: AnySessions;
|
|
37
|
+
sessionId: string;
|
|
38
|
+
}): ReactNode;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=ChatEmbed.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Chat tab — 左侧 chat 聊天窗口 + 右侧进展树(接真实 panel-state)。
|
|
3
|
+
*
|
|
4
|
+
* 进展树数据来源:
|
|
5
|
+
* - host 的 /api/wb/panel-state?planDir= (读 landing-zone 工具写的 panel-state.json)
|
|
6
|
+
* - SSE /api/wb/events (agent 调 landing_zone_* 后 broadcast,client 自动刷新)
|
|
7
|
+
*
|
|
8
|
+
* 参考 aishell-landing-zone 的 LandingZonePanel 数据流:
|
|
9
|
+
* fetch panel-state → setState → 进展树渲染
|
|
10
|
+
* SSE 收到 → refresh → 重新 fetch
|
|
11
|
+
*
|
|
12
|
+
* @module @huaweidevtools/landingzone-workbench/client/ChatTab
|
|
13
|
+
*/
|
|
14
|
+
import { type ReactNode } from 'react';
|
|
15
|
+
/** Chat 模式 tab 内容:左 chat + 右进展树。 */
|
|
16
|
+
export declare function ChatTab(): ReactNode;
|
|
17
|
+
//# sourceMappingURL=ChatTab.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Form tab — 可交互表单(模块选择 + 每个模块的详情配置) + 进展树。
|
|
3
|
+
*
|
|
4
|
+
* 每个模块行下方直接展示该模块的配置字段(可编辑),值从 module-detail.json
|
|
5
|
+
* 的 params 读取,编辑后写回。chat 里 agent 确认的配置也同步显示。
|
|
6
|
+
*
|
|
7
|
+
* @module @huaweidevtools/landingzone-workbench/client/FormTab
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
/** Form 模式 tab 内容。 */
|
|
11
|
+
export declare function FormTab(): ReactNode;
|
|
12
|
+
//# sourceMappingURL=FormTab.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FormTabV2 — 引擎 formView 驱动的表单渲染器(M0,替换 FormTab 的旧协议版)。
|
|
3
|
+
*
|
|
4
|
+
* 设计依据 src/doc/05-concrete-spec.md / 12 篇 T4 定稿:
|
|
5
|
+
* - 字段 schema 全来自 formView(蓝图 sections/fields 驱动)——客户端零业务知识(删旧 MODULES 硬编码)
|
|
6
|
+
* - 双向自动同步:面板 POST → 引擎 → SSE → chat 下轮读到;chat 提交 → SSE → 本组件刷新显示
|
|
7
|
+
* - 确认走 confirmSections;acceptRecommended 一键推荐
|
|
8
|
+
* - 会话 gone 时本 tab 仍可用(引擎独立于会话,12 篇 T5/G5)
|
|
9
|
+
*
|
|
10
|
+
* @module @huaweidevtools/landingzone-workbench/client/FormTabV2
|
|
11
|
+
*/
|
|
12
|
+
import { type ReactNode } from 'react';
|
|
13
|
+
export declare function FormTabV2(): ReactNode;
|
|
14
|
+
//# sourceMappingURL=FormTabV2.d.ts.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 进展树视图 — 三阶段可切换 + 可展开折叠的树。
|
|
3
|
+
*
|
|
4
|
+
* 参考 aishell-landing-zone 的 ProgressTree / TreeNodeView / StageCard。
|
|
5
|
+
* 右侧面板:上方阶段切换按钮,下方当前阶段的树。
|
|
6
|
+
*
|
|
7
|
+
* @module @huaweidevtools/landingzone-workbench/client/ProgressTreeView
|
|
8
|
+
*/
|
|
9
|
+
import { type ReactNode } from 'react';
|
|
10
|
+
import { type ProgressTree } from './progress-types.ts';
|
|
11
|
+
/** 进展树面板:阶段切换 + 当前阶段树。 */
|
|
12
|
+
export declare function ProgressTreeView({ tree }: {
|
|
13
|
+
tree: ProgressTree;
|
|
14
|
+
}): ReactNode;
|
|
15
|
+
//# sourceMappingURL=ProgressTreeView.d.ts.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Landing Zone 工作台 — 一层流程图:规划 → 骨架搭建 → 基础设施搭建。
|
|
3
|
+
*
|
|
4
|
+
* 参考 aishell-landing-zone 的 StageCard 演示逻辑(3 大阶段进度条),
|
|
5
|
+
* 简化为横向单层流程图。每个阶段卡片显示标题、状态图标(与标题同行)。
|
|
6
|
+
* 当前为骨架演示态,状态均为"待开始"(⏳)。
|
|
7
|
+
*
|
|
8
|
+
* 后续接入真实 panel-state 后,状态随 landing_zone_plan/run 工具执行流转:
|
|
9
|
+
* pending ⏳ → in-progress 🔄 → done ✅ / failed ❌
|
|
10
|
+
*
|
|
11
|
+
* @module @huaweidevtools/landingzone-workbench/client/StageFlow
|
|
12
|
+
*/
|
|
13
|
+
import { type ReactNode } from 'react';
|
|
14
|
+
/** 横向一层流程图:规划 → 骨架搭建 → 基础设施搭建。 */
|
|
15
|
+
export declare function StageFlow(): ReactNode;
|
|
16
|
+
//# sourceMappingURL=StageFlow.d.ts.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 初始搭建详情页 — 流程图 + Chat/Form tab。
|
|
3
|
+
*
|
|
4
|
+
* 从 AccountView 搬来(去掉叶头,叶头由 WorkbenchShell 统一管)。
|
|
5
|
+
*
|
|
6
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/SetupPage
|
|
7
|
+
*/
|
|
8
|
+
import { type ReactNode } from 'react';
|
|
9
|
+
export declare function SetupPage(): ReactNode;
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 进展树类型 + 三阶段树数据。
|
|
3
|
+
*
|
|
4
|
+
* 参考 aishell-landing-zone 的 panel-state.ts / api.ts 的 TreeNode 结构,
|
|
5
|
+
* 保持兼容(同样的 id/label/status/detail/children)。
|
|
6
|
+
*
|
|
7
|
+
* 三阶段:
|
|
8
|
+
* planning — 规划阶段(资质检查 → 选区域 → 选方向 → 模块多选 → 逐项确认 → 出方案 → 验证 → 审批)
|
|
9
|
+
* direct — 治理层搭建(组织/OU/账号/SCP/CTS 等治理元数据直建)
|
|
10
|
+
* iac — 基础设施层搭建(网络/身份中心/合规基线 IaC 引导)
|
|
11
|
+
*
|
|
12
|
+
* @module @huaweidevtools/landingzone-workbench/client/progress-types
|
|
13
|
+
*/
|
|
14
|
+
/** 树节点状态。 */
|
|
15
|
+
export type NodeStatus = 'pending' | 'in-progress' | 'done' | 'failed' | 'skipped' | 'blocked';
|
|
16
|
+
/** 进展树节点。 */
|
|
17
|
+
export interface TreeNode {
|
|
18
|
+
readonly id: string;
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly status: NodeStatus;
|
|
21
|
+
readonly detail?: string;
|
|
22
|
+
readonly children?: TreeNode[];
|
|
23
|
+
}
|
|
24
|
+
/** 三阶段完整树。 */
|
|
25
|
+
export interface ProgressTree {
|
|
26
|
+
readonly planning: TreeNode;
|
|
27
|
+
readonly direct: TreeNode;
|
|
28
|
+
readonly iac: TreeNode;
|
|
29
|
+
}
|
|
30
|
+
/** 阶段 id。 */
|
|
31
|
+
export type StageId = 'planning' | 'direct' | 'iac';
|
|
32
|
+
/** 状态 → emoji 图标。 */
|
|
33
|
+
export declare const STATUS_ICON: Record<NodeStatus, string>;
|
|
34
|
+
/** 构建初始三阶段树(全 pending 占位)。 */
|
|
35
|
+
export declare function initialProgressTree(): ProgressTree;
|
|
36
|
+
//# sourceMappingURL=progress-types.d.ts.map
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 会话 binding — 从 eventSource 提取消息 + 流式 chunk + 工具调用。
|
|
3
|
+
*
|
|
4
|
+
* 工具调用关联到触发它的 assistant 消息(不是全堆到最后一条):
|
|
5
|
+
* assistant 消息 → tool/call(pending) → tool/result(done)
|
|
6
|
+
* 工具调用附加到它前面最近的 assistant 消息。
|
|
7
|
+
*
|
|
8
|
+
* @module @huaweidevtools/landingzone-workbench/client/session-binding
|
|
9
|
+
*/
|
|
10
|
+
/** 一条渲染用消息。 */
|
|
11
|
+
export interface ChatMessage {
|
|
12
|
+
readonly id: string;
|
|
13
|
+
readonly role: 'user' | 'assistant';
|
|
14
|
+
readonly text: string;
|
|
15
|
+
readonly toolCalls?: ToolCall[];
|
|
16
|
+
readonly streaming?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/** 工具调用。 */
|
|
19
|
+
export interface ToolCall {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly status: 'pending' | 'done' | 'error';
|
|
22
|
+
readonly result?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* 判断一段 user 文本是不是注入内容。
|
|
26
|
+
*
|
|
27
|
+
* 只有"以注入标记开头"才算 —— 用户自己在对话里引用这些标记(例如问我
|
|
28
|
+
* "system-reminder 是什么")时,正常气泡仍然要显示。
|
|
29
|
+
*/
|
|
30
|
+
export declare function isInjectedUserText(text: string): boolean;
|
|
31
|
+
/** 从 eventSource 快照提取聊天消息。 */
|
|
32
|
+
export declare function extractMessages(entries: readonly unknown[]): {
|
|
33
|
+
messages: ChatMessage[];
|
|
34
|
+
streaming: boolean;
|
|
35
|
+
/** 被折叠掉的运行时上下文注入条数。 */
|
|
36
|
+
contextNotes: number;
|
|
37
|
+
};
|
|
38
|
+
//# sourceMappingURL=session-binding.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作台会话状态机 + 生命周期管理。
|
|
3
|
+
*
|
|
4
|
+
* 三态:
|
|
5
|
+
* empty — 无会话,Chat tab 显示空态 + 开始规划按钮
|
|
6
|
+
* active — 已绑定会话,Chat tab 渲染 DSH Conversation 子座位
|
|
7
|
+
* gone — 会话失效,显示提示 + 重新规划
|
|
8
|
+
*
|
|
9
|
+
* 关联键:sessionId(1:1 绑 plan-{ts},方案 B)。
|
|
10
|
+
* 默认打开最新会话;【重新规划】显式新建;不支持来回切换。
|
|
11
|
+
*
|
|
12
|
+
* session scope 绑定:active 态用 sessions.retain(sessionId, {source:'mainView'})
|
|
13
|
+
* 把会话绑到主视图 session scope,这样 DSH Conversation 的 session-maybe slot
|
|
14
|
+
* 能拿到 session hooks(useSession/useConversation),渲染完整聊天 UI。
|
|
15
|
+
* 不调 selectPanel(null)——面板停留在 workbench,不切回 conversation。
|
|
16
|
+
*
|
|
17
|
+
* @module @huaweidevtools/landingzone-workbench/client/session-store
|
|
18
|
+
*/
|
|
19
|
+
import { type SnapshotStore } from '@deepseek-ai/dsh-client-store';
|
|
20
|
+
/** 会话三态。 */
|
|
21
|
+
export type SessionPhase = 'empty' | 'active' | 'gone';
|
|
22
|
+
/** 工作台会话状态。 */
|
|
23
|
+
export interface WorkbenchSessionState {
|
|
24
|
+
readonly phase: SessionPhase;
|
|
25
|
+
readonly sessionId: string | null;
|
|
26
|
+
readonly planDir: string | null;
|
|
27
|
+
readonly creating: boolean;
|
|
28
|
+
readonly error: string | null;
|
|
29
|
+
}
|
|
30
|
+
export declare const sessionStore: SnapshotStore<WorkbenchSessionState>;
|
|
31
|
+
/**
|
|
32
|
+
* 向当前工作台会话发一条消息(不新建连接、不直接调模型,走 session.prompt)。
|
|
33
|
+
*
|
|
34
|
+
* @param text 要发送的内容。
|
|
35
|
+
* @returns 是否已投递;没有活动会话时为 false。
|
|
36
|
+
*/
|
|
37
|
+
export declare function promptActiveSession(text: string): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* 读当前会话的事件条目(不新建绑定、不渲染)。
|
|
40
|
+
*
|
|
41
|
+
* 为什么用事件流而不是解析 UI:费用页的"生成建议"只需要把模型最后那段回答
|
|
42
|
+
* 原文取出来存档,CAT 的 DOM 与消息列表都不是稳定接口,事件流才是。
|
|
43
|
+
*
|
|
44
|
+
* @returns 事件条目数组;没有活动会话时 null。
|
|
45
|
+
*/
|
|
46
|
+
export declare function readActiveEntries(): Promise<readonly unknown[] | null>;
|
|
47
|
+
/**
|
|
48
|
+
* 进入工作台时调:读最新会话,有则 retain + active。
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadLatestSession(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* 重新规划:建新会话 + 建 planDir + 绑 mainView。
|
|
53
|
+
*/
|
|
54
|
+
export declare function createNewSession(_prompt?: string): Promise<void>;
|
|
55
|
+
/** 标记会话失效。 */
|
|
56
|
+
export declare function markGone(reason?: string): void;
|
|
57
|
+
//# sourceMappingURL=session-store.d.ts.map
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare function setSessionsService(s: unknown): void;
|
|
2
|
+
export declare function getSessionsService(): unknown;
|
|
3
|
+
export declare function setUiSessionService(s: unknown): void;
|
|
4
|
+
export declare function getUiSessionService(): unknown;
|
|
5
|
+
//# sourceMappingURL=sessions-ref.d.ts.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 「开始搭建 / 重新规划」共用 hook —— 页面级操作(SetupPage 右上角按钮)。
|
|
3
|
+
*
|
|
4
|
+
* 语义(用户定稿):不碰任何历史 —— createNewSession(新会话+新方案目录)→ 绑定 →
|
|
5
|
+
* 初始形态展示在当前工作台;历史会话自然沉淀在侧栏「Landing Zone 搭建」分组。
|
|
6
|
+
* 文案随状态:无方案=「+ 开始搭建」/ 有方案=「↺ 重新规划」。
|
|
7
|
+
*
|
|
8
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/SetupPage/setup-replan
|
|
9
|
+
*/
|
|
10
|
+
import { type ReactNode } from 'react';
|
|
11
|
+
/** 重新规划/开始搭建按钮(右上角)。返回按钮元素(含 busy 态与错误提示)。 */
|
|
12
|
+
export declare function useReplanButton(): ReactNode;
|
|
13
|
+
//# sourceMappingURL=setup-replan.d.ts.map
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工作台 panel-state API — fetch host 读进展树数据 + 订阅 SSE 刷新。
|
|
3
|
+
*
|
|
4
|
+
* 参考 aishell-landing-zone 的 api.ts + index.ts SSE 订阅模式。
|
|
5
|
+
* 数据来源:planDir/panel-state.json(由 aishell-landing-zone 的工具写入)。
|
|
6
|
+
*
|
|
7
|
+
* @module @huaweidevtools/landingzone-workbench/client/wb-api
|
|
8
|
+
*/
|
|
9
|
+
/** 进展树节点(和 landing-zone 的 TreeNode 兼容)。 */
|
|
10
|
+
export interface TreeNode {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly status: 'pending' | 'in-progress' | 'done' | 'failed' | 'skipped' | 'blocked';
|
|
14
|
+
readonly detail?: string;
|
|
15
|
+
readonly children?: TreeNode[];
|
|
16
|
+
}
|
|
17
|
+
/** panel-state 完整状态(和 landing-zone 的 PanelState 兼容)。 */
|
|
18
|
+
export interface PanelState {
|
|
19
|
+
readonly planState: string;
|
|
20
|
+
readonly planDir?: string;
|
|
21
|
+
readonly stages: {
|
|
22
|
+
readonly planning: 'pending' | 'in-progress' | 'done';
|
|
23
|
+
readonly direct: 'pending' | 'in-progress' | 'done';
|
|
24
|
+
readonly iac: 'pending' | 'in-progress' | 'done';
|
|
25
|
+
};
|
|
26
|
+
readonly tree: TreeNode[];
|
|
27
|
+
readonly updatedAt: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function fetchPanelState(planDir?: string): Promise<PanelState>;
|
|
30
|
+
export declare function getLastSsePlanDir(): string | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* 订阅 landing-zone 的 SSE 事件流(/api/landing-zone/events)。
|
|
33
|
+
*
|
|
34
|
+
* landing-zone 的 host 在 landing_zone_check/plan/run 执行后往
|
|
35
|
+
* /api/landing-zone/events 推 SSE 事件。工作台订阅它(不是自己的 /api/wb/events),
|
|
36
|
+
* 收到后刷新进展树。
|
|
37
|
+
*
|
|
38
|
+
* @returns 清理函数(关 EventSource)
|
|
39
|
+
*/
|
|
40
|
+
export declare function subscribeSse(onRefresh: (frame?: {
|
|
41
|
+
tool?: string;
|
|
42
|
+
planDir?: string;
|
|
43
|
+
}) => void): () => void;
|
|
44
|
+
/** requirements.json 的结构。 */
|
|
45
|
+
export interface Requirements {
|
|
46
|
+
readonly regions: string;
|
|
47
|
+
readonly direction: string;
|
|
48
|
+
readonly moduleSelection: {
|
|
49
|
+
readonly enhanced: readonly string[];
|
|
50
|
+
readonly extended: readonly string[];
|
|
51
|
+
};
|
|
52
|
+
readonly moduleDetailConfirmedModules: readonly string[];
|
|
53
|
+
readonly moduleDetailParams: Record<string, unknown>;
|
|
54
|
+
}
|
|
55
|
+
/** module-detail.json 的结构。 */
|
|
56
|
+
export interface ModuleDetail {
|
|
57
|
+
readonly sequence: readonly string[];
|
|
58
|
+
readonly confirmedModules: readonly string[];
|
|
59
|
+
readonly confirmedCount: number;
|
|
60
|
+
readonly params: Record<string, unknown>;
|
|
61
|
+
readonly pendingReconfirm: readonly string[];
|
|
62
|
+
}
|
|
63
|
+
/** 读 requirements.json。 */
|
|
64
|
+
export declare function fetchRequirements(planDir: string): Promise<Requirements>;
|
|
65
|
+
/** 写 requirements.json(合并 patch + broadcast SSE)。 */
|
|
66
|
+
export declare function saveRequirements(planDir: string, patch: Record<string, unknown>): Promise<Requirements | null>;
|
|
67
|
+
/** 读 module-detail.json。 */
|
|
68
|
+
export declare function fetchModuleDetail(planDir: string): Promise<ModuleDetail | undefined>;
|
|
69
|
+
/** 从 landing-zone 的 active-plan 路由获取最新活跃方案的 planDir。
|
|
70
|
+
* landing-zone 扫描所有 plan-* 目录,返回未归档且 mtime 最新的。
|
|
71
|
+
* FormTab 挂载时调这个(不等 SSE),拿到正确 planDir 后再 fetch requirements/module-detail。
|
|
72
|
+
*/
|
|
73
|
+
export declare function fetchActivePlanDir(): Promise<string | undefined>;
|
|
74
|
+
export interface FormViewField {
|
|
75
|
+
readonly path: string;
|
|
76
|
+
readonly label: string;
|
|
77
|
+
readonly type: 'enum' | 'string' | 'boolean' | 'number' | 'object-map' | 'array' | 'policy-refs';
|
|
78
|
+
readonly value: unknown;
|
|
79
|
+
readonly source: 'blueprint' | 'user' | 'missing';
|
|
80
|
+
readonly required: boolean;
|
|
81
|
+
readonly recommendBadge: boolean;
|
|
82
|
+
readonly options?: ReadonlyArray<{
|
|
83
|
+
value: string;
|
|
84
|
+
label: string;
|
|
85
|
+
recommend?: boolean;
|
|
86
|
+
}>;
|
|
87
|
+
readonly monthlyCost?: number;
|
|
88
|
+
readonly invalidReason?: string;
|
|
89
|
+
readonly note?: string;
|
|
90
|
+
}
|
|
91
|
+
export interface FormViewSection {
|
|
92
|
+
readonly id: string;
|
|
93
|
+
readonly label: string;
|
|
94
|
+
readonly revealed: boolean;
|
|
95
|
+
/** 揭示规则:'always'=默认模块(预勾不可关);modules.<layer> contains <id>=可选模块 */
|
|
96
|
+
readonly revealedBy?: string;
|
|
97
|
+
readonly confirmed: boolean;
|
|
98
|
+
readonly fields: readonly FormViewField[];
|
|
99
|
+
}
|
|
100
|
+
export interface FormView {
|
|
101
|
+
readonly blueprint: {
|
|
102
|
+
readonly id: string;
|
|
103
|
+
readonly label: string;
|
|
104
|
+
readonly desc: string;
|
|
105
|
+
};
|
|
106
|
+
readonly sections: readonly FormViewSection[];
|
|
107
|
+
readonly progress: {
|
|
108
|
+
readonly done: number;
|
|
109
|
+
readonly total: number;
|
|
110
|
+
readonly missing: readonly string[];
|
|
111
|
+
};
|
|
112
|
+
readonly nextSection: string | null;
|
|
113
|
+
}
|
|
114
|
+
export interface SetupFormState {
|
|
115
|
+
readonly schemaVersion: number;
|
|
116
|
+
readonly blueprintId: string;
|
|
117
|
+
readonly region: string;
|
|
118
|
+
readonly version: number;
|
|
119
|
+
readonly modules: {
|
|
120
|
+
readonly enhanced: readonly string[];
|
|
121
|
+
readonly extended: readonly string[];
|
|
122
|
+
};
|
|
123
|
+
readonly filled: Record<string, unknown>;
|
|
124
|
+
readonly source: Record<string, string>;
|
|
125
|
+
readonly confirmed: {
|
|
126
|
+
readonly sections: readonly string[];
|
|
127
|
+
allConfirmed: boolean;
|
|
128
|
+
};
|
|
129
|
+
readonly buildPlan: {
|
|
130
|
+
governance: 'api' | 'terraform';
|
|
131
|
+
infra: 'api' | 'terraform';
|
|
132
|
+
} | null;
|
|
133
|
+
readonly budgetCeiling: number | null;
|
|
134
|
+
readonly approvalStatus: 'none' | 'architecture_confirmed' | 'approved' | 'rejected';
|
|
135
|
+
readonly archived: boolean;
|
|
136
|
+
readonly frozenSpecHash: string | null;
|
|
137
|
+
readonly qualificationPassed: boolean;
|
|
138
|
+
readonly modulesConfirmed: boolean;
|
|
139
|
+
readonly discarded: boolean;
|
|
140
|
+
readonly updatedAt: string;
|
|
141
|
+
}
|
|
142
|
+
export interface EngineResult {
|
|
143
|
+
readonly node: string;
|
|
144
|
+
readonly nodeStatus: string;
|
|
145
|
+
readonly form: SetupFormState;
|
|
146
|
+
readonly view: FormView;
|
|
147
|
+
readonly message: string;
|
|
148
|
+
readonly nextAction: string;
|
|
149
|
+
readonly haltReason?: string;
|
|
150
|
+
readonly planDir: string;
|
|
151
|
+
}
|
|
152
|
+
/** GET /api/wb/setup/form(planDir 可选:引擎解析唯一活跃方案) */
|
|
153
|
+
export declare function getSetupForm(planDir?: string): Promise<EngineResult>;
|
|
154
|
+
/** POST /api/wb/setup/form —— 唯一写入口(引擎校验/流转;409 冲突自动 refresh) */
|
|
155
|
+
export declare function postSetupForm(body: {
|
|
156
|
+
planDir?: string;
|
|
157
|
+
patch: Record<string, unknown>;
|
|
158
|
+
expectedVersion: number;
|
|
159
|
+
actor?: 'chat' | 'panel';
|
|
160
|
+
}): Promise<EngineResult>;
|
|
161
|
+
export interface BlueprintCard {
|
|
162
|
+
readonly id: string;
|
|
163
|
+
readonly label: string;
|
|
164
|
+
readonly desc: string;
|
|
165
|
+
readonly suitableFor: readonly string[];
|
|
166
|
+
readonly moduleCounts: {
|
|
167
|
+
readonly base: number;
|
|
168
|
+
readonly enhanced: number;
|
|
169
|
+
readonly extended: number;
|
|
170
|
+
};
|
|
171
|
+
}
|
|
172
|
+
/** SCP 策略目录(宿主端点一次性拉取缓存——编辑器直用) */
|
|
173
|
+
export interface ScpCatalog {
|
|
174
|
+
readonly typeEnable: {
|
|
175
|
+
code: string;
|
|
176
|
+
label: string;
|
|
177
|
+
} | null;
|
|
178
|
+
readonly policies: ReadonlyArray<{
|
|
179
|
+
code: string;
|
|
180
|
+
label: string;
|
|
181
|
+
description?: string;
|
|
182
|
+
content?: unknown;
|
|
183
|
+
attachTargetType?: string;
|
|
184
|
+
}>;
|
|
185
|
+
}
|
|
186
|
+
export declare function getScpCatalog(): Promise<ScpCatalog>;
|
|
187
|
+
export declare function getRegions(): readonly string[];
|
|
188
|
+
export declare function getBlueprints(): Promise<readonly BlueprintCard[]>;
|
|
189
|
+
/** 向会话注入一条表单操作通知(ChatEmbed 同款 retain→prompt;失败静默)。
|
|
190
|
+
* 空文本早退:宿主 hasPromptContent 拒空白,发出去只会静默失败。 */
|
|
191
|
+
export declare function notifySession(sessionId: string, text: string): Promise<void>;
|
|
192
|
+
//# sourceMappingURL=wb-api.d.ts.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 长列表的折叠口径(配置审计与费用页共用,改一处两边一起变)。
|
|
3
|
+
*
|
|
4
|
+
* 为什么要有这个文件:两张卡都是"一条建议 + 一串对象"。对象的规模差别很大 ——
|
|
5
|
+
* 3 个账号、23 个账号、79 台实例。全摊开时,所有建议被一串重复的行推走,
|
|
6
|
+
* 一屏看不到第二条;但一律只给一个数字又逼人反复点开。
|
|
7
|
+
*
|
|
8
|
+
* 所以按规模分档:
|
|
9
|
+
* · ≤ 5 个:全显示(这种规模折叠反而多一次点击);
|
|
10
|
+
* · 6–40 个:先露 3 个,其余点「展开全部 N 个」;
|
|
11
|
+
* · > 40 个:展开后也封顶 40,剩下的用一行"N 个未逐条列出"交代。
|
|
12
|
+
*
|
|
13
|
+
* @module @huaweidevtools/landingzone-workbench/client/pages/list-preview
|
|
14
|
+
*/
|
|
15
|
+
/** 超过这个数量才折叠。 */
|
|
16
|
+
export declare const PREVIEW_THRESHOLD = 5;
|
|
17
|
+
/** 折叠时先露几个。 */
|
|
18
|
+
export declare const PREVIEW_COUNT = 3;
|
|
19
|
+
/** 展开后最多逐条列几个(再多读的人也读不完)。 */
|
|
20
|
+
export declare const MAX_LIST_ROWS = 40;
|
|
21
|
+
/** 算出这次该显示几行、还有几行被藏起来。 */
|
|
22
|
+
export declare function previewRows(total: number, expanded: boolean): {
|
|
23
|
+
shown: number;
|
|
24
|
+
hidden: number;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* 要不要给「展开全部 / 收起」按钮。
|
|
28
|
+
*
|
|
29
|
+
* 不能用"还有几行被藏起来"来判断:展开之后被藏的行数是 0(清单本身不到 40 条时),
|
|
30
|
+
* 按那个条件按钮就会消失 —— 点了「展开全部 8 个」之后再也收不回去,只能收起整条建议。
|
|
31
|
+
* 折叠开关的唯一依据是"这份清单够不够长"。
|
|
32
|
+
*/
|
|
33
|
+
export declare function isCollapsible(total: number): boolean;
|
|
34
|
+
/** 展开 / 收起按钮的文案(两页同一份,措辞不会各说一套)。 */
|
|
35
|
+
export declare function toggleLabel(total: number, expanded: boolean): string;
|
|
36
|
+
//# sourceMappingURL=list-preview.d.ts.map
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client half of the permission-mode switch, shared by both chips.
|
|
3
|
+
*
|
|
4
|
+
* The mode lives in the MCP server process, not in DSH. A Host route relays to
|
|
5
|
+
* it over the plugin's own MCP connection; this module owns the fetch and the
|
|
6
|
+
* state hook so the composer chip and the hero chip cannot drift apart.
|
|
7
|
+
*
|
|
8
|
+
* @module @huaweidevtools/aishell-dsh-client-credentials/client/permission-mode
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Host permission route, written document-relative for the same reason as the
|
|
12
|
+
* credential route: the served index carries `<base href="./">`, so the
|
|
13
|
+
* request lands on the origin that holds the browser session cookie the
|
|
14
|
+
* route's authentication fence requires.
|
|
15
|
+
*/
|
|
16
|
+
export declare const PERMISSION_ROUTE = "api/aishell/permission";
|
|
17
|
+
/** The two modes, as the server spells them. */
|
|
18
|
+
export type PermissionMode = 'read_only' | 'read_write';
|
|
19
|
+
/**
|
|
20
|
+
* Read the current mode from the Host route.
|
|
21
|
+
*
|
|
22
|
+
* @returns the mode, or `undefined` when it could not be read — a broken link
|
|
23
|
+
* must not be rendered as a working lock, so an unreadable mode is
|
|
24
|
+
* reported as unknown, never as `read_only`.
|
|
25
|
+
*/
|
|
26
|
+
export declare function readPermissionMode(): Promise<PermissionMode | undefined>;
|
|
27
|
+
/**
|
|
28
|
+
* Write the mode through the Host route.
|
|
29
|
+
*
|
|
30
|
+
* @param mode - the mode to apply.
|
|
31
|
+
* @returns the mode the server reports afterwards, or `undefined` on failure.
|
|
32
|
+
*/
|
|
33
|
+
export declare function writePermissionMode(mode: PermissionMode): Promise<PermissionMode | undefined>;
|
|
34
|
+
/** State and toggle for a permission-mode control. */
|
|
35
|
+
export interface PermissionModeControl {
|
|
36
|
+
/** Mode in effect, or `undefined` while unknown. */
|
|
37
|
+
readonly mode: PermissionMode | undefined;
|
|
38
|
+
/** True while a write is in flight. */
|
|
39
|
+
readonly busy: boolean;
|
|
40
|
+
/** Flip to the other mode. No-op while unknown or busy. */
|
|
41
|
+
readonly toggle: () => void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Subscribe a control to the permission mode.
|
|
45
|
+
*
|
|
46
|
+
* Reads once on mount. The mode is server state that only a person changes, so
|
|
47
|
+
* there is no poll — a second surface flipping it is not a case this handles;
|
|
48
|
+
* each surface re-reads on its own mount.
|
|
49
|
+
*
|
|
50
|
+
* @returns the current mode, a busy flag, and the toggle.
|
|
51
|
+
*/
|
|
52
|
+
export declare function usePermissionMode(): PermissionModeControl;
|
|
53
|
+
//# sourceMappingURL=permission-mode.d.ts.map
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { CredentialStatus } from './credential-status.ts';
|
|
2
|
+
export declare const credentialsStore: import("@deepseek-ai/dsh-client-store").SnapshotStore<CredentialStatus>;
|
|
3
|
+
/** 登录门禁三态:checking=检测中(首帧未达)/ locked=未登录 / ok=已登录。 */
|
|
4
|
+
export type AuthGateState = 'checking' | 'locked' | 'ok';
|
|
5
|
+
/**
|
|
6
|
+
* 登录门禁 store —— 由 client/index.ts 的 derive() 从 configForms 命名空间喂送。
|
|
7
|
+
*
|
|
8
|
+
* 初始 checking:configForms 首帧到达前不亮「未登录」屏(防已登录用户被闪一下
|
|
9
|
+
* 锁定页);首帧 500ms 仍未到由 apply() 的兜底超时判 locked(宿主没装
|
|
10
|
+
* credentials 插件时命名空间永远不写,这正是真实状态,不能让用户盯永生转圈)。
|
|
11
|
+
* 解锁/回锁由订阅推送实时生效:在会话页面配好凭据的瞬间,开着的工作台当场开门。
|
|
12
|
+
*/
|
|
13
|
+
export declare const authGateStore: import("@deepseek-ai/dsh-client-store").SnapshotStore<AuthGateState>;
|
|
14
|
+
/** 生效主题是否为深色(以 body[data-ds-dark-theme] 为准)。 */
|
|
15
|
+
export declare const themeStore: import("@deepseek-ai/dsh-client-store").SnapshotStore<boolean>;
|
|
16
|
+
/**
|
|
17
|
+
* 订阅生效主题。canvas 侧取色(echarts 文字/网格/系列色是解析后的颜色串,
|
|
18
|
+
* 吃不到 CSS 变量)经 useChartPalette() 间接走这里;纯 CSS 的组件不需要它
|
|
19
|
+
* —— body 上的令牌值会自动随主题翻转。
|
|
20
|
+
*/
|
|
21
|
+
export declare function useDarkTheme(): boolean;
|
|
22
|
+
//# sourceMappingURL=store.d.ts.map
|