@hadooppei/hwcode 1.0.5 → 1.0.7
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.
|
@@ -176,6 +176,7 @@ export async function collectCredentials(vendor: CloudVendorId, root: string, ct
|
|
|
176
176
|
|
|
177
177
|
export function activationPrompt(state: WorkflowState): string {
|
|
178
178
|
const details = cloudDetails(state)!;
|
|
179
|
+
const provider = getCloudProvider(details.vendor);
|
|
179
180
|
const guidance = details.templateGuidance
|
|
180
181
|
? `\n\nReusable template guidance (${details.sourceTemplate?.name ?? "saved template"}):\n${details.templateGuidance}`
|
|
181
182
|
: "";
|
|
@@ -185,7 +186,7 @@ export function activationPrompt(state: WorkflowState): string {
|
|
|
185
186
|
Locked project root: ${state.root}
|
|
186
187
|
Task artifact workspace: ${cloudArtifactDirectory(state)}
|
|
187
188
|
Cloud provider: ${getCloudProvider(details.vendor).label}
|
|
188
|
-
Terraform Runner: ${runner}
|
|
189
|
+
Terraform Runner: ${runner}(Note: Runner is only for Terraform; regular discovery and CLI queries run locally via ${provider.cli})
|
|
189
190
|
Deploy current project: ${details.deployCurrentProject ? "yes" : "no"}
|
|
190
191
|
User objective:\n${details.request}${guidance}
|
|
191
192
|
|
|
@@ -193,17 +194,23 @@ export function activationPrompt(state: WorkflowState): string {
|
|
|
193
194
|
`;
|
|
194
195
|
}
|
|
195
196
|
|
|
197
|
+
let approvalQueue = Promise.resolve();
|
|
196
198
|
export async function approveOperation(operation: CloudOperation, params: { command: string; args: string[]; intent: string }, state: WorkflowState, ctx: ExtensionContext): Promise<"allow" | "allow-session" | "deny"> {
|
|
197
199
|
if (operation === "read") return "allow";
|
|
198
200
|
if (!ctx.hasUI) return "deny";
|
|
199
|
-
const
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
201
|
+
const next = approvalQueue.then(async () => {
|
|
202
|
+
const details = cloudDetails(state)!;
|
|
203
|
+
const command = `${params.command} ${params.args.join(" ")}`;
|
|
204
|
+
if (operation === "delete") return await ctx.ui.confirm("确认删除云资源?", `目标:${params.intent}\n命令:${command}\n\n删除操作始终逐次确认。`) ? "allow" : "deny";
|
|
205
|
+
if (details.allowNonDeleteChanges) return "allow";
|
|
206
|
+
const choice = await ctx.ui.select("允许修改云账号内资源?", ["仅允许本次", "允许本会话后续非删除变更,不再询问", "拒绝"]);
|
|
207
|
+
if (choice === "仅允许本次") return "allow";
|
|
208
|
+
if (choice === "允许本会话后续非删除变更,不再询问") return "allow-session";
|
|
209
|
+
return "deny";
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
approvalQueue = next.then(() => {}, () => {});
|
|
213
|
+
return await next;
|
|
207
214
|
}
|
|
208
215
|
|
|
209
216
|
export function remoteTrustInteraction(ctx: ExtensionContext): RemoteTrustInteraction {
|