feat: add project-aware agent workspace
Generic Container CI/CD / test-build-publish (push) Successful in 2m9s
Frontend CI/CD / build-test-publish-and-deploy (push) Successful in 2m39s

This commit is contained in:
2026-10-22 18:52:18 +08:00
parent c6a0e74e72
commit 2d8506fea0
191 changed files with 12373 additions and 3556 deletions
@@ -1,4 +1,5 @@
import type { AccessTokenProvider } from "@/shared/auth/keycloak-auth";
import { getWorkbenchAccessToken } from "../api/request-context";
import type { WorkbenchAccess } from "../api/request-context";
import { env } from "@/shared/config/env";
import { createWorkbenchHeaders, findOwnedWorkbenchProject } from "../api/project-client";
import type { components } from "./generated/schema";
@@ -32,7 +33,7 @@ export class PeripheralSampleClient {
private readonly pendingCommands = new Map<string, { requestId: string; payload: string }>();
private scenarioProjection: PeripheralScenarioState | null = null;
constructor(private readonly getAccessToken?: AccessTokenProvider) {}
constructor(private readonly getAccessToken?: WorkbenchAccess) {}
get configured() {
return Boolean(this.baseUrl);
@@ -216,7 +217,7 @@ export class PeripheralSampleClient {
private async prepareHeaders(signal: AbortSignal | undefined, json: boolean) {
if (!this.baseUrl) throw new PeripheralSampleError("NOT_CONFIGURED", "外围样板服务未配置", "none", null);
const projectId = await this.resolveProjectId(signal);
const accessToken = await this.getAccessToken?.();
const accessToken = await getWorkbenchAccessToken(this.getAccessToken);
return createWorkbenchHeaders(accessToken, projectId, json);
}