@rubytech/create-maxy-code 0.1.416 → 0.1.417
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/dist/__tests__/outlook-client-id-env.test.js +46 -0
- package/dist/index.js +31 -0
- package/dist/port-resolution.js +8 -1
- package/package.json +1 -1
- package/payload/platform/config/brand.json +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts +2 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.d.ts.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js +81 -0
- package/payload/platform/lib/account-enumeration/dist/__tests__/is-provisioned.test.js.map +1 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts +17 -0
- package/payload/platform/lib/account-enumeration/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/account-enumeration/dist/index.js +46 -9
- package/payload/platform/lib/account-enumeration/dist/index.js.map +1 -1
- package/payload/platform/lib/account-enumeration/src/__tests__/is-provisioned.test.ts +86 -0
- package/payload/platform/lib/account-enumeration/src/index.ts +45 -9
- package/payload/platform/lib/account-scope/dist/index.d.ts +14 -5
- package/payload/platform/lib/account-scope/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/account-scope/dist/index.js +14 -5
- package/payload/platform/lib/account-scope/dist/index.js.map +1 -1
- package/payload/platform/lib/account-scope/src/index.ts +22 -5
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +43 -10
- package/payload/platform/plugins/docs/references/outlook-guide.md +42 -9
- package/payload/platform/plugins/email/references/email-reference.md +1 -1
- package/payload/platform/plugins/filesystem/PLUGIN.md +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js +16 -2
- package/payload/platform/plugins/filesystem/mcp/dist/lib/__tests__/scope.test.js.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.d.ts.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js +8 -3
- package/payload/platform/plugins/filesystem/mcp/dist/lib/scope.js.map +1 -1
- package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js +2 -2
- package/payload/platform/plugins/filesystem/mcp/dist/tools/__tests__/handlers.test.js.map +1 -1
- package/payload/platform/plugins/memory/PLUGIN.md +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index-testable.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index-testable.js +14 -5
- package/payload/platform/plugins/memory/mcp/dist/index-testable.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/index.js +5 -2
- package/payload/platform/plugins/memory/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts +29 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js +44 -0
- package/payload/platform/plugins/memory/mcp/dist/lib/neo4j-constraint.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js +22 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/owner-person-embed-text.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js +105 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-bootstrap.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts +2 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.d.ts.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js +78 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/profile-update-personfields-embed.test.js.map +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js +2 -2
- package/payload/platform/plugins/memory/mcp/dist/tools/__tests__/resolve-tool-account.test.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts +0 -5
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js +2 -12
- package/payload/platform/plugins/memory/mcp/dist/tools/memory-write.js.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts +1 -0
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.d.ts.map +1 -1
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js +106 -10
- package/payload/platform/plugins/memory/mcp/dist/tools/profile-update.js.map +1 -1
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +40 -7
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js +137 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/account-register.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js +186 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/calendar-write.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js +110 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/device-flow.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js +108 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client-retry.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js +13 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/graph-client.test.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js +32 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/message.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js +67 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pending-store.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js +7 -5
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/pkce-flow.test.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js +141 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/write-tools.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts +69 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js +129 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/device-flow.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts +39 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js +101 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pending-store.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js +3 -2
- package/payload/platform/plugins/outlook/mcp/dist/auth/pkce-flow.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/index.js +187 -5
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts +34 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js +96 -7
- package/payload/platform/plugins/outlook/mcp/dist/lib/graph-client.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts +31 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js +30 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts +41 -17
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js +87 -28
- package/payload/platform/plugins/outlook/mcp/dist/tools/account-register.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts +17 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js +38 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-cancel.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts +29 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js +50 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-create.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts +34 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js +46 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-freebusy.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts +15 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js +27 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-respond.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts +11 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js +20 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/calendar-update.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts +17 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-send.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +11 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts +14 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js +26 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-send.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/scripts/verify-doc-impl.sh +2 -2
- package/payload/platform/plugins/outlook/references/auth.md +51 -54
- package/payload/platform/plugins/outlook/references/graph-surfaces.md +97 -4
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +34 -9
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js +9 -0
- package/payload/platform/services/claude-session-manager/dist/canonical-tool-names.generated.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.d.ts +18 -0
- package/payload/platform/services/claude-session-manager/dist/config.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/config.js +16 -0
- package/payload/platform/services/claude-session-manager/dist/config.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/http-server.js +7 -2
- package/payload/platform/services/claude-session-manager/dist/http-server.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +7 -2
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/templates/specialists/agents/personal-assistant.md +1 -1
- package/payload/server/public/assets/{AdminLoginScreens-CBlE6FB4.js → AdminLoginScreens-CBTx7ZPK.js} +1 -1
- package/payload/server/public/assets/{AdminShell-d1WQ3lLu.js → AdminShell-DPHUeXea.js} +1 -1
- package/payload/server/public/assets/{Checkbox-B0pbYJDQ.js → Checkbox-BHTxekRB.js} +1 -1
- package/payload/server/public/assets/{Transcript-CYaAPBFX.js → Transcript-5kLbBInN.js} +1 -1
- package/payload/server/public/assets/{admin-CVh9HO-f.js → admin-BWCLE32N.js} +1 -1
- package/payload/server/public/assets/{browser-C4f_D4Ih.js → browser-CRvCPsvV.js} +1 -1
- package/payload/server/public/assets/{calendar-WUxQ4fVo.js → calendar-BI-kd-QP.js} +1 -1
- package/payload/server/public/assets/chat-DFy8hb1y.js +1 -0
- package/payload/server/public/assets/chevron-left-Bggm5B5U.js +1 -0
- package/payload/server/public/assets/data-HvZ69Ya1.js +1 -0
- package/payload/server/public/assets/{graph-BNXE6mKP.js → graph-BFSyW_5i.js} +1 -1
- package/payload/server/public/assets/{graph-labels-Csnovm_c.js → graph-labels-DEjD_qJh.js} +1 -1
- package/payload/server/public/assets/{maximize-2-WRUJsg5n.js → maximize-2-BcMJNeCB.js} +1 -1
- package/payload/server/public/assets/{operator-CXtygMh6.js → operator-Dtvm9ero.js} +1 -1
- package/payload/server/public/assets/{page-DjpQp_ir.js → page-C_pm3hl3.js} +1 -1
- package/payload/server/public/assets/{page-IQDLdebG.js → page-TXi9dmaB.js} +1 -1
- package/payload/server/public/assets/{public-DSeYu61E.js → public-DBx3U0r8.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-BayMWwfc.js → rotate-ccw-8ti3QkeY.js} +1 -1
- package/payload/server/public/assets/useSubAccountSwitcher-BUvlETHN.css +1 -0
- package/payload/server/public/assets/{useSubAccountSwitcher-C9aLg8yI.js → useSubAccountSwitcher-Bc5dOBdI.js} +1 -1
- package/payload/server/public/browser.html +4 -4
- package/payload/server/public/calendar.html +5 -5
- package/payload/server/public/chat.html +9 -9
- package/payload/server/public/data.html +8 -8
- package/payload/server/public/graph.html +9 -9
- package/payload/server/public/index.html +11 -11
- package/payload/server/public/operator.html +11 -11
- package/payload/server/public/public.html +9 -9
- package/payload/server/server.js +8 -2
- package/payload/server/public/assets/chat-NJ2HXhOf.js +0 -1
- package/payload/server/public/assets/chevron-left-Da-iZGi_.js +0 -1
- package/payload/server/public/assets/data-ZUdT44Ba.js +0 -1
- package/payload/server/public/assets/useSubAccountSwitcher-CRZfyJXR.css +0 -1
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
// with empty env during plugin-system `tools/list` enumeration.
|
|
11
11
|
export type EffectiveAccount =
|
|
12
12
|
| { accountId: string }
|
|
13
|
-
| {
|
|
13
|
+
| {
|
|
14
|
+
reject:
|
|
15
|
+
| "cross-account-denied"
|
|
16
|
+
| "cross-account-invalid-target"
|
|
17
|
+
| "cross-account-target-not-provisioned";
|
|
18
|
+
};
|
|
14
19
|
|
|
15
20
|
/**
|
|
16
21
|
* Resolve the account a call acts on. Fail-closed: only a house-scoped session
|
|
@@ -19,18 +24,30 @@ export type EffectiveAccount =
|
|
|
19
24
|
* downgraded to its own account.
|
|
20
25
|
*
|
|
21
26
|
* `isValidAccountId` is injected (required, no default): the UI passes its
|
|
22
|
-
* fs-backed `isValidAccountId
|
|
23
|
-
* `
|
|
24
|
-
* module stay pure.
|
|
27
|
+
* fs-backed `isValidAccountId` (reads disk fresh every call); the `memory` and
|
|
28
|
+
* `filesystem` plugins pass `isProvisionedAccount` (cached-hit, re-scan-on-miss).
|
|
29
|
+
* Keeping validity injected is what lets this module stay pure.
|
|
30
|
+
*
|
|
31
|
+
* `notProvisionedReason` names the reject emitted when the injected check fails.
|
|
32
|
+
* It defaults to `cross-account-invalid-target` (the UI path, byte-identical to
|
|
33
|
+
* the 1440 landing). The MCP plugins pass `cross-account-target-not-provisioned`
|
|
34
|
+
* because their injected check re-scans disk on a miss (Task 1471) — so a false
|
|
35
|
+
* from it means the id is genuinely not on disk, distinct from a stale-cache
|
|
36
|
+
* miss (which no longer rejects). The distinct reason lets an operator tell a
|
|
37
|
+
* wrong/typo id from the (now-eliminated) created-after-boot case in the
|
|
38
|
+
* `[xacct] op=call … reason=` line.
|
|
25
39
|
*/
|
|
26
40
|
export function resolveEffectiveAccountCore(
|
|
27
41
|
input: { ownAccountId: string; houseScope: string | null; targetAccountId?: string | null },
|
|
28
42
|
isValidAccountId: (id: string) => boolean,
|
|
43
|
+
notProvisionedReason:
|
|
44
|
+
| "cross-account-invalid-target"
|
|
45
|
+
| "cross-account-target-not-provisioned" = "cross-account-invalid-target",
|
|
29
46
|
): EffectiveAccount {
|
|
30
47
|
const { ownAccountId, houseScope, targetAccountId } = input;
|
|
31
48
|
if (!targetAccountId) return { accountId: ownAccountId };
|
|
32
49
|
if (!houseScope) return { reject: "cross-account-denied" };
|
|
33
|
-
if (!isValidAccountId(targetAccountId)) return { reject:
|
|
50
|
+
if (!isValidAccountId(targetAccountId)) return { reject: notProvisionedReason };
|
|
34
51
|
return { accountId: targetAccountId };
|
|
35
52
|
}
|
|
36
53
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: platform-architecture
|
|
3
3
|
description: Use when grounding any documented-surface claim about what Maxy ships — plugins, skills, specialists, install/deploy flows, internals. This is the install catalogue, not evidence of what is enabled on the current account. For install state on this account, call `capabilities-here`; for documented surface, cite the `Source:` URL inline.
|
|
4
|
-
content-hash: sha256:
|
|
4
|
+
content-hash: sha256:c17392a180e59049412359b379894e93bb588c79b83553554e3b8f1b80dff94d
|
|
5
5
|
brand: maxy-code
|
|
6
6
|
product-name: Maxy
|
|
7
7
|
---
|
|
@@ -1943,26 +1943,35 @@ Source: https://docs.getmaxy.com/outlook-guide.md
|
|
|
1943
1943
|
|
|
1944
1944
|
# Outlook Plugin — Operator Guide
|
|
1945
1945
|
|
|
1946
|
-
The `outlook` plugin gives the admin agent
|
|
1946
|
+
The `outlook` plugin gives the admin agent access to Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read, draft, and send; contacts are read-only; the calendar is read plus control (create, update, cancel, respond, free/busy). Per-account OAuth (device-code flow), encrypted token storage, automatic refresh.
|
|
1947
1947
|
|
|
1948
1948
|
## Quickstart
|
|
1949
1949
|
|
|
1950
|
-
1. **
|
|
1951
|
-
2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which
|
|
1952
|
-
3. **
|
|
1950
|
+
1. **No app to register.** The client ID ships with the brand (`brand.json#outlookClientId`), and the installer stamps it onto the session-manager env, so there is zero operator Azure work. On a brand that ships an empty value the plugin stays inert until its vendor app exists — see `platform/plugins/outlook/references/auth.md` for the one-time-per-brand vendor provisioning runbook (a vendor step, not an operator or end-user step), including setting **Allow public client flows** to Yes.
|
|
1951
|
+
2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which returns a short user code and the URL `microsoft.com/devicelogin` and relays both to you.
|
|
1952
|
+
3. **Consent on any device** — open `microsoft.com/devicelogin` on your phone or laptop, enter the code, sign in to your Microsoft account, and consent to the requested scopes (`offline_access`, `User.Read`, `Mail.ReadWrite`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.Read`). `Mail.Send` enables sending and `Calendars.ReadWrite` enables calendar control; a mailbox last consented on an older read-only scope set must re-register before send or any calendar write succeeds. The agent finishes by calling `outlook-account-register-poll`.
|
|
1953
1953
|
4. **Done.** Subsequent tool calls (mail, calendar, contacts) use the persisted refresh token transparently.
|
|
1954
1954
|
|
|
1955
1955
|
## Tools
|
|
1956
1956
|
|
|
1957
1957
|
| Tool | Purpose |
|
|
1958
1958
|
|------|---------|
|
|
1959
|
-
| `outlook-account-register` |
|
|
1959
|
+
| `outlook-account-register` | Start the device-code flow for this account. Returns a user code + `microsoft.com/devicelogin` URL immediately; does not block. |
|
|
1960
|
+
| `outlook-account-register-poll` | Finish the device-code flow. One check per call: returns pending, registered, expired, or denied. |
|
|
1960
1961
|
| `outlook-mail-list` | Recent mail. Default top=25, folder=Inbox. |
|
|
1961
1962
|
| `outlook-mail-search` | Microsoft Graph `$search` over the mailbox. |
|
|
1962
1963
|
| `outlook-calendar-list` | Calendar events in next rangeDays days (default 7, max 365). |
|
|
1963
1964
|
| `outlook-calendar-event` | Full detail of a single event by id. |
|
|
1965
|
+
| `outlook-calendar-create` | Book an event. Needs subject, start, end; optional body, attendees, location, isOnlineMeeting, recurrence. |
|
|
1966
|
+
| `outlook-calendar-update` | Reschedule or edit an event. Pass eventId plus the fields to change. |
|
|
1967
|
+
| `outlook-calendar-cancel` | Cancel a meeting (notifies attendees when the account organises it) or delete a personal appointment. Mode chosen automatically. |
|
|
1968
|
+
| `outlook-calendar-respond` | Accept, decline, or tentatively accept an invite. |
|
|
1969
|
+
| `outlook-calendar-freebusy` | Availability for one or more addresses over a window. |
|
|
1964
1970
|
| `outlook-contacts-list` | Top contacts. Default top=50. |
|
|
1965
1971
|
| `outlook-mailbox-info` | Health probe — auth state, refresh-window, folder count. |
|
|
1972
|
+
| `outlook-mail-send` | Send a message (`POST /me/sendMail`). to/cc/bcc arrays, subject, body, isHtml. Success asserted on Graph 202. Needs `Mail.Send`. |
|
|
1973
|
+
| `outlook-draft` | Create a draft in Drafts (`POST /me/messages`). Same body model. Returns the draft id. Needs `Mail.ReadWrite`. |
|
|
1974
|
+
| `outlook-draft-send` | Send an existing draft by id (`POST /me/messages/{id}/send`). Graph consumes the draft, returns 202. Needs `Mail.Send`. |
|
|
1966
1975
|
|
|
1967
1976
|
## Observability
|
|
1968
1977
|
|
|
@@ -1970,8 +1979,13 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
|
|
|
1970
1979
|
|
|
1971
1980
|
| Event | Line shape |
|
|
1972
1981
|
|-------|------------|
|
|
1973
|
-
|
|
|
1974
|
-
|
|
|
1982
|
+
| Device code issued | `devicecode-issued account=<id> userCode=<code> verificationUri=<url> expiresSec=<N> intervalSec=<N>` |
|
|
1983
|
+
| Poll (still pending) | `devicecode-poll account=<id> status=pending elapsedSec=<N>` |
|
|
1984
|
+
| Device code expired | `devicecode-expired account=<id> elapsedSec=<N>` (terminal) |
|
|
1985
|
+
| Consent denied | `devicecode-denied account=<id> elapsedSec=<N>` (terminal) |
|
|
1986
|
+
| Pending-store census | `pending-store-census account=<id> live=<N>` |
|
|
1987
|
+
| Pending cleared | `pending-cleared account=<id> verified=<bool>` |
|
|
1988
|
+
| /me failed post-token | `me-failed account=<id> status=<N>` |
|
|
1975
1989
|
| Auth ok | `auth-ok account=<id> graphUserId=<id> scopes=<csv> tokenExpSec=<N>` |
|
|
1976
1990
|
| Token refreshed | `token-refreshed account=<id> oldExpSec=<N> newExpSec=<N>` |
|
|
1977
1991
|
| Refresh failed | `token-refresh-failed account=<id> reason=<err>` (terminal) |
|
|
@@ -1979,10 +1993,27 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
|
|
|
1979
1993
|
| Mail search | `mail-search account=<id> query=<trunc-32> count=<N> elapsedMs=<N>` |
|
|
1980
1994
|
| Calendar list | `calendar-list account=<id> rangeDays=<N> count=<N> elapsedMs=<N>` |
|
|
1981
1995
|
| Calendar event | `calendar-event account=<id> eventId=<trunc-12> elapsedMs=<N>` |
|
|
1996
|
+
| Event created | `cal-create-request account=<id> subj=<trunc-64>` then `event-created account=<id> eventId=<trunc-16> status=201` (or `event-create-failed ... status=<N>`) |
|
|
1997
|
+
| Event updated | `cal-update-request account=<id> eventId=<trunc-16>` then `event-updated ... status=200` |
|
|
1998
|
+
| Event cancelled | `cal-cancel-request account=<id> eventId=<trunc-16> mode=<cancel-or-delete>` then `event-cancelled ... status=<N>` |
|
|
1999
|
+
| Event responded | `cal-respond-request account=<id> eventId=<trunc-16> action=<a>` then `event-responded ... status=202` |
|
|
2000
|
+
| Free/busy | `freebusy-request account=<id> requested=<N>` then `freebusy-result account=<id> requested=<N> resolved=<N>` (resolved counts error-free entries; resolved<requested flags a failed address) |
|
|
2001
|
+
| Scope insufficient | `scope-insufficient tool=<t> account=<id> missing=Calendars.ReadWrite` (stale read-only consent) |
|
|
1982
2002
|
| Contacts list | `contacts-list account=<id> count=<N> elapsedMs=<N>` |
|
|
1983
2003
|
| Mailbox info | `mailbox-info account=<id> tokenWithinRefreshWindow=<bool> folderCount=<N>` |
|
|
1984
|
-
| Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` |
|
|
2004
|
+
| Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` — writes flow through the same `callGraph` loop, so a failed write logs `graph-error` too |
|
|
1985
2005
|
| On-prem rejected | `on-prem-rejected account=<id> mailServer=<host>` (terminal) |
|
|
2006
|
+
| Scope insufficient | `scope-insufficient account=<id> tool=<t> missing=Mail.Send` (terminal — re-register to grant send) |
|
|
2007
|
+
| Send request | `send-request account=<id> to=<N> subjLen=<N>` |
|
|
2008
|
+
| Send args | `send-args account=<id> recipients=<N> hasBody=<bool>` |
|
|
2009
|
+
| Sent | `sent account=<id> status=202 messageId=<id-or-null>` |
|
|
2010
|
+
| Send failed | `send-failed account=<id> error=<msg>` |
|
|
2011
|
+
| Draft request | `draft-request account=<id>` |
|
|
2012
|
+
| Draft created | `draft-created account=<id> id=<draftId>` |
|
|
2013
|
+
| Draft failed | `draft-failed account=<id> error=<msg>` |
|
|
2014
|
+
| Draft-send request | `draft-send-request account=<id> id=<draftId>` |
|
|
2015
|
+
| Draft sent | `draft-sent account=<id> id=<draftId> status=202` |
|
|
2016
|
+
| Draft-send failed | `draft-send-failed account=<id> id=<draftId> error=<msg>` |
|
|
1986
2017
|
|
|
1987
2018
|
## Diagnostic paths
|
|
1988
2019
|
|
|
@@ -2006,10 +2037,12 @@ Latency triage: `mail-list count=0 elapsedMs<200` consistent → permissions iss
|
|
|
2006
2037
|
| `Outlook auth expired for account=X; run outlook-account-register` | Refresh-then-retry still got 401 | Re-register |
|
|
2007
2038
|
| `Outlook rate-limited without Retry-After hint` | Graph 429 with no backoff guidance | Wait + retry; if persistent, file bug |
|
|
2008
2039
|
| `Microsoft Graph does not support on-premises Exchange. Use earlier platform fixes (IMAP).` | Mailbox is on hybrid Exchange | Use the `email` plugin |
|
|
2040
|
+
| `Outlook Calendars.ReadWrite scope not granted ...; Re-run outlook-account-register ...` | Mailbox last consented on the old read-only calendar scope | Re-register to grant calendar write |
|
|
2041
|
+
| `Outlook Mail.Send scope not granted ...; Re-run outlook-account-register to grant send.` | Mailbox registered under the old read-only consent | Re-run `outlook-account-register` and consent to the send scopes |
|
|
2009
2042
|
|
|
2010
2043
|
## Out of scope
|
|
2011
2044
|
|
|
2012
|
-
|
|
2045
|
+
Mail move / flag / delete, contacts write, recurring-series occurrence editing, the `scheduling` Neo4j calendar and any auto-sync with it, OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. Mail send and draft are supported (`outlook-mail-send`, `outlook-draft`, `outlook-draft-send`), and the calendar is read plus control. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
|
|
2013
2046
|
|
|
2014
2047
|
---
|
|
2015
2048
|
# QuickBooks Online
|
|
@@ -1,25 +1,34 @@
|
|
|
1
1
|
# Outlook Plugin — Operator Guide
|
|
2
2
|
|
|
3
|
-
The `outlook` plugin gives the admin agent
|
|
3
|
+
The `outlook` plugin gives the admin agent access to Microsoft 365 / Outlook.com via Microsoft Graph. Mail is read, draft, and send; contacts are read-only; the calendar is read plus control (create, update, cancel, respond, free/busy). Per-account OAuth (device-code flow), encrypted token storage, automatic refresh.
|
|
4
4
|
|
|
5
5
|
## Quickstart
|
|
6
6
|
|
|
7
|
-
1. **
|
|
8
|
-
2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which
|
|
9
|
-
3. **
|
|
7
|
+
1. **No app to register.** The client ID ships with the brand (`brand.json#outlookClientId`), and the installer stamps it onto the session-manager env, so there is zero operator Azure work. On a brand that ships an empty value the plugin stays inert until its vendor app exists — see `platform/plugins/outlook/references/auth.md` for the one-time-per-brand vendor provisioning runbook (a vendor step, not an operator or end-user step), including setting **Allow public client flows** to Yes.
|
|
8
|
+
2. **Per account: register the Outlook account** — in admin chat, ask the agent to "register my Outlook account". The agent runs `outlook-account-register`, which returns a short user code and the URL `microsoft.com/devicelogin` and relays both to you.
|
|
9
|
+
3. **Consent on any device** — open `microsoft.com/devicelogin` on your phone or laptop, enter the code, sign in to your Microsoft account, and consent to the requested scopes (`offline_access`, `User.Read`, `Mail.ReadWrite`, `Mail.Send`, `Calendars.ReadWrite`, `Contacts.Read`). `Mail.Send` enables sending and `Calendars.ReadWrite` enables calendar control; a mailbox last consented on an older read-only scope set must re-register before send or any calendar write succeeds. The agent finishes by calling `outlook-account-register-poll`.
|
|
10
10
|
4. **Done.** Subsequent tool calls (mail, calendar, contacts) use the persisted refresh token transparently.
|
|
11
11
|
|
|
12
12
|
## Tools
|
|
13
13
|
|
|
14
14
|
| Tool | Purpose |
|
|
15
15
|
|------|---------|
|
|
16
|
-
| `outlook-account-register` |
|
|
16
|
+
| `outlook-account-register` | Start the device-code flow for this account. Returns a user code + `microsoft.com/devicelogin` URL immediately; does not block. |
|
|
17
|
+
| `outlook-account-register-poll` | Finish the device-code flow. One check per call: returns pending, registered, expired, or denied. |
|
|
17
18
|
| `outlook-mail-list` | Recent mail. Default top=25, folder=Inbox. |
|
|
18
19
|
| `outlook-mail-search` | Microsoft Graph `$search` over the mailbox. |
|
|
19
20
|
| `outlook-calendar-list` | Calendar events in next rangeDays days (default 7, max 365). |
|
|
20
21
|
| `outlook-calendar-event` | Full detail of a single event by id. |
|
|
22
|
+
| `outlook-calendar-create` | Book an event. Needs subject, start, end; optional body, attendees, location, isOnlineMeeting, recurrence. |
|
|
23
|
+
| `outlook-calendar-update` | Reschedule or edit an event. Pass eventId plus the fields to change. |
|
|
24
|
+
| `outlook-calendar-cancel` | Cancel a meeting (notifies attendees when the account organises it) or delete a personal appointment. Mode chosen automatically. |
|
|
25
|
+
| `outlook-calendar-respond` | Accept, decline, or tentatively accept an invite. |
|
|
26
|
+
| `outlook-calendar-freebusy` | Availability for one or more addresses over a window. |
|
|
21
27
|
| `outlook-contacts-list` | Top contacts. Default top=50. |
|
|
22
28
|
| `outlook-mailbox-info` | Health probe — auth state, refresh-window, folder count. |
|
|
29
|
+
| `outlook-mail-send` | Send a message (`POST /me/sendMail`). to/cc/bcc arrays, subject, body, isHtml. Success asserted on Graph 202. Needs `Mail.Send`. |
|
|
30
|
+
| `outlook-draft` | Create a draft in Drafts (`POST /me/messages`). Same body model. Returns the draft id. Needs `Mail.ReadWrite`. |
|
|
31
|
+
| `outlook-draft-send` | Send an existing draft by id (`POST /me/messages/{id}/send`). Graph consumes the draft, returns 202. Needs `Mail.Send`. |
|
|
23
32
|
|
|
24
33
|
## Observability
|
|
25
34
|
|
|
@@ -27,8 +36,13 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
|
|
|
27
36
|
|
|
28
37
|
| Event | Line shape |
|
|
29
38
|
|-------|------------|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
39
|
+
| Device code issued | `devicecode-issued account=<id> userCode=<code> verificationUri=<url> expiresSec=<N> intervalSec=<N>` |
|
|
40
|
+
| Poll (still pending) | `devicecode-poll account=<id> status=pending elapsedSec=<N>` |
|
|
41
|
+
| Device code expired | `devicecode-expired account=<id> elapsedSec=<N>` (terminal) |
|
|
42
|
+
| Consent denied | `devicecode-denied account=<id> elapsedSec=<N>` (terminal) |
|
|
43
|
+
| Pending-store census | `pending-store-census account=<id> live=<N>` |
|
|
44
|
+
| Pending cleared | `pending-cleared account=<id> verified=<bool>` |
|
|
45
|
+
| /me failed post-token | `me-failed account=<id> status=<N>` |
|
|
32
46
|
| Auth ok | `auth-ok account=<id> graphUserId=<id> scopes=<csv> tokenExpSec=<N>` |
|
|
33
47
|
| Token refreshed | `token-refreshed account=<id> oldExpSec=<N> newExpSec=<N>` |
|
|
34
48
|
| Refresh failed | `token-refresh-failed account=<id> reason=<err>` (terminal) |
|
|
@@ -36,10 +50,27 @@ All log lines start with `[outlook-mcp]` and write to `server.log`. They are key
|
|
|
36
50
|
| Mail search | `mail-search account=<id> query=<trunc-32> count=<N> elapsedMs=<N>` |
|
|
37
51
|
| Calendar list | `calendar-list account=<id> rangeDays=<N> count=<N> elapsedMs=<N>` |
|
|
38
52
|
| Calendar event | `calendar-event account=<id> eventId=<trunc-12> elapsedMs=<N>` |
|
|
53
|
+
| Event created | `cal-create-request account=<id> subj=<trunc-64>` then `event-created account=<id> eventId=<trunc-16> status=201` (or `event-create-failed ... status=<N>`) |
|
|
54
|
+
| Event updated | `cal-update-request account=<id> eventId=<trunc-16>` then `event-updated ... status=200` |
|
|
55
|
+
| Event cancelled | `cal-cancel-request account=<id> eventId=<trunc-16> mode=<cancel-or-delete>` then `event-cancelled ... status=<N>` |
|
|
56
|
+
| Event responded | `cal-respond-request account=<id> eventId=<trunc-16> action=<a>` then `event-responded ... status=202` |
|
|
57
|
+
| Free/busy | `freebusy-request account=<id> requested=<N>` then `freebusy-result account=<id> requested=<N> resolved=<N>` (resolved counts error-free entries; resolved<requested flags a failed address) |
|
|
58
|
+
| Scope insufficient | `scope-insufficient tool=<t> account=<id> missing=Calendars.ReadWrite` (stale read-only consent) |
|
|
39
59
|
| Contacts list | `contacts-list account=<id> count=<N> elapsedMs=<N>` |
|
|
40
60
|
| Mailbox info | `mailbox-info account=<id> tokenWithinRefreshWindow=<bool> folderCount=<N>` |
|
|
41
|
-
| Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` |
|
|
61
|
+
| Graph error | `graph-error account=<id> status=<N> code=<graphErrorCode> retryAfterMs=<N-or-null>` — writes flow through the same `callGraph` loop, so a failed write logs `graph-error` too |
|
|
42
62
|
| On-prem rejected | `on-prem-rejected account=<id> mailServer=<host>` (terminal) |
|
|
63
|
+
| Scope insufficient | `scope-insufficient account=<id> tool=<t> missing=Mail.Send` (terminal — re-register to grant send) |
|
|
64
|
+
| Send request | `send-request account=<id> to=<N> subjLen=<N>` |
|
|
65
|
+
| Send args | `send-args account=<id> recipients=<N> hasBody=<bool>` |
|
|
66
|
+
| Sent | `sent account=<id> status=202 messageId=<id-or-null>` |
|
|
67
|
+
| Send failed | `send-failed account=<id> error=<msg>` |
|
|
68
|
+
| Draft request | `draft-request account=<id>` |
|
|
69
|
+
| Draft created | `draft-created account=<id> id=<draftId>` |
|
|
70
|
+
| Draft failed | `draft-failed account=<id> error=<msg>` |
|
|
71
|
+
| Draft-send request | `draft-send-request account=<id> id=<draftId>` |
|
|
72
|
+
| Draft sent | `draft-sent account=<id> id=<draftId> status=202` |
|
|
73
|
+
| Draft-send failed | `draft-send-failed account=<id> id=<draftId> error=<msg>` |
|
|
43
74
|
|
|
44
75
|
## Diagnostic paths
|
|
45
76
|
|
|
@@ -63,7 +94,9 @@ Latency triage: `mail-list count=0 elapsedMs<200` consistent → permissions iss
|
|
|
63
94
|
| `Outlook auth expired for account=X; run outlook-account-register` | Refresh-then-retry still got 401 | Re-register |
|
|
64
95
|
| `Outlook rate-limited without Retry-After hint` | Graph 429 with no backoff guidance | Wait + retry; if persistent, file bug |
|
|
65
96
|
| `Microsoft Graph does not support on-premises Exchange. Use earlier platform fixes (IMAP).` | Mailbox is on hybrid Exchange | Use the `email` plugin |
|
|
97
|
+
| `Outlook Calendars.ReadWrite scope not granted ...; Re-run outlook-account-register ...` | Mailbox last consented on the old read-only calendar scope | Re-register to grant calendar write |
|
|
98
|
+
| `Outlook Mail.Send scope not granted ...; Re-run outlook-account-register to grant send.` | Mailbox registered under the old read-only consent | Re-run `outlook-account-register` and consent to the send scopes |
|
|
66
99
|
|
|
67
100
|
## Out of scope
|
|
68
101
|
|
|
69
|
-
|
|
102
|
+
Mail move / flag / delete, contacts write, recurring-series occurrence editing, the `scheduling` Neo4j calendar and any auto-sync with it, OneDrive / Files, push notifications, on-premises Exchange, M365 admin scopes (`User.Read.All`, `AuditLog.Read.All`), public-agent exposure, multi-tenant federation. Mail send and draft are supported (`outlook-mail-send`, `outlook-draft`, `outlook-draft-send`), and the calendar is read plus control. See `platform/plugins/outlook/PLUGIN.md` for the full out-of-scope list.
|
|
@@ -43,7 +43,7 @@ Microsoft mail does not go through the email plugin. Microsoft retired Basic aut
|
|
|
43
43
|
|
|
44
44
|
`email-provider-info` recognises both — the static consumer domains, and a custom M365 domain via MX detection — and returns the **redirect** outcome rather than IMAP hosts. `email-setup` likewise refuses a Microsoft address (even if you hand it `outlook.office365.com` hosts) and points back here; it never attempts a connection.
|
|
45
45
|
|
|
46
|
-
Connect the account through the **`outlook` Graph plugin** instead: run `outlook-account-register`. That plugin authorises over OAuth — it opens a Microsoft sign-in for the operator (in the headless browser) and stores the token; there is no password or app password to ask for. After registration, Microsoft mail is read with the `outlook-mail-list` / `outlook-mail-search` tools, not `email-read` / `email-search`.
|
|
46
|
+
Connect the account through the **`outlook` Graph plugin** instead: run `outlook-account-register`. That plugin authorises over OAuth — it opens a Microsoft sign-in for the operator (in the headless browser) and stores the token; there is no password or app password to ask for, and there is no Azure app to register — the vendor client ID ships with the brand. After registration, Microsoft mail is read with the `outlook-mail-list` / `outlook-mail-search` tools, not `email-read` / `email-search`. Sending and drafting are available too, over Microsoft Graph rather than SMTP: `outlook-mail-send`, `outlook-draft`, and `outlook-draft-send` (not `email-send` / `email-draft`). A mailbox registered before send existed re-registers once to grant the send scopes. (If a brand ships no vendor Outlook app yet, `outlook-account-register` reports the client ID is not configured and Microsoft mail cannot be connected on that brand.)
|
|
47
47
|
|
|
48
48
|
## Multiple Mailboxes
|
|
49
49
|
|
|
@@ -47,7 +47,7 @@ Omit `targetAccountId`. Every tool takes a `path` relative to your account direc
|
|
|
47
47
|
|
|
48
48
|
## Cross-account (house admin only)
|
|
49
49
|
|
|
50
|
-
Pass `targetAccountId` to operate on a sub-account's directory. This is honoured only for a house-scoped admin session. A sub-account, specialist, or public session that passes `targetAccountId` is refused with `cross-account-denied`; an
|
|
50
|
+
Pass `targetAccountId` to operate on a sub-account's directory. This is honoured only for a house-scoped admin session. A sub-account, specialist, or public session that passes `targetAccountId` is refused with `cross-account-denied`; an account id that is not provisioned on disk is refused with `cross-account-target-not-provisioned`. The validity check re-scans the accounts dir on a miss, so a sub-account created at runtime this session resolves without a service restart (a stale boot-time cache no longer masks it). Use this to inspect or repair a client account's files from the house session without switching accounts.
|
|
51
51
|
|
|
52
52
|
## Boundaries
|
|
53
53
|
|
|
@@ -38,9 +38,23 @@ describe("resolveRoot — fail-closed gate", () => {
|
|
|
38
38
|
const r = resolveRoot(clientCtx(), HOUSE, "file-read");
|
|
39
39
|
expect(r).toEqual({ reject: "cross-account-denied" });
|
|
40
40
|
});
|
|
41
|
-
it("house scope + unknown target → cross-account-
|
|
41
|
+
it("house scope + unknown target → cross-account-target-not-provisioned", () => {
|
|
42
42
|
const r = resolveRoot(houseCtx(), GHOST, "file-read");
|
|
43
|
-
expect(r).toEqual({ reject: "cross-account-
|
|
43
|
+
expect(r).toEqual({ reject: "cross-account-target-not-provisioned" });
|
|
44
|
+
});
|
|
45
|
+
it("house scope + target created after the cache warmed → resolves via re-scan (Task 1471)", () => {
|
|
46
|
+
// Warm the enumeration cache for this accountsDir (GHOST absent at "boot").
|
|
47
|
+
expect(resolveRoot(houseCtx(), GHOST, "file-read")).toEqual({
|
|
48
|
+
reject: "cross-account-target-not-provisioned",
|
|
49
|
+
});
|
|
50
|
+
// Provision GHOST at runtime, after the boot snapshot.
|
|
51
|
+
mkdirSync(join(accountsDir, GHOST), { recursive: true });
|
|
52
|
+
writeFileSync(join(accountsDir, GHOST, "account.json"), JSON.stringify({ accountId: GHOST }));
|
|
53
|
+
// The miss re-scans disk and now resolves — no restart.
|
|
54
|
+
expect(resolveRoot(houseCtx(), GHOST, "file-read")).toEqual({
|
|
55
|
+
root: resolve(accountsDir, GHOST),
|
|
56
|
+
resolved: GHOST,
|
|
57
|
+
});
|
|
44
58
|
});
|
|
45
59
|
it("house scope + target == own → own root (self allowed)", () => {
|
|
46
60
|
const r = resolveRoot(houseC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CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;QACxD,MAAM,IAAI,GAAG,OAAO,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;QACzC,WAAW,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC9C,MAAM,CAAC,GAAG,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAChF,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -25,7 +25,7 @@ export type ResolveRootResult = {
|
|
|
25
25
|
root: string;
|
|
26
26
|
resolved: string;
|
|
27
27
|
} | {
|
|
28
|
-
reject: "cross-account-denied" | "cross-account-invalid-target";
|
|
28
|
+
reject: "cross-account-denied" | "cross-account-invalid-target" | "cross-account-target-not-provisioned";
|
|
29
29
|
};
|
|
30
30
|
/**
|
|
31
31
|
* Resolve the account directory a tool call acts on, gated fail-closed. Emits
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED,MAAM,WAAW,GAAG;IAClB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;
|
|
1
|
+
{"version":3,"file":"scope.d.ts","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,GAAG,IAAI,CAK1E;AAED,MAAM,WAAW,GAAG;IAClB,wDAAwD;IACxD,YAAY,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,6EAA6E;IAC7E,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAClC;IACE,MAAM,EACF,sBAAsB,GACtB,8BAA8B,GAC9B,sCAAsC,CAAC;CAC5C,CAAC;AAEN;;;;;GAKG;AACH,wBAAgB,WAAW,CACzB,GAAG,EAAE,GAAG,EACR,eAAe,EAAE,MAAM,GAAG,SAAS,EACnC,IAAI,EAAE,MAAM,GACX,iBAAiB,CA2BnB;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAenE"}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
import { resolve, dirname, sep } from "node:path";
|
|
16
16
|
import { realpathSync, existsSync } from "node:fs";
|
|
17
17
|
import { resolveEffectiveAccountCore } from "../../../../../lib/account-scope/dist/index.js";
|
|
18
|
-
import {
|
|
18
|
+
import { isProvisionedAccount } from "../../../../../lib/account-enumeration/dist/index.js";
|
|
19
19
|
const short = (id) => id.slice(0, 8);
|
|
20
20
|
/**
|
|
21
21
|
* Read HOUSE_ADMIN_SCOPE for the plugin, fail-closed. HOUSE_ADMIN_SCOPE is the
|
|
@@ -46,8 +46,13 @@ export function readPluginHouseScope(env) {
|
|
|
46
46
|
* must contain every path within.
|
|
47
47
|
*/
|
|
48
48
|
export function resolveRoot(ctx, targetAccountId, tool) {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
// Re-scan-on-miss (Task 1471): a sub-account created at runtime after this
|
|
50
|
+
// plugin process booted is absent from the boot-time cached set; the miss
|
|
51
|
+
// re-scans disk once so a live-created target resolves without a restart. A
|
|
52
|
+
// reject therefore means the target is genuinely not on disk — surfaced as
|
|
53
|
+
// the distinct `cross-account-target-not-provisioned` reason.
|
|
54
|
+
const isValidAccountId = (id) => isProvisionedAccount(ctx.accountsDir, id);
|
|
55
|
+
const eff = resolveEffectiveAccountCore({ ownAccountId: ctx.ownAccountId, houseScope: ctx.houseScope, targetAccountId }, isValidAccountId, "cross-account-target-not-provisioned");
|
|
51
56
|
const targetField = targetAccountId ? short(targetAccountId) : "self";
|
|
52
57
|
const houseField = ctx.houseScope ? "true" : "false";
|
|
53
58
|
if ("reject" in eff) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,8EAA8E;AAC9E,+EAA+E;AAC/E,4EAA4E;AAC5E,mDAAmD;AACnD,EAAE;AACF,8EAA8E;AAC9E,gFAAgF;AAChF,yEAAyE;AACzE,8EAA8E;AAC9E,2CAA2C;AAC3C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"scope.js","sourceRoot":"","sources":["../../src/lib/scope.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,EAAE;AACF,yEAAyE;AACzE,uEAAuE;AACvE,8EAA8E;AAC9E,+EAA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,CACrG,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,aAAa,CAAC,CAAC;IACjC,CAAC,CAAC;IACF,IAAI,GAAG,KAAK,QAAQ,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;QAAE,MAAM,EAAE,CAAC;IAClE,IAAI,QAAQ,GAAG,GAAG,CAAC;IACnB,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC;QAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC3D,MAAM,YAAY,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC;IAC5C,IAAI,YAAY,KAAK,QAAQ,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,CAAC;QAAE,MAAM,EAAE,CAAC;IACpF,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -72,10 +72,10 @@ describe("file handlers — cross-account gate", () => {
|
|
|
72
72
|
// and it did not read the house file
|
|
73
73
|
expect(text(r)).not.toContain("accountId");
|
|
74
74
|
});
|
|
75
|
-
it("an unknown target is
|
|
75
|
+
it("an unknown target is target-not-provisioned", () => {
|
|
76
76
|
const r = fileList({ targetAccountId: "99999999-9999-4999-8999-999999999999" }, house());
|
|
77
77
|
expect(r.isError).toBe(true);
|
|
78
|
-
expect(text(r)).toContain("cross-account-
|
|
78
|
+
expect(text(r)).toContain("cross-account-target-not-provisioned");
|
|
79
79
|
});
|
|
80
80
|
});
|
|
81
81
|
describe("file handlers — traversal guard", () => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.test.js","sourceRoot":"","sources":["../../../src/tools/__tests__/handlers.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,UAAU,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AAC;QAClF,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;QAC3D,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC5E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,0DAA0D,EAAE,GAAG,EAAE;QAClE,MAAM,CAAC,GAAG,QAAQ,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;QACpD,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,+BAA+B,CAAC,CAAC;IAC7D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -187,7 +187,7 @@ Writes targeting `:Person`, `:UserProfile`, `:AdminUser`, `:Organization`, `:Loc
|
|
|
187
187
|
|
|
188
188
|
## Cross-account access (house admin) — `targetAccountId`
|
|
189
189
|
|
|
190
|
-
The memory tools whose Neo4j read/write re-scopes on the resolved account accept an optional `targetAccountId`. A house-scoped `role:admin` session sets it to read or write a **sub-account's** subgraph instead of its own; omitting it is byte-identical to the pre-existing own-account behaviour. Only a house-scoped session may set it: a sub-account or public session that passes `targetAccountId` is rejected `cross-account-denied`, and a house session naming an account that
|
|
190
|
+
The memory tools whose Neo4j read/write re-scopes on the resolved account accept an optional `targetAccountId`. A house-scoped `role:admin` session sets it to read or write a **sub-account's** subgraph instead of its own; omitting it is byte-identical to the pre-existing own-account behaviour. Only a house-scoped session may set it: a sub-account or public session that passes `targetAccountId` is rejected `cross-account-denied`, and a house session naming an account that is not provisioned on this install is rejected `cross-account-target-not-provisioned`. The validity check re-scans the accounts dir on a miss, so a sub-account created at runtime this session resolves without a service restart — a stale boot-time enumeration cache no longer masks it, and the distinct reason tells a genuine wrong/typo id apart from that (now-eliminated) created-after-boot case. Resolution runs through the shared `resolveEffectiveAccount` primitive — there is no house fallback and no local re-implementation. Each call that sets `targetAccountId` emits one `[xacct] op=call tool=<t> caller=<own8> target=<tgt8> houseScope=<bool> decision=<allow|deny> reason=<…>` line before the graph call, and the tool's own `[memory-<t>] [<accountId>]` line prints the resolved (target) id as a wrong-subgraph cross-check.
|
|
191
191
|
|
|
192
192
|
`profile-read/update/delete` also take `targetAccountId`. They key on `userId` as well as `accountId`, so cross-account they cannot use the caller's boot `USER_ID` (a house operator has no node in the sub-account subgraph). Instead they resolve the target sub-account's **owner** `AdminUser` — the single identity seeded per account (`role:"owner"`, one per account) — and attribute the read/write to it, emitting `[xacct] op=identity tool=profile-* target=<sub8> resolved-userId=<owner8>`. A target with no owner `AdminUser` is rejected loudly (never a wrong-identity write). `profile-update` bootstraps the owner's `UserProfile` on this path so a preference-only write lands. This covers preferences and every `profileFields` value (name via `givenName`/`familyName`, `role`, `timezone`, `locale`, `expertise`); no `Person` node or PIN is required. Setting `personFields` identity (email/telephone → the owner `Person`) cross-account also lands: when the owner `Person`/`OWNS` edge is absent (a sub-account is seeded with an `AdminUser` but no `Person`), `profile-update` bootstraps it, MERGEing the owner `Person` off the owner `AdminUser` via the `OWNS` edge — keyed on the `OWNS` edge + `accountId` (the same identity key `profile-read/update` resolve through), so the one existing owner `Person` is reused. It is never keyed on phone (which keys the separate access-grant `Person`, `HAS_ACCESS` not `OWNS`), so that node is never matched. Own-account is unchanged: a `personFields` write with a missing `OWNS`-`Person` still loud-fails, since that edge is a real post-PIN invariant there. The bootstrap does not replicate the PIN-setup identity `Person` in full (no name-based reuse, no embedding — this path carries only email/telephone); the residual `(accountId, email/telephone)` uniqueness, concurrency, and embedding gapsremain.
|
|
193
193
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-testable.d.ts","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC;AAClF,MAAM,MAAM,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"index-testable.d.ts","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAQA,KAAK,aAAa,GAAG;IAAE,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAAC,OAAO,EAAE,IAAI,CAAA;CAAE,CAAC;AAClF,MAAM,MAAM,WAAW,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,aAAa,CAAA;CAAE,CAAC;AAmC5E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE;IAC3C,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC;IACjC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,WAAW,CA6BrE"}
|
|
@@ -15,11 +15,17 @@ function noAccountText(toolName) {
|
|
|
15
15
|
`(plugin-system metadata-only mode). Per-account graph access requires ACCOUNT_ID at spawn.`);
|
|
16
16
|
}
|
|
17
17
|
/** Operator-facing reject messages. Each CONTAINS its reject code so the
|
|
18
|
-
* reason is greppable and the agent sees why the call was refused.
|
|
18
|
+
* reason is greppable and the agent sees why the call was refused. The
|
|
19
|
+
* not-provisioned message names the fresh disk re-scan (Task 1471) so an
|
|
20
|
+
* operator reads it as "genuinely absent on disk", not a stale-cache miss. */
|
|
19
21
|
function rejectText(reason, target8) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
22
|
+
if (reason === "cross-account-denied") {
|
|
23
|
+
return `cross-account-denied: only a house-scoped admin session may set targetAccountId.`;
|
|
24
|
+
}
|
|
25
|
+
if (reason === "cross-account-target-not-provisioned") {
|
|
26
|
+
return `cross-account-target-not-provisioned: "${target8}…" is not provisioned on this install (checked disk fresh, not just the boot cache).`;
|
|
27
|
+
}
|
|
28
|
+
return `cross-account-invalid-target: "${target8}…" is not a valid account on this install.`;
|
|
23
29
|
}
|
|
24
30
|
/**
|
|
25
31
|
* Build the per-tool account resolver. `accountId` / `houseScope` are the boot
|
|
@@ -43,7 +49,10 @@ export function makeResolveToolAccount(deps) {
|
|
|
43
49
|
write(`[memory] tool=${toolName} refuse reason=no-account-context\n`);
|
|
44
50
|
return { reject: errContent(noAccountText(toolName)) };
|
|
45
51
|
}
|
|
46
|
-
const eff = resolveEffectiveAccountCore({ ownAccountId: deps.accountId, houseScope: deps.houseScope, targetAccountId }, deps.isValid
|
|
52
|
+
const eff = resolveEffectiveAccountCore({ ownAccountId: deps.accountId, houseScope: deps.houseScope, targetAccountId }, deps.isValid,
|
|
53
|
+
// `deps.isValid` re-scans disk on a miss (isProvisionedAccount), so a
|
|
54
|
+
// reject here means the target is genuinely not on disk — Task 1471.
|
|
55
|
+
"cross-account-target-not-provisioned");
|
|
47
56
|
if (targetAccountId) {
|
|
48
57
|
const decision = "reject" in eff ? "deny" : "allow";
|
|
49
58
|
const reason = "reject" in eff ? eff.reject : "ok";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-testable.js","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,8BAA8B;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAK1F,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;AAChF,CAAC;AAED;oEACoE;AACpE,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,CACL,GAAG,QAAQ,qEAAqE;QAChF,4FAA4F,CAC7F,CAAC;AACJ,CAAC;AAED;
|
|
1
|
+
{"version":3,"file":"index-testable.js","sourceRoot":"","sources":["../src/index-testable.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,EAAE;AACF,4EAA4E;AAC5E,6EAA6E;AAC7E,0EAA0E;AAC1E,8BAA8B;AAC9B,OAAO,EAAE,2BAA2B,EAAE,MAAM,6CAA6C,CAAC;AAK1F,SAAS,UAAU,CAAC,IAAY;IAC9B,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAa,EAAE,CAAC;AAChF,CAAC;AAED;oEACoE;AACpE,SAAS,aAAa,CAAC,QAAgB;IACrC,OAAO,CACL,GAAG,QAAQ,qEAAqE;QAChF,4FAA4F,CAC7F,CAAC;AACJ,CAAC;AAED;;;+EAG+E;AAC/E,SAAS,UAAU,CACjB,MAG0C,EAC1C,OAAe;IAEf,IAAI,MAAM,KAAK,sBAAsB,EAAE,CAAC;QACtC,OAAO,kFAAkF,CAAC;IAC5F,CAAC;IACD,IAAI,MAAM,KAAK,sCAAsC,EAAE,CAAC;QACtD,OAAO,0CAA0C,OAAO,sFAAsF,CAAC;IACjJ,CAAC;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,QAAQ,WAAW,MAAM,IAAI,CAC5C,CAAC;QACJ,CAAC;QACD,IAAI,QAAQ,IAAI,GAAG,EAAE,CAAC;YACpB,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC7F,CAAC;QACD,OAAO,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE,CAAC;IACtC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -61,7 +61,7 @@ import { embed } from "./lib/embeddings.js";
|
|
|
61
61
|
import { notTrashed } from "../../../../lib/graph-trash/dist/index.js";
|
|
62
62
|
import { lifelineTool } from "../../../../lib/mcp-lifeline/dist/index.js";
|
|
63
63
|
import { resolve } from "node:path";
|
|
64
|
-
import { enumerateValidAccountIds } from "../../../../lib/account-enumeration/dist/index.js";
|
|
64
|
+
import { enumerateValidAccountIds, isProvisionedAccount } from "../../../../lib/account-enumeration/dist/index.js";
|
|
65
65
|
import { readHouseAdminScope } from "../../../../lib/account-scope/dist/index.js";
|
|
66
66
|
import { makeResolveToolAccount } from "./index-testable.js";
|
|
67
67
|
const server = new McpServer({
|
|
@@ -100,7 +100,10 @@ process.stderr.write(`[xacct] boot houseScope=${houseScope ? "yes" : "no"} accou
|
|
|
100
100
|
const resolveToolAccount = makeResolveToolAccount({
|
|
101
101
|
accountId,
|
|
102
102
|
houseScope,
|
|
103
|
-
|
|
103
|
+
// Re-scan-on-miss (Task 1471): a sub-account created at runtime after this
|
|
104
|
+
// MCP child booted is absent from the boot-time cached set; the miss re-scans
|
|
105
|
+
// disk once so a live-created target resolves without a service restart.
|
|
106
|
+
isValid: (id) => isProvisionedAccount(accountsDir, id),
|
|
104
107
|
});
|
|
105
108
|
// Single source for the operator-facing targetAccountId description — the LLM
|
|
106
109
|
// reads this verbatim, so it must not drift across the 35 targetable tools.
|