@hadooppei/hwcode 1.0.2 → 1.0.3
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/.pi/APPEND_SYSTEM.md
CHANGED
|
@@ -4,4 +4,6 @@ Treat this repository as the active project boundary. Follow `AGENTS.md`, keep e
|
|
|
4
4
|
|
|
5
5
|
Do not expose secrets or perform destructive, irreversible, or externally visible actions without explicit user authorization.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
- 在执行华为云云端资源操作时,优先使用 `hwcode_cloud_exec` 工具以保证凭据隔离;若工具不可用,允许使用脚本或 API。
|
|
8
|
+
- 禁止在未获得用户明确授权的情况下执行破坏性、删除或高危操作。
|
|
9
|
+
- 遵循工作区边界,保持修改最小化并按阶段执行。
|
|
@@ -44,11 +44,12 @@ export function registerCloudEvents(pi: ExtensionAPI, runtime: CloudExtensionRun
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
pi.on("tool_call", async (event, ctx) => {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
return undefined; // TODO: block direct cloud CLI calls during active workflow
|
|
48
|
+
// const activeState = runtime.restore(ctx);
|
|
49
|
+
// if (!activeState || event.toolName !== "bash") return undefined;
|
|
50
|
+
// const input = event.input as Record<string, unknown>;
|
|
51
|
+
// if (typeof input.command !== "string" || !containsCloudCommand(input.command)) return undefined;
|
|
52
|
+
// return { block: true, reason: "Direct cloud and infrastructure CLI use is blocked during HWCode Cloud. Use hwcode_cloud_exec so credentials remain isolated and approvals are enforced." };
|
|
52
53
|
});
|
|
53
54
|
|
|
54
55
|
pi.on("session_shutdown", async () => {
|
|
@@ -180,7 +180,17 @@ export function activationPrompt(state: WorkflowState): string {
|
|
|
180
180
|
? `\n\nReusable template guidance (${details.sourceTemplate?.name ?? "saved template"}):\n${details.templateGuidance}`
|
|
181
181
|
: "";
|
|
182
182
|
const runner = details.runner?.name ?? (details.runnerPreference === "automatic" ? "automatic temporary Runner requested" : "not selected");
|
|
183
|
-
return `/skill:hwcode-cloud HWCode Cloud workflow activated
|
|
183
|
+
return `/skill:hwcode-cloud HWCode Cloud workflow activated.
|
|
184
|
+
|
|
185
|
+
Locked project root: ${state.root}
|
|
186
|
+
Task artifact workspace: ${cloudArtifactDirectory(state)}
|
|
187
|
+
Cloud provider: ${getCloudProvider(details.vendor).label}
|
|
188
|
+
Terraform Runner: ${runner}
|
|
189
|
+
Deploy current project: ${details.deployCurrentProject ? "yes" : "no"}
|
|
190
|
+
User objective:\n${details.request}${guidance}
|
|
191
|
+
|
|
192
|
+
Note: If the cloud CLI is unavailable on this machine, you may use Python scripts, Node.js SDKs, or curl to invoke the cloud provider's REST APIs directly. Otherwise, prefer hwcode_cloud_exec.
|
|
193
|
+
`;
|
|
184
194
|
}
|
|
185
195
|
|
|
186
196
|
export async function approveOperation(operation: CloudOperation, params: { command: string; args: string[]; intent: string }, state: WorkflowState, ctx: ExtensionContext): Promise<"allow" | "allow-session" | "deny"> {
|