mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-11-03 03:11:57 +00:00
TASK-33d49b5b: require bound owner reply actor
This commit is contained in:
1 parent
cd70fe1902
commit
f99c04ded9
1 file changed
+10
-1
+10
-1
@@ -101,6 +101,15 @@ function claimedIdentity(controlPlane, actorId, claim, field) {
|
||||
});
|
||||
}
|
||||
|
||||
function boundActorIdentity(controlPlane, actorId) {
|
||||
if (typeof actorId !== 'string' || actorId.trim().length === 0) {
|
||||
throw new TorchError('torch_reply_to_owner requires an actual bound Fleet identity', {
|
||||
code: 'FLEET_IDENTITY_REQUIRED', details: { field: 'bound_actor' },
|
||||
});
|
||||
}
|
||||
return controlPlane.assertIdentity(actorId);
|
||||
}
|
||||
|
||||
function inputSchema(tool) {
|
||||
return typeof tool.schema?.safeParse === 'function' ? tool.schema : z.object(tool.schema);
|
||||
}
|
||||
@@ -180,7 +189,7 @@ export function createTorchToolset(controlPlane, {
|
||||
request_id: z.string().min(1), body: z.string().min(1),
|
||||
}).strict(),
|
||||
invoke: ({ request_id: requestId, body }) => controlPlane.sendOwnerReply({
|
||||
sender: claimedIdentity(controlPlane, actorId, undefined, 'sender'), requestId, body,
|
||||
sender: boundActorIdentity(controlPlane, actorId), requestId, body,
|
||||
}),
|
||||
}],
|
||||
['torch_read_messages', {
|
||||
|
||||
Reference in new issue
Block a user