feat(ql3): establish 3.0 incubation baseline

This commit is contained in:
whyour
2026-08-12 00:25:26 +08:00
parent 4bf92dcfeb
commit c699c32461
2817 changed files with 779642 additions and 653 deletions
@@ -0,0 +1,32 @@
import type { RunDispatchLeaseRecord } from '../domain/runDispatchLease';
import type { ReleaseRunDispatchLeaseResult } from '../ports/runDispatchLeaseRepository';
import type { WorkerRunLeaseClient } from '../ports/workerRunLeaseClient';
import type {
FencedRunDispatchLeaseRequest,
ReleaseRunDispatchLeaseRequest,
} from './runDispatchLeaseService';
import { RunDispatchLeaseService } from './runDispatchLeaseService';
import type { AuthenticatedWorkerPrincipal } from './workerControlService';
/**
* Transport seam: the authenticated principal is fixed when the client is
* constructed and can never be supplied by a Worker request body.
*/
export class BoundWorkerRunLeaseClient implements WorkerRunLeaseClient {
constructor(
private readonly service: RunDispatchLeaseService,
private readonly principal: AuthenticatedWorkerPrincipal,
) {}
renew(
request: FencedRunDispatchLeaseRequest,
): Promise<RunDispatchLeaseRecord> {
return this.service.renew(this.principal, request);
}
release(
request: ReleaseRunDispatchLeaseRequest,
): Promise<ReleaseRunDispatchLeaseResult> {
return this.service.release(this.principal, request);
}
}