sync: update from private repo (6fcb0d0)

This commit is contained in:
oss-sync
2026-06-04 03:03:12 +00:00
parent 21be01b699
commit 57685d995c
36 changed files with 2467 additions and 391 deletions
+6 -2
View File
@@ -18,8 +18,12 @@ export interface LocalTasksApiOptions {
* Server-side validator for piece names accepted by the
* /continue endpoint. Returns true if the piece is loadable.
* When unset, /continue rejects all requests with 500 (misconfiguration).
*
* `ownerId` is the task owner's user id; when provided the implementation
* MUST also check the owner's per-user piece dir so that user-custom pieces
* are accepted (matching the resolution order the worker uses at run time).
*/
pieceExists?: (name: string) => boolean;
pieceExists?: (name: string, ownerId?: string) => boolean;
/**
* Optional. When set, accepting browserSessionProfileId on task create
* verifies the profile belongs to the requesting user. Without it, the
@@ -506,7 +510,7 @@ export function mountLocalTasksApi(app: Application, opts: LocalTasksApiOptions)
res.status(500).json({ error: 'piece_validation_unavailable' });
return;
}
if (!opts.pieceExists(piece)) {
if (!opts.pieceExists(piece, task?.ownerId ?? undefined)) {
res.status(400).json({ error: 'piece_not_found', piece });
return;
}