@rubytech/create-maxy-code 0.1.461 → 0.1.463
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/graph-mcp/dist/index.d.ts +2 -1
- package/payload/platform/lib/graph-mcp/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/graph-mcp/dist/index.js +14 -22
- package/payload/platform/lib/graph-mcp/dist/index.js.map +1 -1
- package/payload/platform/lib/graph-mcp/src/index.ts +15 -22
- package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts +8 -7
- package/payload/platform/lib/mcp-spawn-tee/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js +19 -19
- package/payload/platform/lib/mcp-spawn-tee/dist/index.js.map +1 -1
- package/payload/platform/lib/mcp-spawn-tee/src/__tests__/spawn-tee.test.ts +34 -5
- package/payload/platform/lib/mcp-spawn-tee/src/index.ts +22 -19
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts +35 -17
- package/payload/platform/lib/mcp-stderr-tee/dist/index.d.ts.map +1 -1
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js +41 -48
- package/payload/platform/lib/mcp-stderr-tee/dist/index.js.map +1 -1
- package/payload/platform/lib/mcp-stderr-tee/src/index.ts +42 -51
- package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js +27 -0
- package/payload/platform/lib/storage-broker/dist/__tests__/audit.test.js.map +1 -1
- package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js +49 -0
- package/payload/platform/lib/storage-broker/dist/__tests__/cf-exec.test.js.map +1 -1
- package/payload/platform/lib/storage-broker/dist/audit.d.ts +11 -0
- package/payload/platform/lib/storage-broker/dist/audit.d.ts.map +1 -1
- package/payload/platform/lib/storage-broker/dist/audit.js +16 -0
- package/payload/platform/lib/storage-broker/dist/audit.js.map +1 -1
- package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts +18 -0
- package/payload/platform/lib/storage-broker/dist/cf-exec.d.ts.map +1 -1
- package/payload/platform/lib/storage-broker/dist/cf-exec.js +77 -0
- package/payload/platform/lib/storage-broker/dist/cf-exec.js.map +1 -1
- package/payload/platform/lib/storage-broker/dist/house-scoped-token.js +3 -0
- package/payload/platform/lib/storage-broker/dist/house-scoped-token.js.map +1 -1
- package/payload/platform/lib/storage-broker/dist/registry.d.ts +1 -1
- package/payload/platform/lib/storage-broker/dist/registry.d.ts.map +1 -1
- package/payload/platform/lib/storage-broker/dist/registry.js.map +1 -1
- package/payload/platform/lib/storage-broker/src/__tests__/audit.test.ts +32 -1
- package/payload/platform/lib/storage-broker/src/__tests__/cf-exec.test.ts +61 -0
- package/payload/platform/lib/storage-broker/src/audit.ts +45 -0
- package/payload/platform/lib/storage-broker/src/cf-exec.ts +91 -0
- package/payload/platform/lib/storage-broker/src/house-scoped-token.ts +3 -0
- package/payload/platform/lib/storage-broker/src/registry.ts +5 -1
- package/payload/platform/plugins/admin/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/admin/skills/platform-architecture/SKILL.md +23 -12
- package/payload/platform/plugins/aeo/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/browser/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/cloudflare/PLUGIN.md +1 -1
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js +5 -5
- package/payload/platform/plugins/cloudflare/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/cloudflare/references/hosting-sites.md +2 -0
- package/payload/platform/plugins/cloudflare/skills/calendar-site/SKILL.md +1 -1
- package/payload/platform/plugins/cloudflare/skills/site-deploy/SKILL.md +2 -0
- package/payload/platform/plugins/connector/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/contacts/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/docs/references/admin-session.md +3 -3
- package/payload/platform/plugins/docs/references/cloudflare.md +2 -0
- package/payload/platform/plugins/docs/references/internals.md +1 -1
- package/payload/platform/plugins/docs/references/outlook-guide.md +11 -4
- package/payload/platform/plugins/docs/references/plugins-guide.md +8 -6
- package/payload/platform/plugins/email/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/filesystem/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/graph-viewer/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/memory/PLUGIN.md +1 -1
- package/payload/platform/plugins/memory/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js +2 -2
- package/payload/platform/plugins/memory/mcp/dist/lib/log-ingest.js.map +1 -1
- package/payload/platform/plugins/outlook/.claude-plugin/plugin.json +1 -1
- package/payload/platform/plugins/outlook/PLUGIN.md +2 -2
- package/payload/platform/plugins/outlook/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts +2 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js +238 -0
- package/payload/platform/plugins/outlook/mcp/dist/__tests__/draft-threaded.test.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/index.js +9 -5
- package/payload/platform/plugins/outlook/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts +1 -6
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js +9 -17
- package/payload/platform/plugins/outlook/mcp/dist/lib/message.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.d.ts +56 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.d.ts.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.js +40 -0
- package/payload/platform/plugins/outlook/mcp/dist/lib/recipients.js.map +1 -0
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js +1 -3
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft-edit.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts +58 -9
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js +97 -18
- package/payload/platform/plugins/outlook/mcp/dist/tools/draft.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js +1 -3
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-fetch-body.js.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.d.ts.map +1 -1
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js +3 -18
- package/payload/platform/plugins/outlook/mcp/dist/tools/mail-reply.js.map +1 -1
- package/payload/platform/plugins/outlook/skills/outlook/SKILL.md +5 -2
- package/payload/platform/plugins/quickbooks/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/replicate/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/scheduling/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js +6 -32
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/__tests__/agent-turn-dispatch.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js +10 -30
- package/payload/platform/plugins/scheduling/mcp/dist/scripts/agent-turn-dispatch.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-cancel.test.js +24 -21
- package/payload/platform/plugins/scheduling/mcp/dist/tools/__tests__/schedule-cancel.test.js.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts +27 -18
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.d.ts.map +1 -1
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js +31 -27
- package/payload/platform/plugins/scheduling/mcp/dist/tools/schedule-cancel.js.map +1 -1
- package/payload/platform/plugins/storage-broker/PLUGIN.md +9 -1
- package/payload/platform/plugins/storage-broker/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.d.ts.map +1 -1
- package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js +16 -5
- package/payload/platform/plugins/storage-broker/mcp/dist/confine-path.js.map +1 -1
- package/payload/platform/plugins/storage-broker/mcp/dist/index.js +49 -0
- package/payload/platform/plugins/storage-broker/mcp/dist/index.js.map +1 -1
- package/payload/platform/plugins/telegram/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/url-get/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/voice-mirror/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/web-designer/PLUGIN.md +1 -1
- package/payload/platform/plugins/web-designer/commands/website.md +6 -0
- package/payload/platform/plugins/web-designer/skills/web-design/references/deploy.md +12 -0
- package/payload/platform/plugins/whatsapp/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/work/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/plugins/workflows/lib/mcp-spawn-tee/index.js +19 -19
- package/payload/platform/scripts/__tests__/logs-rotate.test.sh +24 -20
- package/payload/platform/scripts/logs-read.sh +31 -0
- package/payload/platform/scripts/logs-rotate.sh +21 -18
- 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 +2 -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/pty-spawner.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js +37 -0
- package/payload/platform/services/claude-session-manager/dist/pty-spawner.js.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts +5 -3
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.d.ts.map +1 -1
- package/payload/platform/services/claude-session-manager/dist/rc-daemon.js.map +1 -1
- package/payload/platform/services/telegram-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/telegram-channel/dist/server.js +0 -4
- package/payload/platform/services/telegram-channel/dist/server.js.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/webchat-channel/dist/server.js +0 -4
- package/payload/platform/services/webchat-channel/dist/server.js.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.d.ts.map +1 -1
- package/payload/platform/services/whatsapp-channel/dist/server.js +0 -4
- package/payload/platform/services/whatsapp-channel/dist/server.js.map +1 -1
- package/payload/server/{chunk-JXWFVE5X.js → chunk-BBSPFN45.js} +65 -0
- package/payload/server/public/assets/{AdminLoginScreens-BFbpkEUS.js → AdminLoginScreens-Bed8SDxY.js} +1 -1
- package/payload/server/public/assets/{AdminShell-CdOGObaZ.js → AdminShell-BLh9O6dn.js} +1 -1
- package/payload/server/public/assets/{Checkbox-RFD_F0c0.js → Checkbox-BC_KSbpS.js} +1 -1
- package/payload/server/public/assets/{admin-CYGdL-1O.js → admin-DfWgJVI3.js} +1 -1
- package/payload/server/public/assets/{browser-DVfa_plj.js → browser-C0vkv-hH.js} +1 -1
- package/payload/server/public/assets/{calendar-JC_Dxa4n.js → calendar-_pfHw0Hp.js} +1 -1
- package/payload/server/public/assets/chat-DYT5H81o.js +1 -0
- package/payload/server/public/assets/chevron-left-BnpVBu51.js +1 -0
- package/payload/server/public/assets/data-CR-fbPWr.js +1 -0
- package/payload/server/public/assets/{graph-hBUrRSkr.js → graph-BZiudUGr.js} +1 -1
- package/payload/server/public/assets/{graph-labels-CHh6zs8t.js → graph-labels-BzmmJwCR.js} +1 -1
- package/payload/server/public/assets/{maximize-2-DjxE4rm9.js → maximize-2-Bhdsv0U-.js} +1 -1
- package/payload/server/public/assets/{operator-BqU9SQuu.js → operator-gm2eP4r6.js} +1 -1
- package/payload/server/public/assets/{page-DiQhU6lD.js → page-8AB3jUa_.js} +1 -1
- package/payload/server/public/assets/page-BoPorLg-.js +32 -0
- package/payload/server/public/assets/{public-Cu_eALgY.js → public-DqJk6qgW.js} +1 -1
- package/payload/server/public/assets/{rotate-ccw-F9DsSTSJ.js → rotate-ccw-D_5cETGt.js} +1 -1
- package/payload/server/public/assets/{tasks-CE-D0f50.js → tasks-EyKLXINi.js} +1 -1
- package/payload/server/public/assets/{time-entry-format-D2rsWhov.js → time-entry-format-DAwmmR3i.js} +1 -1
- package/payload/server/public/assets/{useCopyFeedback-QxOmoobV.js → useCopyFeedback-rOWd_lzl.js} +1 -1
- package/payload/server/public/assets/{useSelectionMode-RIzNqFjV.js → useSelectionMode-DDmLmPph.js} +1 -1
- package/payload/server/public/assets/{useSubAccountSwitcher-BW_fK1Nt.css → useSubAccountSwitcher-pu0jjLCz.css} +1 -1
- package/payload/server/public/assets/{useVoiceRecorder-WrWurSYI.js → useVoiceRecorder-azG8zSUI.js} +1 -1
- package/payload/server/public/browser.html +5 -5
- package/payload/server/public/calendar.html +6 -6
- package/payload/server/public/chat.html +12 -12
- package/payload/server/public/data.html +10 -10
- package/payload/server/public/graph.html +11 -11
- package/payload/server/public/index.html +13 -13
- package/payload/server/public/operator.html +14 -14
- package/payload/server/public/public.html +12 -12
- package/payload/server/public/tasks.html +5 -5
- package/payload/server/server.js +596 -235
- package/payload/server/{src-4F37OHLK.js → src-YLGAZY36.js} +5 -1
- package/payload/server/public/assets/chat-Yf8Nkop8.js +0 -1
- package/payload/server/public/assets/chevron-left-CAiAUBxO.js +0 -1
- package/payload/server/public/assets/data-hqdYXaEn.js +0 -1
- package/payload/server/public/assets/page-B4c4_4HP.js +0 -32
- /package/payload/server/public/assets/{useSubAccountSwitcher-wo_qGW-I.js → useSubAccountSwitcher-CU-lOxTd.js} +0 -0
|
@@ -2,32 +2,41 @@ export interface ScheduleCancelParams {
|
|
|
2
2
|
accountId: string;
|
|
3
3
|
eventId: string;
|
|
4
4
|
note?: string;
|
|
5
|
-
/**
|
|
6
|
-
* (`process.env.SESSION_ID`), NOT an agent-supplied value.
|
|
7
|
-
*
|
|
8
|
-
*
|
|
5
|
+
/** The cancelling turn's real, platform-injected session id
|
|
6
|
+
* (`process.env.SESSION_ID`), NOT an agent-supplied value. Accepted and
|
|
7
|
+
* currently unread: the self-cancel discriminator it fed is disarmed pending
|
|
8
|
+
* Task 1752, which needs the turn's dispatched eventId rather than a session
|
|
9
|
+
* id. Kept on the boundary so the caller does not churn. */
|
|
9
10
|
callerSessionId?: string;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
* Task 1516 /
|
|
13
|
-
*
|
|
14
|
-
* as `lastDispatchSessionId` at dispatch time. `byOwnDispatch` is an exact match
|
|
15
|
-
* of the cancelling seat's real (platform-injected) SESSION_ID to that stamp: the
|
|
16
|
-
* autonomous self-cancel loop this alarm exists to catch.
|
|
13
|
+
* Task 1516 / 1746 — the pure core of the self-cancel alarm. `isAgentDispatch`
|
|
14
|
+
* still reports whether the cancelled event carries an agent dispatch.
|
|
17
15
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
16
|
+
* `byOwnDispatch` is DISARMED and always false, pending Task 1752.
|
|
17
|
+
*
|
|
18
|
+
* It used to compare the caller's SESSION_ID to a `lastDispatchSessionId` stamp
|
|
19
|
+
* (Task 1526), which discriminated only because a scheduled firing ran its own
|
|
20
|
+
* salted per-firing seat. Task 1746 removed that seat: it spawned a second
|
|
21
|
+
* session for the sender, whose channel server then attached under the sender's
|
|
22
|
+
* own hub key and swallowed their real messages, splitting one conversation
|
|
23
|
+
* across two sessions. With one session per sender, the dispatcher would stamp
|
|
24
|
+
* the sender's own session id and the operator cancels from that same session,
|
|
25
|
+
* so the comparison would be ALWAYS TRUE — stamping `cancelledByOwnDispatchAt`
|
|
26
|
+
* on every operator cancel and reporting each as an autonomous loop.
|
|
27
|
+
*
|
|
28
|
+
* An alarm that always fires is worse than one that never does, so it is
|
|
29
|
+
* disarmed rather than left lying. This under-counts: a real self-cancel loop is
|
|
30
|
+
* no longer detected. That is the safe direction — it never invents one — and it
|
|
31
|
+
* is deliberate, not an oversight. Task 1752 restores detection from the turn's
|
|
32
|
+
* own dispatched eventId, which needs a turn-boundary seam this file does not
|
|
33
|
+
* have. Never throws.
|
|
25
34
|
*/
|
|
26
35
|
export declare function classifySelfCancel(params: {
|
|
27
|
-
|
|
36
|
+
/** The event being cancelled. */
|
|
37
|
+
eventId: string;
|
|
28
38
|
agentChannel: string | null;
|
|
29
39
|
agentDestination: string | null;
|
|
30
|
-
lastDispatchSessionId: string | null;
|
|
31
40
|
}): {
|
|
32
41
|
isAgentDispatch: boolean;
|
|
33
42
|
byOwnDispatch: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd
|
|
1
|
+
{"version":3,"file":"schedule-cancel.d.ts","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;iEAI6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE;IACzC,iCAAiC;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC,GAAG;IAAE,eAAe,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAMvD;AAED,wBAAsB,cAAc,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAkDhF"}
|
|
@@ -1,33 +1,36 @@
|
|
|
1
1
|
import { getSession } from "../lib/neo4j.js";
|
|
2
2
|
/**
|
|
3
|
-
* Task 1516 /
|
|
4
|
-
*
|
|
5
|
-
* as `lastDispatchSessionId` at dispatch time. `byOwnDispatch` is an exact match
|
|
6
|
-
* of the cancelling seat's real (platform-injected) SESSION_ID to that stamp: the
|
|
7
|
-
* autonomous self-cancel loop this alarm exists to catch.
|
|
3
|
+
* Task 1516 / 1746 — the pure core of the self-cancel alarm. `isAgentDispatch`
|
|
4
|
+
* still reports whether the cancelled event carries an agent dispatch.
|
|
8
5
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
6
|
+
* `byOwnDispatch` is DISARMED and always false, pending Task 1752.
|
|
7
|
+
*
|
|
8
|
+
* It used to compare the caller's SESSION_ID to a `lastDispatchSessionId` stamp
|
|
9
|
+
* (Task 1526), which discriminated only because a scheduled firing ran its own
|
|
10
|
+
* salted per-firing seat. Task 1746 removed that seat: it spawned a second
|
|
11
|
+
* session for the sender, whose channel server then attached under the sender's
|
|
12
|
+
* own hub key and swallowed their real messages, splitting one conversation
|
|
13
|
+
* across two sessions. With one session per sender, the dispatcher would stamp
|
|
14
|
+
* the sender's own session id and the operator cancels from that same session,
|
|
15
|
+
* so the comparison would be ALWAYS TRUE — stamping `cancelledByOwnDispatchAt`
|
|
16
|
+
* on every operator cancel and reporting each as an autonomous loop.
|
|
17
|
+
*
|
|
18
|
+
* An alarm that always fires is worse than one that never does, so it is
|
|
19
|
+
* disarmed rather than left lying. This under-counts: a real self-cancel loop is
|
|
20
|
+
* no longer detected. That is the safe direction — it never invents one — and it
|
|
21
|
+
* is deliberate, not an oversight. Task 1752 restores detection from the turn's
|
|
22
|
+
* own dispatched eventId, which needs a turn-boundary seam this file does not
|
|
23
|
+
* have. Never throws.
|
|
16
24
|
*/
|
|
17
25
|
export function classifySelfCancel(params) {
|
|
18
|
-
const {
|
|
26
|
+
const { agentChannel, agentDestination } = params;
|
|
19
27
|
if (!agentChannel || !agentDestination) {
|
|
20
28
|
return { isAgentDispatch: false, byOwnDispatch: false };
|
|
21
29
|
}
|
|
22
|
-
|
|
23
|
-
callerSessionId.length > 0 &&
|
|
24
|
-
typeof lastDispatchSessionId === "string" &&
|
|
25
|
-
lastDispatchSessionId.length > 0 &&
|
|
26
|
-
callerSessionId === lastDispatchSessionId;
|
|
27
|
-
return { isAgentDispatch: true, byOwnDispatch };
|
|
30
|
+
return { isAgentDispatch: true, byOwnDispatch: false };
|
|
28
31
|
}
|
|
29
32
|
export async function scheduleCancel(params) {
|
|
30
|
-
const { accountId, eventId, note
|
|
33
|
+
const { accountId, eventId, note } = params;
|
|
31
34
|
const now = new Date().toISOString();
|
|
32
35
|
const noteEntry = note
|
|
33
36
|
? `\n[${now}] Cancelled: ${note}`
|
|
@@ -38,23 +41,24 @@ export async function scheduleCancel(params) {
|
|
|
38
41
|
SET e.eventStatus = 'cancelled',
|
|
39
42
|
e.updatedAt = $now,
|
|
40
43
|
e.notes = COALESCE(e.notes, '') + $noteEntry
|
|
41
|
-
RETURN e.agentChannel AS agentChannel, e.agentDestination AS agentDestination,
|
|
42
|
-
e.lastDispatchSessionId AS lastDispatchSessionId`, { eventId, accountId, now, noteEntry });
|
|
44
|
+
RETURN e.agentChannel AS agentChannel, e.agentDestination AS agentDestination`, { eventId, accountId, now, noteEntry });
|
|
43
45
|
if (result.records.length === 0) {
|
|
44
46
|
throw new Error(`Event not found: ${eventId}`);
|
|
45
47
|
}
|
|
46
48
|
// Task 1516 — the self-cancel alarm. Only agent-dispatch automations can
|
|
47
|
-
// self-cancel; a plain reminder cancel emits nothing.
|
|
48
|
-
//
|
|
49
|
+
// self-cancel; a plain reminder cancel emits nothing. Task 1746 — the
|
|
50
|
+
// byOwnDispatch discriminator is disarmed (always false) pending Task 1752,
|
|
51
|
+
// so the line below always reports false and the stamp below never runs. The
|
|
52
|
+
// line still fires, which keeps the cancel itself observable.
|
|
49
53
|
const agentChannel = result.records[0].get("agentChannel");
|
|
50
54
|
const agentDestination = result.records[0].get("agentDestination");
|
|
51
|
-
const
|
|
52
|
-
const cls = classifySelfCancel({ callerSessionId, agentChannel, agentDestination, lastDispatchSessionId });
|
|
55
|
+
const cls = classifySelfCancel({ eventId, agentChannel, agentDestination });
|
|
53
56
|
if (cls.isAgentDispatch) {
|
|
54
57
|
console.error(`[sched-guard] op=self-cancel event=${eventId.slice(0, 8)} byOwnDispatch=${cls.byOwnDispatch}`);
|
|
55
58
|
// Stamp the fact on the node so the standing audit (which runs in the cron,
|
|
56
59
|
// with no seat SESSION_ID) can count self-cancels deterministically without
|
|
57
|
-
// a timing heuristic — it reads this stamp, not the note prose.
|
|
60
|
+
// a timing heuristic — it reads this stamp, not the note prose. Unreachable
|
|
61
|
+
// while byOwnDispatch is disarmed; retained for Task 1752, which re-arms it.
|
|
58
62
|
if (cls.byOwnDispatch) {
|
|
59
63
|
await neo4jSession.run(`MATCH (e:Event {eventId: $eventId, accountId: $accountId})
|
|
60
64
|
SET e.cancelledByOwnDispatchAt = $now`, { eventId, accountId, now });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedule-cancel.js","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"schedule-cancel.js","sourceRoot":"","sources":["../../src/tools/schedule-cancel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAc7C;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,UAAU,kBAAkB,CAAC,MAKlC;IACC,MAAM,EAAE,YAAY,EAAE,gBAAgB,EAAE,GAAG,MAAM,CAAC;IAClD,IAAI,CAAC,YAAY,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvC,OAAO,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;IAC1D,CAAC;IACD,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;AACzD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,cAAc,CAAC,MAA4B;IAC/D,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC;IAC5C,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAErC,MAAM,SAAS,GAAG,IAAI;QACpB,CAAC,CAAC,MAAM,GAAG,gBAAgB,IAAI,EAAE;QACjC,CAAC,CAAC,MAAM,GAAG,aAAa,CAAC;IAE3B,MAAM,YAAY,GAAG,UAAU,EAAE,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,GAAG,CACnC;;;;qFAI+E,EAC/E,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,SAAS,EAAE,CACvC,CAAC;QAEF,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YAChC,MAAM,IAAI,KAAK,CAAC,oBAAoB,OAAO,EAAE,CAAC,CAAC;QACjD,CAAC;QAED,yEAAyE;QACzE,sEAAsE;QACtE,4EAA4E;QAC5E,6EAA6E;QAC7E,8DAA8D;QAC9D,MAAM,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,cAAc,CAAkB,CAAC;QAC5E,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,kBAAkB,CAAkB,CAAC;QACpF,MAAM,GAAG,GAAG,kBAAkB,CAAC,EAAE,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC5E,IAAI,GAAG,CAAC,eAAe,EAAE,CAAC;YACxB,OAAO,CAAC,KAAK,CACX,sCAAsC,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,kBAAkB,GAAG,CAAC,aAAa,EAAE,CAC/F,CAAC;YACF,4EAA4E;YAC5E,4EAA4E;YAC5E,4EAA4E;YAC5E,6EAA6E;YAC7E,IAAI,GAAG,CAAC,aAAa,EAAE,CAAC;gBACtB,MAAM,YAAY,CAAC,GAAG,CACpB;iDACuC,EACvC,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,CAC5B,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,YAAY,CAAC,KAAK,EAAE,CAAC;IAC7B,CAAC;AACH,CAAC"}
|
|
@@ -29,6 +29,12 @@ tools:
|
|
|
29
29
|
- name: storage-r2-object-delete
|
|
30
30
|
publicAllowlist: false
|
|
31
31
|
adminAllowlist: true
|
|
32
|
+
- name: storage-pages-deploy
|
|
33
|
+
publicAllowlist: false
|
|
34
|
+
adminAllowlist: true
|
|
35
|
+
- name: storage-pages-adopt
|
|
36
|
+
publicAllowlist: false
|
|
37
|
+
adminAllowlist: true
|
|
32
38
|
metadata: {"platform":{"embed":["admin"]}}
|
|
33
39
|
mcp:
|
|
34
40
|
command: node
|
|
@@ -60,8 +66,10 @@ The isolation boundary for per-account Cloudflare D1 and R2 on a multi-tenant in
|
|
|
60
66
|
- `storage-r2-object-get` — download an object to a file in the caller's account directory. Objects over 100 MiB are rejected.
|
|
61
67
|
- `storage-r2-object-put` — upload a file from the caller's account directory. Files over 100 MiB are rejected.
|
|
62
68
|
- `storage-r2-object-delete` — delete an object from a bucket the caller owns.
|
|
69
|
+
- `storage-pages-deploy` — publish a folder under the caller's `sites/` to a Pages project the caller owns. House-run: the Pages credential never enters the caller's account.
|
|
70
|
+
- `storage-pages-adopt` — house admin only: record which account owns a Pages project. Ownership is never reassigned silently; adopting a project owned by someone else is refused.
|
|
63
71
|
|
|
64
|
-
A request against a database or
|
|
72
|
+
A request against a database, bucket, or Pages project the caller does not own returns an authorization error, not another account's data. A Pages project with no owner on record cannot be published by anyone until the house records it — the project-to-folder mapping is not derivable, so it is never guessed.
|
|
65
73
|
|
|
66
74
|
## Where the object tools do their file I/O, and why
|
|
67
75
|
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Claude Code CLI → shim (this file) = node running <real-entry> in-process
|
|
15
15
|
* stdin/stdout : untouched (JSON-RPC channel)
|
|
16
|
-
* stderr : process.stderr.write teed →
|
|
16
|
+
* stderr : process.stderr.write teed → raw sink + passthrough
|
|
17
17
|
*
|
|
18
|
-
* Destinations
|
|
19
|
-
* - `${LOG_DIR}/mcp-<name
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* Destinations:
|
|
19
|
+
* - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
|
|
20
|
+
* The sole raw sink. Task 1721 retired the per-date twin: its date was
|
|
21
|
+
* pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
|
|
22
|
+
* same file, so every line landed twice.
|
|
23
|
+
* - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
|
|
24
|
+
* no SESSION_ID (enumeration). One fixed file per server.
|
|
24
25
|
* - `server.log` via the loopback log-ingest route — best-effort mirror of
|
|
25
26
|
* the [mcp-helper] lifecycle lines.
|
|
26
27
|
*
|
|
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
|
|
|
49
50
|
const ENTRY = process.argv[2];
|
|
50
51
|
const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
|
|
51
52
|
const spawnStamp = Date.now();
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}
|
|
53
|
+
// The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
|
|
54
|
+
// SESSION_ID='' — rc-daemon.ts:513 — while still stamping LOG_DIR) shares one
|
|
55
|
+
// fixed file per server rather than a date-named one: the date was never read
|
|
56
|
+
// by any reader and named a process lifetime, not a day. Interleaved spawns in
|
|
57
|
+
// the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
|
|
58
|
+
const rawSinkPath = LOG_DIR
|
|
59
|
+
? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
|
|
59
60
|
: undefined;
|
|
60
61
|
// Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
|
|
61
62
|
// grow the buffer without bound.
|
|
@@ -66,7 +67,7 @@ let exitEmitted = false;
|
|
|
66
67
|
let exitSignal;
|
|
67
68
|
// The real stderr writer, captured before the tee replaces it. Lifecycle lines
|
|
68
69
|
// and stderr passthrough both go through this so they are never re-teed into
|
|
69
|
-
// the
|
|
70
|
+
// the raw sink nor recursed back into the patched writer.
|
|
70
71
|
const rawStderrWrite = process.stderr.write.bind(process.stderr);
|
|
71
72
|
// LOG_DIR is created once, lazily, on the first successful append — not per
|
|
72
73
|
// chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
|
|
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
|
|
|
115
116
|
// log-ingest route rejects newlines).
|
|
116
117
|
function emitLifecycle(suffix, level) {
|
|
117
118
|
const line = `[mcp-helper] ${suffix}\n`;
|
|
118
|
-
appendSafe(
|
|
119
|
+
appendSafe(rawSinkPath, line);
|
|
119
120
|
try {
|
|
120
121
|
rawStderrWrite(line);
|
|
121
122
|
}
|
|
@@ -127,12 +128,11 @@ if (!ENTRY) {
|
|
|
127
128
|
process.exit(2);
|
|
128
129
|
}
|
|
129
130
|
// Replace process.stderr.write with a tee: mirror every server stderr byte to
|
|
130
|
-
// the
|
|
131
|
+
// the raw sink, keep a rolling tail for op=exit, emit
|
|
131
132
|
// op=boot on the first bytes, then pass the write through to the real stderr.
|
|
132
133
|
const teeWrite = ((...args) => {
|
|
133
134
|
const chunk = args[0];
|
|
134
|
-
appendSafe(
|
|
135
|
-
appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
|
|
135
|
+
appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
|
|
136
136
|
const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
137
137
|
stderrTail = (stderrTail + text).slice(-TAIL_CAP);
|
|
138
138
|
if (!bootEmitted) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confine-path.d.ts","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"confine-path.d.ts","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAoDA;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,MAAM,CA4DzE"}
|
|
@@ -11,12 +11,23 @@
|
|
|
11
11
|
*
|
|
12
12
|
* This is a correctness guardrail, not a security boundary, and the difference
|
|
13
13
|
* matters. Every account shares one unix user and the agent holds Bash, so it
|
|
14
|
-
* can already read anything this process can (Task 1690).
|
|
15
|
-
* contains the blast radius is that the house-level
|
|
16
|
-
* filesystem
|
|
17
|
-
*
|
|
18
|
-
*
|
|
14
|
+
* can already read anything this process can (Task 1690). For the object routes,
|
|
15
|
+
* what contains the blast radius is that the house-level route touches no
|
|
16
|
+
* filesystem: file I/O stays here, in a process running at the agent's own
|
|
17
|
+
* privilege, so it grants nothing the agent did not already have. Moving THIS
|
|
18
|
+
* check server-side would not harden it — it would create the very
|
|
19
19
|
* house-privileged arbitrary read/write it appears to prevent.
|
|
20
|
+
*
|
|
21
|
+
* Task 1728 narrows the "touches no filesystem at all" claim, which is no longer
|
|
22
|
+
* true of the route file as a whole: /pages/deploy resolves a directory
|
|
23
|
+
* house-side, because wrangler uploads a directory and somebody must name one.
|
|
24
|
+
* That is not a hole this module should try to close, and it does not reopen what
|
|
25
|
+
* this module guards. The published tree is composed from the platform-stamped
|
|
26
|
+
* caller header plus a single-segment site name — never a caller-supplied path —
|
|
27
|
+
* and, per the paragraph above, it grants the agent nothing it lacked: it could
|
|
28
|
+
* already read those bytes and hand them to the publisher itself. The rule that
|
|
29
|
+
* still holds without exception is the one this file exists for: no route
|
|
30
|
+
* resolves an agent-supplied PATH house-side. Object I/O stays client-side.
|
|
20
31
|
*/
|
|
21
32
|
import { realpathSync, statSync } from "node:fs";
|
|
22
33
|
import { basename, dirname, join, resolve } from "node:path";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"confine-path.js","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"confine-path.js","sourceRoot":"","sources":["../src/confine-path.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,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IAAI,KAAK,CACb,8BAA8B,CAAC,KAAK,IAAI,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAC1F,CAAC;YACJ,CAAC;YACD,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC9C,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,KAAK,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,GAAG,CAAC,uDAAuD,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -173,6 +173,55 @@ lifelineTool(server, "storage-r2-object-delete", "Delete an object from an R2 bu
|
|
|
173
173
|
return textResult(`R2 object delete failed: ${err}`, true);
|
|
174
174
|
return textResult(`Deleted ${bucket}/${key}.`);
|
|
175
175
|
});
|
|
176
|
+
// ─── storage-pages-deploy ─────────────────────────────────────────────────
|
|
177
|
+
// Task 1728. Publishing is house-run: this account's secrets carry no Cloudflare
|
|
178
|
+
// master, so the site tree is named here and the house route holds the credential.
|
|
179
|
+
lifelineTool(server, "storage-pages-deploy", "Publish one of your account's site folders to its Cloudflare Pages project. The project must already be recorded to your account.", {
|
|
180
|
+
project: z.string().describe("Pages project name, e.g. glsmithandsons"),
|
|
181
|
+
site: z.string().describe("Folder name under your account's sites/ directory, e.g. gls"),
|
|
182
|
+
branch: z.string().optional().describe("Production branch; omit to let Pages choose"),
|
|
183
|
+
}, async ({ project, site, branch }) => {
|
|
184
|
+
const result = await callApi("storage-pages-deploy", "/api/storage/pages/deploy", "POST", { project, site, branch });
|
|
185
|
+
const err = errorOf(result);
|
|
186
|
+
if (err) {
|
|
187
|
+
// Name the remedy for the two denials an agent can actually act on, rather
|
|
188
|
+
// than echoing a bare slug it will misread as a platform fault.
|
|
189
|
+
if (err === "unregistered") {
|
|
190
|
+
return textResult(`Pages deploy failed: the project "${project}" has no owner on record, so nobody may publish it. Ask the house admin to record it to this account first.`, true);
|
|
191
|
+
}
|
|
192
|
+
if (err === "cross-account") {
|
|
193
|
+
return textResult(`Pages deploy failed: the project "${project}" belongs to another account.`, true);
|
|
194
|
+
}
|
|
195
|
+
if (err === "deploy-unverified") {
|
|
196
|
+
// The upload happened; the live check did not confirm it. Reporting this
|
|
197
|
+
// as success is the exact failure this tool exists to prevent, so it is
|
|
198
|
+
// an error result and the wording denies the agent the word "live".
|
|
199
|
+
const r = result;
|
|
200
|
+
return textResult(`Pages deploy uploaded ${project} but could not confirm it live: ${r.url ?? "the deployment url"} answered ${r.httpStatus ?? "nothing"}, not 200. Do not report this as published. Retry, and if it persists the deploy needs a look.`, true);
|
|
201
|
+
}
|
|
202
|
+
return textResult(`Pages deploy failed: ${err}`, true);
|
|
203
|
+
}
|
|
204
|
+
const url = result.url;
|
|
205
|
+
return textResult(url ? `Published ${project}. Live at ${url}` : "Published.");
|
|
206
|
+
});
|
|
207
|
+
// ─── storage-pages-adopt ──────────────────────────────────────────────────
|
|
208
|
+
// House-only; the route enforces it on the platform-stamped house-admin scope.
|
|
209
|
+
// The project-to-account mapping is not derivable (a folder named `gls` publishes
|
|
210
|
+
// to `glsmithandsons`), so it is recorded deliberately, never guessed.
|
|
211
|
+
lifelineTool(server, "storage-pages-adopt", "House admin only: record which account owns a Cloudflare Pages project, so that account can publish it.", {
|
|
212
|
+
project: z.string().describe("Pages project name, e.g. glsmithandsons"),
|
|
213
|
+
account: z.string().describe("Account id that owns the project"),
|
|
214
|
+
}, async ({ project, account }) => {
|
|
215
|
+
const result = await callApi("storage-pages-adopt", "/api/storage/pages/adopt", "POST", { project, account });
|
|
216
|
+
const err = errorOf(result);
|
|
217
|
+
if (err === "already-owned") {
|
|
218
|
+
const owner = result.owner;
|
|
219
|
+
return textResult(`Pages adopt failed: "${project}" already belongs to ${owner ?? "another account"}. Ownership is never reassigned silently; move it deliberately if that is wrong.`, true);
|
|
220
|
+
}
|
|
221
|
+
if (err)
|
|
222
|
+
return textResult(`Pages adopt failed: ${err}`, true);
|
|
223
|
+
return textResult(`Recorded: ${project} belongs to ${account}.`);
|
|
224
|
+
});
|
|
176
225
|
async function main() {
|
|
177
226
|
const transport = new StdioServerTransport();
|
|
178
227
|
await server.connect(transport);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,8CAA8C,CAAC;AAC7E,aAAa,CAAC,gBAAgB,CAAC,CAAC;AAEhC,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sDAAsD,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAC;AAE1E,gFAAgF;AAChF,8EAA8E;AAC9E,sEAAsE;AACtE,IAAI,aAAa,GAAkB,IAAI,CAAC;AACxC,SAAS,UAAU,CAAC,QAAgB;IAClC,IAAI,aAAa,KAAK,IAAI;QAAE,OAAO,aAAa,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,IAAI,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AAI,CACL,CAAC;IACJ,CAAC;IACD,IAAI,GAAG;QAAE,OAAO,UAAU,CAAC,uBAAuB,GAAG,EAAE,EAAE,IAAI,CAAC,CAAC;IAC/D,OAAO,UAAU,CAAC,aAAa,OAAO,eAAe,OAAO,GAAG,CAAC,CAAC;AACnE,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Claude Code CLI → shim (this file) = node running <real-entry> in-process
|
|
15
15
|
* stdin/stdout : untouched (JSON-RPC channel)
|
|
16
|
-
* stderr : process.stderr.write teed →
|
|
16
|
+
* stderr : process.stderr.write teed → raw sink + passthrough
|
|
17
17
|
*
|
|
18
|
-
* Destinations
|
|
19
|
-
* - `${LOG_DIR}/mcp-<name
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* Destinations:
|
|
19
|
+
* - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
|
|
20
|
+
* The sole raw sink. Task 1721 retired the per-date twin: its date was
|
|
21
|
+
* pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
|
|
22
|
+
* same file, so every line landed twice.
|
|
23
|
+
* - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
|
|
24
|
+
* no SESSION_ID (enumeration). One fixed file per server.
|
|
24
25
|
* - `server.log` via the loopback log-ingest route — best-effort mirror of
|
|
25
26
|
* the [mcp-helper] lifecycle lines.
|
|
26
27
|
*
|
|
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
|
|
|
49
50
|
const ENTRY = process.argv[2];
|
|
50
51
|
const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
|
|
51
52
|
const spawnStamp = Date.now();
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}
|
|
53
|
+
// The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
|
|
54
|
+
// SESSION_ID='' — rc-daemon.ts:513 — while still stamping LOG_DIR) shares one
|
|
55
|
+
// fixed file per server rather than a date-named one: the date was never read
|
|
56
|
+
// by any reader and named a process lifetime, not a day. Interleaved spawns in
|
|
57
|
+
// the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
|
|
58
|
+
const rawSinkPath = LOG_DIR
|
|
59
|
+
? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
|
|
59
60
|
: undefined;
|
|
60
61
|
// Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
|
|
61
62
|
// grow the buffer without bound.
|
|
@@ -66,7 +67,7 @@ let exitEmitted = false;
|
|
|
66
67
|
let exitSignal;
|
|
67
68
|
// The real stderr writer, captured before the tee replaces it. Lifecycle lines
|
|
68
69
|
// and stderr passthrough both go through this so they are never re-teed into
|
|
69
|
-
// the
|
|
70
|
+
// the raw sink nor recursed back into the patched writer.
|
|
70
71
|
const rawStderrWrite = process.stderr.write.bind(process.stderr);
|
|
71
72
|
// LOG_DIR is created once, lazily, on the first successful append — not per
|
|
72
73
|
// chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
|
|
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
|
|
|
115
116
|
// log-ingest route rejects newlines).
|
|
116
117
|
function emitLifecycle(suffix, level) {
|
|
117
118
|
const line = `[mcp-helper] ${suffix}\n`;
|
|
118
|
-
appendSafe(
|
|
119
|
+
appendSafe(rawSinkPath, line);
|
|
119
120
|
try {
|
|
120
121
|
rawStderrWrite(line);
|
|
121
122
|
}
|
|
@@ -127,12 +128,11 @@ if (!ENTRY) {
|
|
|
127
128
|
process.exit(2);
|
|
128
129
|
}
|
|
129
130
|
// Replace process.stderr.write with a tee: mirror every server stderr byte to
|
|
130
|
-
// the
|
|
131
|
+
// the raw sink, keep a rolling tail for op=exit, emit
|
|
131
132
|
// op=boot on the first bytes, then pass the write through to the real stderr.
|
|
132
133
|
const teeWrite = ((...args) => {
|
|
133
134
|
const chunk = args[0];
|
|
134
|
-
appendSafe(
|
|
135
|
-
appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
|
|
135
|
+
appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
|
|
136
136
|
const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
137
137
|
stderrTail = (stderrTail + text).slice(-TAIL_CAP);
|
|
138
138
|
if (!bootEmitted) {
|
|
@@ -13,14 +13,15 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Claude Code CLI → shim (this file) = node running <real-entry> in-process
|
|
15
15
|
* stdin/stdout : untouched (JSON-RPC channel)
|
|
16
|
-
* stderr : process.stderr.write teed →
|
|
16
|
+
* stderr : process.stderr.write teed → raw sink + passthrough
|
|
17
17
|
*
|
|
18
|
-
* Destinations
|
|
19
|
-
* - `${LOG_DIR}/mcp-<name
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
18
|
+
* Destinations:
|
|
19
|
+
* - `${LOG_DIR}/mcp-<name>-<SESSION_ID>.log` — raw stderr + lifecycle lines.
|
|
20
|
+
* The sole raw sink. Task 1721 retired the per-date twin: its date was
|
|
21
|
+
* pinned at spawn, no reader ever parsed it, and mcp-stderr-tee wrote the
|
|
22
|
+
* same file, so every line landed twice.
|
|
23
|
+
* - `${LOG_DIR}/mcp-<name>-nosession.log` — the same, for a spawn with
|
|
24
|
+
* no SESSION_ID (enumeration). One fixed file per server.
|
|
24
25
|
* - `server.log` via the loopback log-ingest route — best-effort mirror of
|
|
25
26
|
* the [mcp-helper] lifecycle lines.
|
|
26
27
|
*
|
|
@@ -49,13 +50,13 @@ const PLATFORM_PORT = process.env.PLATFORM_PORT;
|
|
|
49
50
|
const ENTRY = process.argv[2];
|
|
50
51
|
const SESSION_ID8 = SESSION_ID ? SESSION_ID.slice(0, 8) : "—";
|
|
51
52
|
const spawnStamp = Date.now();
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
? (0, node_path_1.resolve)(LOG_DIR, `mcp-${SERVER_NAME}
|
|
53
|
+
// The one raw sink (Task 1721). A sessionless spawn (rc-daemon stamps
|
|
54
|
+
// SESSION_ID='' — rc-daemon.ts:513 — while still stamping LOG_DIR) shares one
|
|
55
|
+
// fixed file per server rather than a date-named one: the date was never read
|
|
56
|
+
// by any reader and named a process lifetime, not a day. Interleaved spawns in
|
|
57
|
+
// the nosession file are separated by the [mcp-helper] op=spawn pid= lines.
|
|
58
|
+
const rawSinkPath = LOG_DIR
|
|
59
|
+
? (0, node_path_1.resolve)(LOG_DIR, SESSION_ID ? `mcp-${SERVER_NAME}-${SESSION_ID}.log` : `mcp-${SERVER_NAME}-nosession.log`)
|
|
59
60
|
: undefined;
|
|
60
61
|
// Rolling tail of entry stderr for op=exit. Capped so a chatty server cannot
|
|
61
62
|
// grow the buffer without bound.
|
|
@@ -66,7 +67,7 @@ let exitEmitted = false;
|
|
|
66
67
|
let exitSignal;
|
|
67
68
|
// The real stderr writer, captured before the tee replaces it. Lifecycle lines
|
|
68
69
|
// and stderr passthrough both go through this so they are never re-teed into
|
|
69
|
-
// the
|
|
70
|
+
// the raw sink nor recursed back into the patched writer.
|
|
70
71
|
const rawStderrWrite = process.stderr.write.bind(process.stderr);
|
|
71
72
|
// LOG_DIR is created once, lazily, on the first successful append — not per
|
|
72
73
|
// chunk. teeWrite runs on the server's own stderr hot path now, so a per-call
|
|
@@ -115,7 +116,7 @@ function postToServerLog(suffix, level) {
|
|
|
115
116
|
// log-ingest route rejects newlines).
|
|
116
117
|
function emitLifecycle(suffix, level) {
|
|
117
118
|
const line = `[mcp-helper] ${suffix}\n`;
|
|
118
|
-
appendSafe(
|
|
119
|
+
appendSafe(rawSinkPath, line);
|
|
119
120
|
try {
|
|
120
121
|
rawStderrWrite(line);
|
|
121
122
|
}
|
|
@@ -127,12 +128,11 @@ if (!ENTRY) {
|
|
|
127
128
|
process.exit(2);
|
|
128
129
|
}
|
|
129
130
|
// Replace process.stderr.write with a tee: mirror every server stderr byte to
|
|
130
|
-
// the
|
|
131
|
+
// the raw sink, keep a rolling tail for op=exit, emit
|
|
131
132
|
// op=boot on the first bytes, then pass the write through to the real stderr.
|
|
132
133
|
const teeWrite = ((...args) => {
|
|
133
134
|
const chunk = args[0];
|
|
134
|
-
appendSafe(
|
|
135
|
-
appendSafe(perSessionPath, chunk); // per-session raw (Task 706)
|
|
135
|
+
appendSafe(rawSinkPath, chunk); // raw sink (Task 1721)
|
|
136
136
|
const text = typeof chunk === "string" ? chunk : Buffer.from(chunk).toString("utf8");
|
|
137
137
|
stderrTail = (stderrTail + text).slice(-TAIL_CAP);
|
|
138
138
|
if (!bootEmitted) {
|