feat(platform): checkpoint current implementation state

This commit is contained in:
2026-04-01 07:42:03 +02:00
parent 3e53471f05
commit 8c5be51251
125 changed files with 10269 additions and 17808 deletions
@@ -1,5 +1,6 @@
import { SystemRole } from "@capakraken/shared";
import type { TRPCContext } from "../../trpc.js";
import type { ToolContext, ToolDef, ToolExecutor } from "./shared.js";
import { withToolAccess, type ToolContext, type ToolDef, type ToolExecutor } from "./shared.js";
type AssistantToolErrorResult = { error: string };
@@ -143,7 +144,7 @@ type NotificationsTasksDeps = {
) => AssistantToolErrorResult | null;
};
export const notificationInboxToolDefinitions: ToolDef[] = [
export const notificationInboxToolDefinitions: ToolDef[] = withToolAccess([
{
type: "function",
function: {
@@ -207,9 +208,13 @@ export const notificationInboxToolDefinitions: ToolDef[] = [
},
},
},
];
], {
create_notification: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
});
export const notificationTaskToolDefinitions: ToolDef[] = [
export const notificationTaskToolDefinitions: ToolDef[] = withToolAccess([
{
type: "function",
function: {
@@ -444,7 +449,23 @@ export const notificationTaskToolDefinitions: ToolDef[] = [
},
},
},
];
], {
create_task_for_user: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
assign_task: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
send_broadcast: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
list_broadcasts: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
get_broadcast_detail: {
allowedSystemRoles: [SystemRole.ADMIN, SystemRole.MANAGER],
},
});
export function createNotificationsTasksExecutors(
deps: NotificationsTasksDeps,