feat(platform): checkpoint current implementation state
This commit is contained in:
@@ -6,8 +6,16 @@ export function createToolContext(
|
||||
db: Record<string, unknown>,
|
||||
userRole: SystemRole = SystemRole.USER,
|
||||
): ToolContext {
|
||||
const dbWithTransaction = "$transaction" in db
|
||||
? db
|
||||
: {
|
||||
...db,
|
||||
$transaction: async <T>(callback: (tx: ToolContext["db"]) => Promise<T>) =>
|
||||
callback(db as ToolContext["db"]),
|
||||
};
|
||||
|
||||
return {
|
||||
db: db as ToolContext["db"],
|
||||
db: dbWithTransaction as ToolContext["db"],
|
||||
userId: "user_1",
|
||||
userRole,
|
||||
permissions: new Set(),
|
||||
|
||||
Reference in New Issue
Block a user