Remove legacy client-manager workflows

This commit is contained in:
npc0-hue
2026-09-03 13:08:08 +08:00
parent bf3c382d15
commit fe09d21a56
56 changed files with 304 additions and 4121 deletions
+2 -8
View File
@@ -13,11 +13,10 @@ Plugins use the platform bridge for every privileged action.
- `run.distribution.request`: request platform-mediated run package generation, download, key reset, or self-update orchestration.
- `dependencies.request`: request typed dependency checks or approved install plans declared by the plugin runtime profile.
- `logs.backfill.request`: request historical log backfill for a declared log source.
- `client-manager.request`: request generation/download/key reset or a typed status, deploy, start, stop, restart, update, rollback, session-revoke, retry, or uninstall operation for a plugin-declared companion client manager.
- `plugin-lifecycle.request`: request a server-bound install, enable, disable, upgrade, rollback, retire, or dependency-check operation through Platform capacity and compatibility gates.
- `ai.invoke`: request platform-mediated AI assistance.
- `theme.tokens`: read safe platform theme tokens.
- `game-client-bridge`: query declared companion health and snapshots, and queue or cancel only manifest-declared typed commands through Platform.
- `game-client-bridge`: query declared bridge snapshots, and queue or cancel only manifest-declared typed commands through Platform.
## Execution Envelopes
@@ -33,9 +32,7 @@ Remote access requests use `createRemoteAccessRequest` with a plugin-declared `r
SQLite reads use manifest-declared `gameClientBridge.queryTemplates`. Plugin pages send only a declared template key plus typed inputs; Platform verifies the page contract, permission, SQLite transport/target, timeout, and row limit before dispatch. Query declarations and browser envelopes never contain SQL text, DSNs, credentials, sockets, or host paths.
Run distribution, dependency, log backfill, and client-manager requests use `createRunDistributionRequest`, `createDependencyActionRequest`, `createLogBackfillRequest`, and `createClientManagerRequest`. Client-manager lifecycle envelopes carry only operation names, logical profile/installation IDs, target OS/architecture, artifact IDs, expected deployment generations, and idempotency keys. `parseClientManagerLifecycleStatus` whitelists safe state, version, health, job, artifact, and action fields. Raw run/client-manager keys, component sessions, secret refs, host paths, PIDs, sockets, credentials, and direct Run endpoint details are never plugin bridge fields.
Client-manager lifecycle requests remain Platform-mediated. A plugin declaration does not grant access by itself: Platform rechecks the installed plugin, server owner/administrator scope, runtime binding, assigned Run endpoint capabilities, current distribution target/revision/key generation, and durable installation state before dispatching a typed job.
Run distribution, dependency, and log backfill requests use `createRunDistributionRequest`, `createDependencyActionRequest`, and `createLogBackfillRequest`. These envelopes carry only operation names, logical profile keys, target platforms, artifact IDs, approved dependency plan digests, cursors, and idempotency keys. Raw run keys, component sessions, secret refs, host paths, PIDs, sockets, credentials, and direct Run endpoint details are never plugin bridge fields.
Game-client plugin pages receive a host-provided `GameClientBridgePageClient`. The SDK defines status, command, result, snapshot, approval, and manifest declaration types but never creates its own HTTP client. Queue requests carry only a declared command type, logical profile key, bounded typed payload, expiry, priority, and idempotency key. A command may declare a protected `sql`, `rcon`, or management-program request: the plugin supplies only its one bounded text field and logical transport/target keys; Platform authorizes, approves, redacts, queues, and forwards it to Run. A management program is not host OS shell access. Browser-facing types intentionally have no component session, component key, installation fence, host path, DSN, Run endpoint, socket, or storage credential fields.
@@ -53,6 +50,3 @@ The bridge must not expose:
- unrestricted artifact storage credentials.
- direct storage URLs or presigned backend URLs.
- FTP, rsync, database, or RCON credentials.
# Client Manager lifecycle bridge
The bridge may request typed `deploy`, `start`, `stop`, `restart`, `status`, `update`, `rollback`, `revoke`, `retry`, or `uninstall` intents when Platform action gating says they are available. Results are safe logical projections with real job phase/progress and redacted recovery guidance. The bridge is not a transport for Run sessions, component keys, artifact bytes, machine paths, process IDs, sockets, or credentials; component registration and heartbeat remain component-to-Platform contracts outside the plugin page.
+1 -201
View File
@@ -10,7 +10,6 @@ export type PluginPermission =
| "server.remote.access"
| "server.run.distribution"
| "server.dependencies.manage"
| "server.client-manager.manage"
| "server.game-client.read"
| "server.game-client.command"
| "server.game-client.maintenance"
@@ -49,11 +48,6 @@ export type RunCapability =
| "remote.run.logs.transfer"
| "remote.run.rcon.command"
| "remote.run.program.command"
| "client-manager.deploy"
| "client-manager.control"
| "client-manager.update"
| "client-manager.rollback"
| "client-manager.uninstall"
| "artifacts.read"
| "artifacts.write"
| "ai.invoke";
@@ -70,7 +64,6 @@ export type PluginBridgeAction =
| "run.distribution.request"
| "dependencies.request"
| "logs.backfill.request"
| "client-manager.request"
| "plugin-lifecycle.request"
| "ai.invoke";
@@ -183,30 +176,6 @@ export type PluginLogBackfillPayload = Record<string, string> & {
idempotencyKey: string;
};
export type PluginClientManagerPayload = Record<string, string> & {
operation:
| "generate"
| "download"
| "reset-key"
| "status"
| "deploy"
| "start"
| "stop"
| "restart"
| "update"
| "rollback"
| "revoke-session"
| "retry"
| "uninstall";
profileKey: string;
targetOS?: RuntimePlatform;
targetArch?: RuntimeArch;
artifactId?: string;
installationId?: string;
expectedDeploymentGeneration?: string;
idempotencyKey: string;
};
export type RemoteAccessMethod = "ftp" | "rsync" | "run";
export type RemoteDatabaseEngine = "mysql" | "sqlite";
@@ -282,22 +251,6 @@ export interface GameClientBridgePageContract {
export interface GameClientBridgeFeatureDeclaration { key: string; title: string; permission: PluginPermission; requiredHandlers?: string[]; requiredEventProducers?: string[]; }
export interface GameClientBridgeCompanionDeclaration {
profileKey: string;
configTemplateKey: string;
configSchemaRef: string;
configFormat: "yaml";
platformBaseUrlSource: "run-control";
registrationProof: "hmac-sha256";
proofMaterialSource: "component-package";
proofMaterialEnv: string;
sessionMode: "component-session";
tlsPolicy: "verify-system-roots";
heartbeatIntervalSeconds: number;
commandPollIntervalSeconds: number;
requestTimeoutSeconds: number;
}
export interface GameClientBridgeManifest {
commands: GameClientBridgeCommandDeclaration[];
snapshots: GameClientBridgeSnapshotDeclaration[];
@@ -307,7 +260,6 @@ export interface GameClientBridgeManifest {
maxCommands: number;
pages?: GameClientBridgePageContract[];
features?: GameClientBridgeFeatureDeclaration[];
companion?: GameClientBridgeCompanionDeclaration;
}
export interface GameClientBridgeProfileStatus {
@@ -421,7 +373,6 @@ export interface RuntimeLifecycleProfile {
capabilities: RunCapability[];
actionRefs?: Partial<Record<PluginLifecycleAction, string>>;
transportKeys?: string[];
clientManagerRef?: string;
dllExtensionRefs?: string[];
platforms?: RuntimePlatform[];
}
@@ -454,7 +405,7 @@ export interface RuntimeInstallPlan {
export interface RuntimeLogSource {
key: string;
kind: "process.stdout" | "process.stderr" | "file.tail" | "ftp.poll" | "sql.query" | "client-manager";
kind: "process.stdout" | "process.stderr" | "file.tail" | "ftp.poll" | "sql.query";
targetKey?: string;
streamKey: string;
cursorKind?: "sequence" | "offset" | "fingerprint" | "ftp-listing" | "sql-cursor";
@@ -480,57 +431,6 @@ export interface RuntimeDataTarget {
platforms?: RuntimePlatform[];
}
export interface RuntimeClientManagerProfile {
key: string;
displayName?: string;
version?: string;
repository: {
url: string;
revisionPolicy: "pinned" | "branch" | "tag";
branch?: string;
tag?: string;
revision?: string;
};
supportedTargets: RuntimeTarget[];
build: {
system: "go" | "npm" | "cargo" | "make";
workspaceRef?: string;
entryRef?: string;
};
configTemplates?: Array<{ key: string; templateRef: string; outputRef: string }>;
outputArtifacts: string[];
deployment?: {
mode: "run-supervised";
executableRef: string;
arguments?: string[];
autoStart?: boolean;
requiredRunCapabilities: Array<"client-manager.deploy" | "client-manager.control" | "client-manager.update" | "client-manager.rollback" | "client-manager.uninstall">;
};
lifecycle?: {
actions: Array<"start" | "stop" | "restart" | "status" | "update" | "rollback" | "uninstall">;
startupTimeoutSeconds: number;
stopTimeoutSeconds: number;
};
health?: {
mode: "component-heartbeat" | "process";
intervalSeconds: number;
degradedAfterSeconds: number;
offlineAfterSeconds: number;
requiredCapabilities: Array<"component.register" | "component.heartbeat" | "component.health" | "component.control" | "game-client.bridge" | "logs.stream">;
};
compatibility?: {
minimumVersion?: string;
maximumVersion?: string;
allowDowngrade: boolean;
};
updatePolicy?: {
strategy: "manual-staged";
requireApproval: true;
healthConfirmationSeconds: number;
retainPrevious: true;
};
}
export interface RuntimeDLLExtensionProfile {
key: string;
displayName: string;
@@ -559,7 +459,6 @@ export interface GamePluginRuntimeProfiles {
logSources?: RuntimeLogSource[];
transportProfiles?: RuntimeTransportProfile[];
dataTargets?: RuntimeDataTarget[];
clientManagers?: RuntimeClientManagerProfile[];
dllExtensions?: RuntimeDLLExtensionProfile[];
}
@@ -576,24 +475,6 @@ export interface PluginArtifactReference {
storageBehavior?: string;
}
export interface PluginClientManagerLifecycleStatus {
installationId: string;
profileKey: string;
status: string;
phase?: string;
targetOS?: RuntimePlatform;
targetArch?: RuntimeArch;
version?: string;
previousVersion?: string;
artifactId?: string;
currentJobId?: string;
deploymentGeneration?: number;
health?: string;
healthReason?: string;
lastSeenAt?: string;
actions: string[];
}
export type PluginBridgeExecutionResponse<TResult extends Record<string, string> = Record<string, string>> = {
requestId: string;
pluginId: string;
@@ -620,7 +501,6 @@ export const pluginBridgeActionPolicies: Record<PluginBridgeAction, PluginBridge
"run.distribution.request": { permissions: ["server.run.distribution"] },
"dependencies.request": { permissions: ["server.dependencies.manage"] },
"logs.backfill.request": { permissions: ["server.logs.read"] },
"client-manager.request": { permissions: ["server.client-manager.manage"] },
"plugin-lifecycle.request": { permissions: ["server.lifecycle"] },
"ai.invoke": { permissions: ["ai.invoke"], aiPurposeRequired: true }
};
@@ -918,40 +798,6 @@ export function createLogBackfillRequest(input: {
});
}
export function createClientManagerRequest(input: {
requestId: string;
context: PluginBridgeContext;
operation: PluginClientManagerPayload["operation"];
profileKey: string;
targetOS?: RuntimePlatform;
targetArch?: RuntimeArch;
artifactId?: string;
installationId?: string;
expectedDeploymentGeneration?: number;
idempotencyKey: string;
}): PluginBridgeExecutionRequest<PluginClientManagerPayload> {
const payload: PluginClientManagerPayload = {
operation: input.operation,
profileKey: input.profileKey,
artifactId: input.artifactId ?? "",
installationId: input.installationId ?? "",
expectedDeploymentGeneration: typeof input.expectedDeploymentGeneration === "number" ? String(input.expectedDeploymentGeneration) : "",
idempotencyKey: input.idempotencyKey
};
if (input.targetOS) {
payload.targetOS = input.targetOS;
}
if (input.targetArch) {
payload.targetArch = input.targetArch;
}
return createBridgeExecutionRequest({
requestId: input.requestId,
context: input.context,
action: "client-manager.request",
payload
});
}
export function parseArtifactReference(result: Record<string, string> | undefined): PluginArtifactReference | undefined {
if (!result) {
return undefined;
@@ -984,52 +830,6 @@ export function parseArtifactReference(result: Record<string, string> | undefine
return reference;
}
export function parseClientManagerLifecycleStatus(result: Record<string, string> | undefined): PluginClientManagerLifecycleStatus | undefined {
if (!result) {
return undefined;
}
const deploymentGeneration = Number(result.deploymentGeneration ?? "0");
const values = [
result.installationId,
result.profileKey,
result.status,
result.phase,
result.targetOS,
result.targetArch,
result.version,
result.previousVersion,
result.artifactId,
result.currentJobId,
result.health,
result.healthReason,
result.lastSeenAt,
result.actions
];
if (!result.installationId || !result.profileKey || !result.status || !Number.isSafeInteger(deploymentGeneration) || deploymentGeneration < 0) {
return undefined;
}
if (values.some((value) => typeof value === "string" && containsUnsafeReferenceContent(value))) {
return undefined;
}
return {
installationId: result.installationId,
profileKey: result.profileKey,
status: result.status,
phase: result.phase,
targetOS: result.targetOS as RuntimePlatform | undefined,
targetArch: result.targetArch as RuntimeArch | undefined,
version: result.version,
previousVersion: result.previousVersion,
artifactId: result.artifactId,
currentJobId: result.currentJobId,
deploymentGeneration,
health: result.health,
healthReason: result.healthReason,
lastSeenAt: result.lastSeenAt,
actions: (result.actions ?? "").split(",").filter(Boolean)
};
}
export function parseBridgeExecutionResponse<TResult extends Record<string, string>>(response: PluginBridgeExecutionResponse<TResult>): PluginBridgeExecutionResponse<TResult> {
const safeError = response.error ? bridgeError(response.error.code, response.error.message, response.error.details ?? []) : undefined;
return {