@rubytech/create-realagent 1.0.840 → 1.0.842
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts +2 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js +88 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/enumerate.test.js.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts +23 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.js +96 -0
- package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -0
- package/payload/platform/lib/account-enumeration/src/__tests__/enumerate.test.ts +94 -0
- package/payload/platform/lib/account-enumeration/src/index.ts +96 -0
- package/payload/platform/lib/account-enumeration/tsconfig.json +8 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts +2 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.d.ts.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js +165 -0
- package/payload/platform/lib/graph-write/dist/__tests__/account-id-gate.test.js.map +1 -0
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js +15 -5
- package/payload/platform/lib/graph-write/dist/__tests__/action-provenance-gate.test.js.map +1 -1
- package/payload/platform/lib/graph-write/dist/index.d.ts +12 -0
- package/payload/platform/lib/graph-write/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-write/dist/index.js +25 -0
- package/payload/platform/lib/graph-write/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-write/src/__tests__/account-id-gate.test.ts +189 -0
- package/payload/platform/lib/graph-write/src/__tests__/action-provenance-gate.test.ts +16 -5
- package/payload/platform/lib/graph-write/src/index.ts +45 -1
- package/payload/platform/package.json +2 -2
- package/payload/platform/plugins/docs/references/attachments.md +2 -2
- package/payload/platform/plugins/docs/references/internals.md +1 -1
- package/payload/platform/plugins/docs/references/troubleshooting.md +1 -1
- package/payload/platform/plugins/whatsapp/PLUGIN.md +1 -1
- package/payload/platform/templates/agents/admin/IDENTITY.md +4 -0
- package/payload/server/adminuser-self-heal-RY4NFCI7.js +45 -0
- package/payload/server/chunk-2YG3AYAH.js +1508 -0
- package/payload/server/chunk-7DFOKDNM.js +2098 -0
- package/payload/server/chunk-DTWW35TK.js +667 -0
- package/payload/server/chunk-HTYXRFT6.js +727 -0
- package/payload/server/chunk-NPVEOM3D.js +1508 -0
- package/payload/server/chunk-QGM4M3NI.js +37 -0
- package/payload/server/chunk-S27QCBFQ.js +10071 -0
- package/payload/server/chunk-TS6CKCGU.js +727 -0
- package/payload/server/chunk-XECKT3YB.js +10071 -0
- package/payload/server/client-pool-2WQ2Q3TF.js +32 -0
- package/payload/server/client-pool-SMWCZMZG.js +32 -0
- package/payload/server/cloudflare-task-tracker-NQK7A2EQ.js +20 -0
- package/payload/server/cloudflare-task-tracker-O4ZA4TAS.js +20 -0
- package/payload/server/cloudflare-task-tracker-XFGXO7ZV.js +20 -0
- package/payload/server/maxy-edge.js +2 -2
- package/payload/server/public/assets/{admin-D678VwpH.js → admin-CvwOOG4D.js} +1 -1
- package/payload/server/public/assets/{public-C7mCgRX0.js → public-Br9YjNs_.js} +2 -2
- package/payload/server/public/index.html +1 -1
- package/payload/server/public/public.html +1 -1
- package/payload/server/server.js +65 -41
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import "./chunk-QGM4M3NI.js";
|
|
2
|
+
|
|
3
|
+
// app/lib/adminuser-self-heal.ts
|
|
4
|
+
var UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
5
|
+
async function selfHealAdminUser(args) {
|
|
6
|
+
const { driver, userId, accountId } = args;
|
|
7
|
+
if (!UUID_REGEX.test(accountId)) {
|
|
8
|
+
throw new Error(
|
|
9
|
+
`[adminuser-self-heal] refusing to run: accountId is not a UUID (got: '${accountId.slice(0, 12)}\u2026')`
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
if (!UUID_REGEX.test(userId)) {
|
|
13
|
+
throw new Error(
|
|
14
|
+
`[adminuser-self-heal] refusing to run: userId is not a UUID (got: '${userId.slice(0, 12)}\u2026')`
|
|
15
|
+
);
|
|
16
|
+
}
|
|
17
|
+
const session = driver.session();
|
|
18
|
+
try {
|
|
19
|
+
const result = await session.run(
|
|
20
|
+
`MATCH (au:AdminUser {userId: $userId})
|
|
21
|
+
WHERE au.accountId IS NULL OR au.role IS NULL
|
|
22
|
+
SET au.accountId = COALESCE(au.accountId, $accountId),
|
|
23
|
+
au.role = COALESCE(au.role, 'owner'),
|
|
24
|
+
au.updatedAt = $now
|
|
25
|
+
RETURN count(au) AS healed`,
|
|
26
|
+
{ userId, accountId, now: (/* @__PURE__ */ new Date()).toISOString() }
|
|
27
|
+
);
|
|
28
|
+
const raw = result.records[0]?.get("healed");
|
|
29
|
+
let healed = 0;
|
|
30
|
+
if (typeof raw === "number") {
|
|
31
|
+
healed = raw;
|
|
32
|
+
} else if (raw && typeof raw.toNumber === "function") {
|
|
33
|
+
healed = raw.toNumber();
|
|
34
|
+
}
|
|
35
|
+
console.error(
|
|
36
|
+
`[adminuser-self-heal] healed=${healed} userId=${userId.slice(0, 8)} accountId=${accountId.slice(0, 8)}`
|
|
37
|
+
);
|
|
38
|
+
return { healed };
|
|
39
|
+
} finally {
|
|
40
|
+
await session.close();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
selfHealAdminUser
|
|
45
|
+
};
|