run402-mcp 4.30.0 → 4.32.0

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.
Files changed (35) hide show
  1. package/core/dist/binding-file.d.ts +24 -0
  2. package/core/dist/binding-file.d.ts.map +1 -0
  3. package/core/dist/binding-file.js +83 -0
  4. package/core/dist/binding-file.js.map +1 -0
  5. package/dist/tools/ack-room-message.js +1 -1
  6. package/dist/tools/ack-room-message.js.map +1 -1
  7. package/dist/tools/claim-room-resource.js +1 -1
  8. package/dist/tools/claim-room-resource.js.map +1 -1
  9. package/dist/tools/join-room.js +1 -1
  10. package/dist/tools/join-room.js.map +1 -1
  11. package/dist/tools/list-project-events.d.ts +5 -0
  12. package/dist/tools/list-project-events.d.ts.map +1 -1
  13. package/dist/tools/list-project-events.js +8 -3
  14. package/dist/tools/list-project-events.js.map +1 -1
  15. package/dist/tools/read-room-messages.js +1 -1
  16. package/dist/tools/read-room-messages.js.map +1 -1
  17. package/dist/tools/release-room-claim.js +1 -1
  18. package/dist/tools/release-room-claim.js.map +1 -1
  19. package/dist/tools/rooms-shared.d.ts +4 -1
  20. package/dist/tools/rooms-shared.d.ts.map +1 -1
  21. package/dist/tools/rooms-shared.js +80 -3
  22. package/dist/tools/rooms-shared.js.map +1 -1
  23. package/dist/tools/send-room-message.js +1 -1
  24. package/dist/tools/send-room-message.js.map +1 -1
  25. package/package.json +3 -3
  26. package/sdk/core-dist/binding-file.d.ts +24 -0
  27. package/sdk/core-dist/binding-file.js +83 -0
  28. package/sdk/dist/namespaces/events.d.ts +13 -4
  29. package/sdk/dist/namespaces/events.d.ts.map +1 -1
  30. package/sdk/dist/namespaces/events.js +13 -4
  31. package/sdk/dist/namespaces/events.js.map +1 -1
  32. package/sdk/dist/namespaces/events.types.d.ts +52 -11
  33. package/sdk/dist/namespaces/events.types.d.ts.map +1 -1
  34. package/sdk/dist/namespaces/events.types.js +12 -2
  35. package/sdk/dist/namespaces/events.types.js.map +1 -1
@@ -0,0 +1,24 @@
1
+ /** The committed binding file. Safe to check in — it names, never authorizes. */
2
+ export declare const BINDING_FILE = ".run402.json";
3
+ /** The personal override. Gitignored; beats the committed file key-by-key. */
4
+ export declare const BINDING_LOCAL_FILE = ".run402.local.json";
5
+ export interface BindingKeyHit {
6
+ /** The trimmed value found. */
7
+ value: string;
8
+ /** The file it came from — surfaced in provenance and conflict messages. */
9
+ file: string;
10
+ }
11
+ /**
12
+ * Nearest binding of `key`, walking up from `startDir` to the filesystem root.
13
+ *
14
+ * Resolution is PER KEY, not per file: the nearest file that carries the key
15
+ * wins, so `/work/.run402.json` may supply the organization while
16
+ * `/work/api/.run402.json` supplies the wallet. A worktree nested under a bound
17
+ * checkout therefore inherits the binding without restating it.
18
+ */
19
+ export declare function findBindingKey(startDir: string, key: string): BindingKeyHit | null;
20
+ /** Path of the committed binding file for a directory. */
21
+ export declare function bindingFilePath(dir?: string): string;
22
+ /** Parse a directory's committed binding file, or `{}` when absent/unreadable. */
23
+ export declare function readBindingFile(dir?: string): Record<string, unknown>;
24
+ //# sourceMappingURL=binding-file.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-file.d.ts","sourceRoot":"","sources":["../src/binding-file.ts"],"names":[],"mappings":"AA2BA,iFAAiF;AACjF,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,8EAA8E;AAC9E,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AAEvD,MAAM,WAAW,aAAa;IAC5B,+BAA+B;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,IAAI,EAAE,MAAM,CAAC;CACd;AAiBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,aAAa,GAAG,IAAI,CASlF;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAEnE;AAED,kFAAkF;AAClF,wBAAgB,eAAe,CAAC,GAAG,GAAE,MAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CASpF"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The per-directory binding file — `.run402.json`, and its gitignored personal
3
+ * override `.run402.local.json`.
4
+ *
5
+ * A checkout binds itself to a wallet profile, an organization, a room, by
6
+ * committing a small JSON file. That is a CHECKOUT-LEVEL CONTRACT, not a CLI
7
+ * implementation detail: every agent working in the directory inherits the
8
+ * same one, whichever surface it reaches Run402 through.
9
+ *
10
+ * It lives in core because two surfaces now read it. The CLI has always walked
11
+ * this chain; the MCP server needs the same answer for the same directory, and
12
+ * `run402-mcp` ships only `dist` + `core/dist` + `sdk/dist` — `cli/` is not in
13
+ * the published package, so the MCP server cannot import the CLI's copy even
14
+ * if it wanted to. One reader, in the one place both can see it, rather than
15
+ * two that agree until they don't.
16
+ *
17
+ * Deliberately pure: `node:fs` + `node:path`, no logging, no process exit, no
18
+ * validation of what a value MEANS. Callers decide whether a value is
19
+ * well-shaped and what to do when it isn't — the CLI exits, the MCP server
20
+ * returns an error, and neither behaviour belongs in a file reader.
21
+ *
22
+ * Unknown keys are ignored on purpose: that is what makes an older client
23
+ * forward-compatible with a binding file written by a newer one.
24
+ */
25
+ import { readFileSync } from "node:fs";
26
+ import { dirname, join, resolve } from "node:path";
27
+ /** The committed binding file. Safe to check in — it names, never authorizes. */
28
+ export const BINDING_FILE = ".run402.json";
29
+ /** The personal override. Gitignored; beats the committed file key-by-key. */
30
+ export const BINDING_LOCAL_FILE = ".run402.local.json";
31
+ /** Read one key from a single directory's binding files, override first. */
32
+ function readBindingKeyFrom(dir, key) {
33
+ for (const fname of [BINDING_LOCAL_FILE, BINDING_FILE]) {
34
+ const p = join(dir, fname);
35
+ try {
36
+ const parsed = JSON.parse(readFileSync(p, "utf8"));
37
+ const v = parsed?.[key];
38
+ if (typeof v === "string" && v.trim())
39
+ return { value: v.trim(), file: p };
40
+ }
41
+ catch {
42
+ /* missing / unreadable / malformed → skip */
43
+ }
44
+ }
45
+ return null;
46
+ }
47
+ /**
48
+ * Nearest binding of `key`, walking up from `startDir` to the filesystem root.
49
+ *
50
+ * Resolution is PER KEY, not per file: the nearest file that carries the key
51
+ * wins, so `/work/.run402.json` may supply the organization while
52
+ * `/work/api/.run402.json` supplies the wallet. A worktree nested under a bound
53
+ * checkout therefore inherits the binding without restating it.
54
+ */
55
+ export function findBindingKey(startDir, key) {
56
+ let dir = resolve(startDir);
57
+ for (;;) {
58
+ const hit = readBindingKeyFrom(dir, key);
59
+ if (hit)
60
+ return hit;
61
+ const parent = dirname(dir);
62
+ if (parent === dir)
63
+ return null;
64
+ dir = parent;
65
+ }
66
+ }
67
+ /** Path of the committed binding file for a directory. */
68
+ export function bindingFilePath(dir = process.cwd()) {
69
+ return join(dir, BINDING_FILE);
70
+ }
71
+ /** Parse a directory's committed binding file, or `{}` when absent/unreadable. */
72
+ export function readBindingFile(dir = process.cwd()) {
73
+ try {
74
+ const parsed = JSON.parse(readFileSync(bindingFilePath(dir), "utf8"));
75
+ return parsed && typeof parsed === "object" && !Array.isArray(parsed)
76
+ ? parsed
77
+ : {};
78
+ }
79
+ catch {
80
+ return {};
81
+ }
82
+ }
83
+ //# sourceMappingURL=binding-file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-file.js","sourceRoot":"","sources":["../src/binding-file.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,iFAAiF;AACjF,MAAM,CAAC,MAAM,YAAY,GAAG,cAAc,CAAC;AAC3C,8EAA8E;AAC9E,MAAM,CAAC,MAAM,kBAAkB,GAAG,oBAAoB,CAAC;AASvD,4EAA4E;AAC5E,SAAS,kBAAkB,CAAC,GAAW,EAAE,GAAW;IAClD,KAA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AAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,eAAe,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,CAAY,CAAC;QACjF,OAAO,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;YACnE,CAAC,CAAE,MAAkC;YACrC,CAAC,CAAC,EAAE,CAAC;IACT,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import { resolveRoomArgs, withPresenceRetry } from "./rooms-shared.js";
5
5
  export const ackRoomMessageSchema = {
6
6
  project_id: z.string().optional().describe("Project whose default room the message is in. Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id (with room_key) for a named org room."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id)."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  message_id: z.string().describe("The message to acknowledge (msg_...). Recipients only — the sender sees your acked_at on the message."),
10
10
  };
11
11
  export async function handleAckRoomMessage(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"ack-room-message.js","sourceRoot":"","sources":["../../src/tools/ack-room-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,oFAAoF,CAAC;IAChI,MAAM,EAAE,CAAC,C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AI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC9D,CAAC;IACD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;IACvB,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,CAAC,UAAU,EAAE,EAAE,CAC1D,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE;YACnE,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC,CAAC,CAAC;QACN,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,8BAA8B,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import { resolveRoomArgs, withPresenceRetry } from "./rooms-shared.js";
5
5
  export const claimRoomResourceSchema = {
6
6
  project_id: z.string().optional().describe("Project whose default room to claim in. Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id (with room_key) for a named org room."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id)."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  resource: z.string().describe("What you're working on: repo:<glob> (glob-overlap conflicts, e.g. repo:src/auth/**), function:<name>, table:<name>, deploy, or any free-form string (exact match)."),
10
10
  mode: z.enum(["exclusive", "shared"]).optional().describe("exclusive (default): one worker. shared: parallel-safe (only conflicts with an exclusive)."),
11
11
  ttl_seconds: z.number().int().min(1).max(86400).optional().describe("Lifetime (default 3600). Claims auto-expire so a dead session never wedges the room."),
@@ -1 +1 @@
1
- {"version":3,"file":"claim-room-resource.js","sourceRoot":"","sources":["../../src/tools/claim-room-resource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEvE,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8EAA8E,CAAC;IAC1H,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACtF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oKAAoK,CAAC;IACnM,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,4FAA4F,CAAC;IACvJ,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,sFAAsF,CAAC;IAC3J,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAA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ACvD,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD,CAAC,CAAC,CAAC;QACN,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACjF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,0BAA0B,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import { resolveRoomArgs, cachedPresenceId, rememberPresence } from "./rooms-sha
5
5
  export const joinRoomSchema = {
6
6
  project_id: z.string().optional().describe("Project whose DEFAULT room to join (the room key is the project id — the zero-config rendezvous). Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id, together with room_key, to join a NAMED org room (multi-repo products)."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id). Rooms auto-vivify on first use — there is no create call."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Rooms auto-vivify on first use — there is no create call. Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  requested_name: z.string().optional().describe("Choose your own presence name. Honored when free; suffixed on collision (Opus -> Opus-2) — the response reports requested_name + renamed, never an error."),
10
10
  task: z.string().optional().describe("What this session is working on — shown to every other agent in the room."),
11
11
  };
@@ -1 +1 @@
1
- {"version":3,"file":"join-room.js","sourceRoot":"","sources":["../../src/tools/join-room.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EA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;QACD,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;YAC5C,GAAG,CAAC,KAAK,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;YACjD,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC;SAC/C,CAAC,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,SAAS,EAAE,GAAG,MAAM,EAAE,CAAC;QAC7F,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACjF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,+BAA+B,CAAC,CAAC;IAC3D,CAAC;AACH,CAAC;AAED,SAAS,eAAe,CAAC,GAAY;IACnC,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;IACtD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,IAAI,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC;AAChD,CAAC"}
@@ -14,6 +14,11 @@ import { z } from "zod";
14
14
  * `(source, event_type)` together, since app event_type names are
15
15
  * free-form per app and only the pair disambiguates them from the
16
16
  * platform's own vocabulary.
17
+ *
18
+ * An ORGANIZATION owns each fact and `project_id` says what it is about, so
19
+ * the org feed is a SUPERSET of the project feeds (it also carries org-level
20
+ * facts, `project_id: null`), a fact outlives the project it describes, and
21
+ * an event's `id` is NOT a page cursor — see the `cursor` field.
17
22
  */
18
23
  export declare const listProjectEventsSchema: {
19
24
  project_id: z.ZodOptional<z.ZodString>;
@@ -1 +1 @@
1
- {"version":3,"file":"list-project-events.d.ts","sourceRoot":"","sources":["../../src/tools/list-project-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;GAeG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;CAmBnC,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0BrB"}
1
+ {"version":3,"file":"list-project-events.d.ts","sourceRoot":"","sources":["../../src/tools/list-project-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,eAAO,MAAM,uBAAuB;;;;;;;CAmBnC,CAAC;AAEF,KAAK,SAAS,GAAG;IAAE,OAAO,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,CAAC;AAEvF,wBAAsB,uBAAuB,CAAC,IAAI,EAAE;IAClD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,GAAG,OAAO,CAAC,SAAS,CAAC,CA0BrB"}
@@ -16,11 +16,16 @@ import { mapSdkError } from "../errors.js";
16
16
  * `(source, event_type)` together, since app event_type names are
17
17
  * free-form per app and only the pair disambiguates them from the
18
18
  * platform's own vocabulary.
19
+ *
20
+ * An ORGANIZATION owns each fact and `project_id` says what it is about, so
21
+ * the org feed is a SUPERSET of the project feeds (it also carries org-level
22
+ * facts, `project_id: null`), a fact outlives the project it describes, and
23
+ * an event's `id` is NOT a page cursor — see the `cursor` field.
19
24
  */
20
25
  export const listProjectEventsSchema = {
21
26
  project_id: z.string().optional().describe("Project whose feed to read. Omit when passing org_id."),
22
- org_id: z.string().optional().describe("Read the org-wide feed instead (union across the org's projects; requires an active org membership)."),
23
- cursor: z.string().optional().describe("Opaque cursor from a prior page (the response's `cursor`, or any event's `id`). Returns events strictly after it. Omit on first contact to start from the earliest retained event. Never parse cursors."),
27
+ org_id: z.string().optional().describe("Read the org-wide feed instead every fact the organization owns. A SUPERSET of the project feeds, not a union of them: it also carries organization-level facts, which belong to no project and arrive with project_id: null. Requires an active org membership."),
28
+ cursor: z.string().optional().describe("Opaque PAGE cursor from a prior page's `cursor` field. Returns events strictly after it. Omit on first contact to start from the earliest retained event. Never parse it. An event's `id` is NOT a cursor — an id names a fact (identical in every feed, which is how you dedup), a cursor names a position inside ONE view. A cursor is bound to the view that issued it (project vs org, plus any source/event_type filters): carrying one across views, or passing an id, returns `reset: true` instead of resuming, because resuming would skip exactly the rows the other view omitted."),
24
29
  limit: z.number().int().min(1).max(200).optional().describe("Page size (default 50, max 200)."),
25
30
  source: z.enum(["app", "platform"]).optional().describe("Restrict to one source: \"app\" (business facts a deployed function emitted itself via events.emit) or \"platform\" (every non-app source — the platform's own operational record). Omit to read both lanes in one merged, cursor-ordered feed."),
26
31
  event_type: z.string().optional().describe("Restrict to one or more event types, comma-separated (e.g. \"signature_completed,booking_created\"). Composes with source — e.g. source: \"app\" + event_type to watch for one specific business fact."),
@@ -34,7 +39,7 @@ export async function handleListProjectEvents(args) {
34
39
  }
35
40
  if (args.project_id && args.org_id) {
36
41
  return {
37
- content: [{ type: "text", text: "Pass either project_id or org_id, not both — the org feed already unions every project the org owns." }],
42
+ content: [{ type: "text", text: "Pass either project_id or org_id, not both — the org feed already covers every project the org owns, plus the org-level facts no project feed can show." }],
38
43
  isError: true,
39
44
  };
40
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"list-project-events.js","sourceRoot":"","sources":["../../src/tools/list-project-events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACxC,uDAAuD,CACxD;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpC,sGAAsG,CACvG;IACD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACpC,yMAAyM,CAC1M;IACD,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CACzD,kCAAkC,CACnC;IACD,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,KA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I,CAAC;YACrD,CAAC,CAAC,MAAM,MAAM,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,UAAW,EAAE,IAAI,CAAC,CAAC;QACvD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAC9E,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,6BAA6B,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import { resolveRoomArgs, cachedPresenceId } from "./rooms-shared.js";
5
5
  export const readRoomMessagesSchema = {
6
6
  project_id: z.string().optional().describe("Project whose default room to read. Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id (with room_key) for a named org room."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id)."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  message_id: z.string().optional().describe("Fetch ONE message with its FULL body (lists carry snippets). When set, every other filter is ignored."),
10
10
  cursor: z.string().optional().describe("Opaque resume cursor (mcr_...) from a prior page. Store and echo — never parse. A stale cursor returns reset: true + earliest_cursor instead of an error."),
11
11
  unread: z.boolean().optional().describe("Only messages addressed to this session's presence that are newer than its read watermark. Requires having joined (or sent) at least once."),
@@ -1 +1 @@
1
- {"version":3,"file":"read-room-messages.js","sourceRoot":"","sources":["../../src/tools/read-room-messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,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C;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAAC;IACnD,CAAC;AACH,CAAC"}
@@ -5,7 +5,7 @@ import { resolveRoomArgs } from "./rooms-shared.js";
5
5
  export const releaseRoomClaimSchema = {
6
6
  project_id: z.string().optional().describe("Project whose default room the claim is in. Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id (with room_key) for a named org room."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id)."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  claim_id: z.string().describe("The claim to release (clm_...). Holder's credential only; idempotent — an already-released claim reports already_released: true with the original time."),
10
10
  };
11
11
  export async function handleReleaseRoomClaim(args) {
@@ -1 +1 @@
1
- {"version":3,"file":"release-room-claim.js","sourceRoot":"","sources":["../../src/tools/release-room-claim.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,kFAAkF,CAAC;IAC9H,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACtF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC1E,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAA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AC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
@@ -14,7 +14,10 @@ export type RoomAddressResult = {
14
14
  ok: false;
15
15
  error: string;
16
16
  };
17
- export declare function resolveRoomArgs(args: RoomAddressArgs): Promise<RoomAddressResult>;
17
+ export declare function resolveRoomArgs(args: RoomAddressArgs, opts?: {
18
+ cwd?: string;
19
+ env?: NodeJS.ProcessEnv;
20
+ }): Promise<RoomAddressResult>;
18
21
  export declare function cachedPresenceId(room: ResolvedRoom): string | undefined;
19
22
  export declare function rememberPresence(room: ResolvedRoom, presence: unknown, requestedName?: string): void;
20
23
  export declare function forgetPresence(room: ResolvedRoom): void;
@@ -1 +1 @@
1
- {"version":3,"file":"rooms-shared.d.ts","sourceRoot":"","sources":["../../src/tools/rooms-shared.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,YAAY;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,iBAAiB,GACzB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,YAAY,CAAA;CAAE,GAChC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEjC,wBAAsB,eAAe,CAAC,IAAI,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAyBvF;AAQD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,GAAG,SAAS,CAIvE;AAED,wBAAgB,gB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AAG,IAAI,CAOpG;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAEvD;AAED;;8EAE8E;AAC9E,wBAAsB,iBAAiB,CAAC,CAAC,EACvC,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,GACnD,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
@@ -2,7 +2,11 @@
2
2
  * Shared room addressing + session presence for the agent-messaging MCP tools.
3
3
  *
4
4
  * Every rooms tool addresses a room the same way: project_id (that project's
5
- * DEFAULT room — the zero-config path) OR org_id + room_key (named org rooms).
5
+ * DEFAULT room — the zero-config path) OR org_id + room_key (named org rooms)
6
+ * OR, when neither is passed, the checkout's own ambient context — RUN402_ROOM,
7
+ * or a `room`/`org` binding in .run402.json, or the wallet profile's selected
8
+ * organization (run402-public#550). Both explicit forms outrank the ambient
9
+ * chain, so a call that names a room still reaches exactly that room.
6
10
  * The MCP server is a long-lived process, so the session's presence per room
7
11
  * lives in an in-memory map — tool calls after the first reuse it. The cache is
8
12
  * what makes those calls ONE session: the gateway never infers a session from
@@ -12,7 +16,71 @@
12
16
  */
13
17
  import { getSdk } from "../sdk.js";
14
18
  import { mapSdkError } from "../errors.js";
15
- export async function resolveRoomArgs(args) {
19
+ import { findBindingKey } from "../../core/dist/binding-file.js";
20
+ import { getActiveOrgId } from "../../core/dist/profile-state.js";
21
+ const ORG_ENV = "RUN402_ORG";
22
+ const ROOM_ENV = "RUN402_ROOM";
23
+ const trimmed = (v) => typeof v === "string" && v.trim() ? v.trim() : null;
24
+ /**
25
+ * Address a room from the ambient context, when nothing was passed explicitly.
26
+ *
27
+ * This mirrors the CLI's precedence (run402 4.27.0) but is a SEPARATE
28
+ * implementation on purpose, for two reasons the CLI's version cannot satisfy:
29
+ *
30
+ * 1. The CLI resolver calls `fail()`, which is `process.exit(1)`. In a
31
+ * long-lived MCP server that turns "you didn't name an org" into a dead
32
+ * server for every subsequent tool call. Everything here RETURNS.
33
+ * 2. `run402-mcp` ships `dist` + `core/dist` + `sdk/dist`; `cli/` is not in
34
+ * the published package, so the CLI's copy is not importable at runtime.
35
+ *
36
+ * What IS shared is the thing worth sharing — the binding-file reader and the
37
+ * profile-state getter, both in core. Precedence is a short, explicit list
38
+ * here rather than a second general resolver.
39
+ *
40
+ * The directory walked is the SERVER's working directory. An MCP server is
41
+ * spawned once, typically in the checkout the agent is working in, and its cwd
42
+ * does not follow the agent afterwards. That is the right default and a real
43
+ * limit: a server spawned outside the checkout finds no binding and falls
44
+ * through to the environment and the profile, which is a graceful miss rather
45
+ * than a wrong room.
46
+ */
47
+ function resolveAmbientRoom(cwd, env) {
48
+ // The compound env form names both halves and outranks the rest — a harness
49
+ // wired with RUN402_ROOM reaches exactly the room it names.
50
+ const envRoom = trimmed(env[ROOM_ENV]);
51
+ if (envRoom) {
52
+ const slash = envRoom.indexOf("/");
53
+ if (slash <= 0 || slash === envRoom.length - 1) {
54
+ return { ok: false, error: `${ROOM_ENV} must be "<org_id>/<room_key>" — got ${JSON.stringify(envRoom)}.` };
55
+ }
56
+ return { ok: true, room: { orgId: envRoom.slice(0, slash), roomKey: envRoom.slice(slash + 1) } };
57
+ }
58
+ const bindingRoom = findBindingKey(cwd, "room");
59
+ const roomKey = trimmed(bindingRoom?.value);
60
+ if (!roomKey)
61
+ return null; // No room key anywhere — the caller reports how to address one.
62
+ // The org half, highest first: environment, then the checkout's binding,
63
+ // then the wallet profile's selection.
64
+ const envOrg = trimmed(env[ORG_ENV]);
65
+ const bindingOrg = findBindingKey(cwd, "org");
66
+ // An ambient variable disagreeing with a committed file is the surprise
67
+ // worth stopping on — the CLI stops here too, and for the same reason. A
68
+ // binding outranking the PROFILE stays silent; that is what a binding is for.
69
+ if (envOrg && bindingOrg && envOrg !== bindingOrg.value) {
70
+ return {
71
+ ok: false,
72
+ error: `Ambiguous organization: ${ORG_ENV}=${envOrg} but ${bindingOrg.file} binds ${bindingOrg.value}. `
73
+ + "Pass org_id + room_key on this call, unset the variable, or edit the binding file.",
74
+ };
75
+ }
76
+ const orgId = envOrg ?? trimmed(bindingOrg?.value) ?? trimmed(getActiveOrgId());
77
+ if (!orgId)
78
+ return null;
79
+ return { ok: true, room: { orgId, roomKey } };
80
+ }
81
+ export async function resolveRoomArgs(args, opts = {}) {
82
+ const cwd = opts.cwd ?? process.cwd();
83
+ const env = opts.env ?? process.env;
16
84
  const hasProject = typeof args.project_id === "string" && args.project_id.length > 0;
17
85
  const hasOrg = typeof args.org_id === "string" && args.org_id.length > 0;
18
86
  const hasRoom = typeof args.room_key === "string" && args.room_key.length > 0;
@@ -22,11 +90,20 @@ export async function resolveRoomArgs(args) {
22
90
  if (hasRoom !== hasOrg) {
23
91
  return { ok: false, error: "org_id and room_key go together — a named room is addressed as org_id + room_key. For a project's default room pass project_id alone." };
24
92
  }
93
+ // Both explicit forms keep outranking the ambient chain, exactly as they do
94
+ // in the CLI: a tool call that names a room reaches that room, always.
25
95
  if (hasOrg && hasRoom) {
26
96
  return { ok: true, room: { orgId: args.org_id, roomKey: args.room_key } };
27
97
  }
28
98
  if (!hasProject) {
29
- return { ok: false, error: "Address the room: project_id for the project's default room, or org_id + room_key for a named org room." };
99
+ const ambient = resolveAmbientRoom(cwd, env);
100
+ if (ambient)
101
+ return ambient;
102
+ return {
103
+ ok: false,
104
+ error: "Address the room: project_id for the project's default room, or org_id + room_key for a named org room. "
105
+ + `This checkout can also bind one — \`{"org":"<org_id>","room":"<key>"}\` in .run402.json — or set ${ROOM_ENV}="<org_id>/<room_key>".`,
106
+ };
30
107
  }
31
108
  try {
32
109
  const scoped = await getSdk().rooms.forProject(args.project_id);
@@ -1 +1 @@
1
- {"version":3,"file":"rooms-shared.js","sourceRoot":"","sources":["../../src/tools/rooms-shared.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAA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enceRetry } from "./rooms-sh
5
5
  export const sendRoomMessageSchema = {
6
6
  project_id: z.string().optional().describe("Project whose default room to send in. Omit when passing org_id + room_key."),
7
7
  org_id: z.string().optional().describe("Org id (with room_key) for a named org room."),
8
- room_key: z.string().optional().describe("Named room slug (with org_id)."),
8
+ room_key: z.string().optional().describe("Named room slug (with org_id). Omit every addressing parameter to use the checkout's own context: RUN402_ROOM, or an `org`/`room` binding in .run402.json, or the wallet profile's selected org (read from the MCP server's working directory)."),
9
9
  body: z.string().describe("Markdown message body (<=32 KiB — over-cap is rejected, never truncated). Room-visible: every agent in the room can read it."),
10
10
  to: z.array(z.string()).optional().describe("Presence names to address. Attention routing, not access control — recipients see it in their unread filter and can be asked to ack."),
11
11
  cc: z.array(z.string()).optional().describe("Additional attention, no ack expectation."),
@@ -1 +1 @@
1
- {"version":3,"file":"send-room-message.js","sourceRoot":"","sources":["../../src/tools/send-room-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEzF,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,6EAA6E,CAAC;IACzH,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,8CAA8C,CAAC;IACtF,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,gCAAgC,CAAC;IAC1E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,8HAA8H,CAAC;IACzJ,EAAE,EAAE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AAC,EAAE,CAAC;YAC9E,GAAG,CAAC,IAAI,CAAC,eAAe,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACvF,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACnD,GAAG,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpF,GAAG,CAAC,IAAI,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC,CAAC,CAAC;QACN,gBAAgB,CAAC,IAAI,EAAG,MAAwC,CAAC,eAAe,CAAC,CAAC;QAClF,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IAChF,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,OAAO,WAAW,CAAC,GAAG,EAAE,wBAAwB,CAAC,CAAC;IACpD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "run402-mcp",
3
- "version": "4.30.0",
3
+ "version": "4.32.0",
4
4
  "packageManager": "npm@11.19.0",
5
5
  "mcpName": "com.run402/mcp",
6
6
  "description": "MCP server for Run402 — pay-per-call infrastructure for AI agents over x402 USDC micropayments. Generate an image for $0.03 with no signup, or provision Postgres databases with REST API, auth, storage and row-level security.",
@@ -33,8 +33,8 @@
33
33
  "test:sync": "node --test --import tsx sync.test.ts examples/tenant-x402-wallet-stats/example.test.mjs",
34
34
  "test:run402-app-schema-drift": "node scripts/check-run402-app-schema-drift.mjs",
35
35
  "test:docs": "node scripts/check-typed-config-docs.mjs && npm run check:docs --workspace=@run402/sdk -- --skip-build",
36
- "test": "npm run build && node scripts/build-agent-skills-index.mjs --check && node --experimental-test-module-mocks --test --import tsx SKILL.test.ts sync.test.ts buzz/setup.test.mjs buzz/helper.test.mjs buzz/package.test.mjs scripts/build-agent-skills-index.test.mjs examples/tenant-x402-wallet-stats/example.test.mjs 'core/src/**/*.test.ts' 'sdk/src/**/*.test.ts' 'src/**/*.test.ts' && node --test cli-core-target.test.mjs && node --experimental-test-module-mocks --test cli-up-argv.test.mjs cli-gitvault-surface.test.mjs cli-identity-link.test.mjs cli-identity-link-matrix.test.mjs cli-redeem.test.mjs cli/lib/buzz.test.mjs && node --test cli-output-contract.test.mjs cli-e2e.test.mjs cli-help.test.mjs cli-provision-active.test.mjs cli-typed-config-modes.test.mjs cli-argv.test.mjs cli-conventions-gate.test.mjs paid-stack-deps.test.mjs profile-guidance.test.mjs settlement-disclosure.test.mjs cli-suggestions-gate.test.mjs cli-env.test.mjs cli-wallets.test.mjs cli-org.test.mjs cli-org-context.test.mjs cli-ci.test.mjs cli-deploy-ci.test.mjs cli-operator-loopback.test.mjs cli-gitvault-remote-helper.test.mjs cli-deploy-gitvault-lane.test.mjs cli/lib/buzz-doctor-contract.test.mjs cli/lib/buzz-doctor.test.mjs cli/lib/diagnostic-telemetry.test.mjs cli/lib/doctor-source-scan.test.mjs cli/lib/errors.test.mjs cli/lib/pay.test.mjs cli-bootstrap-next-actions.test.mjs && npm run test:docs",
37
- "test:e2e": "npm run build && node --test cli-core-target.test.mjs && node --experimental-test-module-mocks --test cli-gitvault-surface.test.mjs cli-identity-link.test.mjs cli-identity-link-matrix.test.mjs cli-redeem.test.mjs && node --test cli-output-contract.test.mjs cli-e2e.test.mjs cli-help.test.mjs cli-provision-active.test.mjs cli-typed-config-modes.test.mjs cli-argv.test.mjs cli-conventions-gate.test.mjs paid-stack-deps.test.mjs profile-guidance.test.mjs settlement-disclosure.test.mjs cli-suggestions-gate.test.mjs cli-env.test.mjs cli-wallets.test.mjs cli-org.test.mjs cli-org-context.test.mjs cli-ci.test.mjs cli-deploy-ci.test.mjs cli-operator-loopback.test.mjs cli-gitvault-remote-helper.test.mjs cli-deploy-gitvault-lane.test.mjs cli/lib/buzz-doctor-contract.test.mjs cli/lib/buzz-doctor.test.mjs cli/lib/diagnostic-telemetry.test.mjs cli/lib/doctor-source-scan.test.mjs cli/lib/errors.test.mjs cli-bootstrap-next-actions.test.mjs",
36
+ "test": "npm run build && node scripts/build-agent-skills-index.mjs --check && node --experimental-test-module-mocks --test --import tsx SKILL.test.ts sync.test.ts buzz/setup.test.mjs buzz/helper.test.mjs buzz/package.test.mjs scripts/build-agent-skills-index.test.mjs examples/tenant-x402-wallet-stats/example.test.mjs 'core/src/**/*.test.ts' 'sdk/src/**/*.test.ts' 'src/**/*.test.ts' && node --test cli-core-target.test.mjs && node --experimental-test-module-mocks --test cli-up-argv.test.mjs cli-gitvault-surface.test.mjs cli-identity-link.test.mjs cli-identity-link-matrix.test.mjs cli-redeem.test.mjs cli/lib/buzz.test.mjs && node --test cli-help-listing.test.mjs cli-output-contract.test.mjs cli-json-noop-contract.test.mjs cli-e2e.test.mjs cli-help.test.mjs cli-provision-active.test.mjs cli-typed-config-modes.test.mjs cli-argv.test.mjs cli-conventions-gate.test.mjs paid-stack-deps.test.mjs profile-guidance.test.mjs settlement-disclosure.test.mjs cli-suggestions-gate.test.mjs cli-env.test.mjs cli-wallets.test.mjs cli-org.test.mjs cli-org-context.test.mjs cli-ci.test.mjs cli-deploy-ci.test.mjs cli-operator-loopback.test.mjs cli-gitvault-remote-helper.test.mjs cli-deploy-gitvault-lane.test.mjs cli/lib/buzz-doctor-contract.test.mjs cli/lib/buzz-doctor.test.mjs cli/lib/diagnostic-telemetry.test.mjs cli/lib/doctor-source-scan.test.mjs cli/lib/errors.test.mjs cli/lib/pay.test.mjs cli-bootstrap-next-actions.test.mjs && npm run test:docs",
37
+ "test:e2e": "npm run build && node --test cli-core-target.test.mjs && node --experimental-test-module-mocks --test cli-gitvault-surface.test.mjs cli-identity-link.test.mjs cli-identity-link-matrix.test.mjs cli-redeem.test.mjs && node --test cli-help-listing.test.mjs cli-output-contract.test.mjs cli-json-noop-contract.test.mjs cli-e2e.test.mjs cli-help.test.mjs cli-provision-active.test.mjs cli-typed-config-modes.test.mjs cli-argv.test.mjs cli-conventions-gate.test.mjs paid-stack-deps.test.mjs profile-guidance.test.mjs settlement-disclosure.test.mjs cli-suggestions-gate.test.mjs cli-env.test.mjs cli-wallets.test.mjs cli-org.test.mjs cli-org-context.test.mjs cli-ci.test.mjs cli-deploy-ci.test.mjs cli-operator-loopback.test.mjs cli-gitvault-remote-helper.test.mjs cli-deploy-gitvault-lane.test.mjs cli/lib/buzz-doctor-contract.test.mjs cli/lib/buzz-doctor.test.mjs cli/lib/diagnostic-telemetry.test.mjs cli/lib/doctor-source-scan.test.mjs cli/lib/errors.test.mjs cli-bootstrap-next-actions.test.mjs",
38
38
  "test:help": "npm run build && node --test cli-help.test.mjs",
39
39
  "test:integration": "node --test --import tsx core/src/siwx-integration.integ.ts",
40
40
  "test:integration:full": "node --test --import tsx cli-integration.test.ts",
@@ -0,0 +1,24 @@
1
+ /** The committed binding file. Safe to check in — it names, never authorizes. */
2
+ export declare const BINDING_FILE = ".run402.json";
3
+ /** The personal override. Gitignored; beats the committed file key-by-key. */
4
+ export declare const BINDING_LOCAL_FILE = ".run402.local.json";
5
+ export interface BindingKeyHit {
6
+ /** The trimmed value found. */
7
+ value: string;
8
+ /** The file it came from — surfaced in provenance and conflict messages. */
9
+ file: string;
10
+ }
11
+ /**
12
+ * Nearest binding of `key`, walking up from `startDir` to the filesystem root.
13
+ *
14
+ * Resolution is PER KEY, not per file: the nearest file that carries the key
15
+ * wins, so `/work/.run402.json` may supply the organization while
16
+ * `/work/api/.run402.json` supplies the wallet. A worktree nested under a bound
17
+ * checkout therefore inherits the binding without restating it.
18
+ */
19
+ export declare function findBindingKey(startDir: string, key: string): BindingKeyHit | null;
20
+ /** Path of the committed binding file for a directory. */
21
+ export declare function bindingFilePath(dir?: string): string;
22
+ /** Parse a directory's committed binding file, or `{}` when absent/unreadable. */
23
+ export declare function readBindingFile(dir?: string): Record<string, unknown>;
24
+ //# sourceMappingURL=binding-file.d.ts.map
@@ -0,0 +1,83 @@
1
+ /**
2
+ * The per-directory binding file — `.run402.json`, and its gitignored personal
3
+ * override `.run402.local.json`.
4
+ *
5
+ * A checkout binds itself to a wallet profile, an organization, a room, by
6
+ * committing a small JSON file. That is a CHECKOUT-LEVEL CONTRACT, not a CLI
7
+ * implementation detail: every agent working in the directory inherits the
8
+ * same one, whichever surface it reaches Run402 through.
9
+ *
10
+ * It lives in core because two surfaces now read it. The CLI has always walked
11
+ * this chain; the MCP server needs the same answer for the same directory, and
12
+ * `run402-mcp` ships only `dist` + `core/dist` + `sdk/dist` — `cli/` is not in
13
+ * the published package, so the MCP server cannot import the CLI's copy even
14
+ * if it wanted to. One reader, in the one place both can see it, rather than
15
+ * two that agree until they don't.
16
+ *
17
+ * Deliberately pure: `node:fs` + `node:path`, no logging, no process exit, no
18
+ * validation of what a value MEANS. Callers decide whether a value is
19
+ * well-shaped and what to do when it isn't — the CLI exits, the MCP server
20
+ * returns an error, and neither behaviour belongs in a file reader.
21
+ *
22
+ * Unknown keys are ignored on purpose: that is what makes an older client
23
+ * forward-compatible with a binding file written by a newer one.
24
+ */
25
+ import { readFileSync } from "node:fs";
26
+ import { dirname, join, resolve } from "node:path";
27
+ /** The committed binding file. Safe to check in — it names, never authorizes. */
28
+ export const BINDING_FILE = ".run402.json";
29
+ /** The personal override. Gitignored; beats the committed file key-by-key. */
30
+ export const BINDING_LOCAL_FILE = ".run402.local.json";
31
+ /** Read one key from a single directory's binding files, override first. */
32
+ function readBindingKeyFrom(dir, key) {
33
+ for (const fname of [BINDING_LOCAL_FILE, BINDING_FILE]) {
34
+ const p = join(dir, fname);
35
+ try {
36
+ const parsed = JSON.parse(readFileSync(p, "utf8"));
37
+ const v = parsed?.[key];
38
+ if (typeof v === "string" && v.trim())
39
+ return { value: v.trim(), file: p };
40
+ }
41
+ catch {
42
+ /* missing / unreadable / malformed → skip */
43
+ }
44
+ }
45
+ return null;
46
+ }
47
+ /**
48
+ * Nearest binding of `key`, walking up from `startDir` to the filesystem root.
49
+ *
50
+ * Resolution is PER KEY, not per file: the nearest file that carries the key
51
+ * wins, so `/work/.run402.json` may supply the organization while
52
+ * `/work/api/.run402.json` supplies the wallet. A worktree nested under a bound
53
+ * checkout therefore inherits the binding without restating it.
54
+ */
55
+ export function findBindingKey(startDir, key) {
56
+ let dir = resolve(startDir);
57
+ for (;;) {
58
+ const hit = readBindingKeyFrom(dir, key);
59
+ if (hit)
60
+ return hit;
61
+ const parent = dirname(dir);
62
+ if (parent === dir)
63
+ return null;
64
+ dir = parent;
65
+ }
66
+ }
67
+ /** Path of the committed binding file for a directory. */
68
+ export function bindingFilePath(dir = process.cwd()) {
69
+ return join(dir, BINDING_FILE);
70
+ }
71
+ /** Parse a directory's committed binding file, or `{}` when absent/unreadable. */
72
+ export function readBindingFile(dir = process.cwd()) {
73
+ try {
74
+ const parsed = JSON.parse(readFileSync(bindingFilePath(dir), "utf8"));
75
+ return parsed && typeof parsed === "object" && !Array.isArray(parsed)
76
+ ? parsed
77
+ : {};
78
+ }
79
+ catch {
80
+ return {};
81
+ }
82
+ }
83
+ //# sourceMappingURL=binding-file.js.map
@@ -36,10 +36,19 @@ export declare class Events {
36
36
  */
37
37
  list(projectId: string, opts?: ListEventsOptions): Promise<ProjectEventFeedPage>;
38
38
  /**
39
- * Read the org-wide feed the union across every project the org owns
40
- * (`GET /orgs/v1/:org_id/events`). Principal-only: requires an active org
41
- * membership; a project service_key is rejected by the gateway. Same
42
- * `opts.source` / `opts.eventType` filters as {@link list}.
39
+ * Read the org-wide feed (`GET /orgs/v1/:org_id/events`) every fact the
40
+ * organization owns. That is a SUPERSET of its project feeds, not a union
41
+ * of them: it also carries organization-level facts, which belong to no
42
+ * project, arrive with `project_id: null`, and are unreachable from any
43
+ * project feed.
44
+ *
45
+ * Principal-only: requires an active org membership; a project service_key
46
+ * is rejected by the gateway. Same `opts.source` / `opts.eventType` filters
47
+ * as {@link list}.
48
+ *
49
+ * Cursors do NOT interchange with {@link list}, even though an event's `id`
50
+ * is the same in both — a cursor names a position inside one projection.
51
+ * Carrying one across returns `reset: true`; see {@link ListEventsOptions.cursor}.
43
52
  */
44
53
  listForOrg(orgId: string, opts?: ListEventsOptions): Promise<ProjectEventFeedPage>;
45
54
  }
@@ -1 +1 @@
1
- {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/namespaces/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAcjF,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;OAOG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAU1F;;;;;OAKG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAS7F"}
1
+ {"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/namespaces/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAcjF,qBAAa,MAAM;IACL,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,MAAM;IAE3C;;;;;;;OAOG;IACG,IAAI,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAU1F;;;;;;;;;;;;;;OAcG;IACG,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,GAAE,iBAAsB,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAS7F"}
@@ -56,10 +56,19 @@ export class Events {
56
56
  return this.client.request(`/projects/v1/${encodeURIComponent(projectId)}/events${feedQuery(opts)}`, { method: "GET", context: "reading project events feed" });
57
57
  }
58
58
  /**
59
- * Read the org-wide feed the union across every project the org owns
60
- * (`GET /orgs/v1/:org_id/events`). Principal-only: requires an active org
61
- * membership; a project service_key is rejected by the gateway. Same
62
- * `opts.source` / `opts.eventType` filters as {@link list}.
59
+ * Read the org-wide feed (`GET /orgs/v1/:org_id/events`) every fact the
60
+ * organization owns. That is a SUPERSET of its project feeds, not a union
61
+ * of them: it also carries organization-level facts, which belong to no
62
+ * project, arrive with `project_id: null`, and are unreachable from any
63
+ * project feed.
64
+ *
65
+ * Principal-only: requires an active org membership; a project service_key
66
+ * is rejected by the gateway. Same `opts.source` / `opts.eventType` filters
67
+ * as {@link list}.
68
+ *
69
+ * Cursors do NOT interchange with {@link list}, even though an event's `id`
70
+ * is the same in both — a cursor names a position inside one projection.
71
+ * Carrying one across returns `reset: true`; see {@link ListEventsOptions.cursor}.
63
72
  */
64
73
  async listForOrg(orgId, opts = {}) {
65
74
  if (!orgId) {
@@ -1 +1 @@
1
- {"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/namespaces/events.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,SAAS,SAAS,CAAC,OAA0B,EAAE;IAC7C,MA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ailbox suspensions, transfers,
8
8
  * lifecycle cliffs, verification outcomes, and `platform_incident`
9
- * fault-attribution events). Cursors are OPAQUE (`evc_…`): store the page's
10
- * `cursor` and pass it back as `{ cursor }` next time — never parse it. The
9
+ * fault-attribution events).
10
+ *
11
+ * An ORGANIZATION owns each fact and `project_id` says what it is about, so
12
+ * three things follow. The org feed is a SUPERSET of the project feeds: it
13
+ * also carries organization-level facts, which belong to no project and
14
+ * arrive with `project_id: null`. A fact OUTLIVES the project it describes —
15
+ * deleting a project no longer erases its history, so a row may name a
16
+ * project that no longer exists. And an event's `id` is NOT a page cursor:
17
+ * see {@link ProjectEvent.id} and {@link ListEventsOptions.cursor}.
18
+ *
19
+ * Both tokens are OPAQUE (`evc_…`) — store the page's `cursor`, pass it back
20
+ * as `{ cursor }` next time, and never parse either one. The
11
21
  * platform owns the event vocabulary, `next_actions` synthesis, and reset
12
22
  * behavior; the SDK passes everything through (index signatures keep unknown
13
23
  * future fields, including the additive `platform_incidents[]` overlay and
@@ -32,10 +42,27 @@ export interface ProjectEventNextAction {
32
42
  why?: string;
33
43
  [key: string]: unknown;
34
44
  }
35
- /** One immutable fact from the project events feed. */
45
+ /** One immutable fact from the events feed. */
36
46
  export interface ProjectEvent {
37
- /** Opaque event cursor (`evc_…`) — also a valid `cursor` input to resume after this event. */
47
+ /**
48
+ * This event's opaque identity (`evc_…`). The SAME event carries the SAME
49
+ * `id` in the project feed and the organization feed, which is what lets
50
+ * you dedup across both.
51
+ *
52
+ * NOT a page cursor. An id names a FACT; a cursor names a POSITION inside
53
+ * one projection, and only the page's `cursor` is that. Passing an `id` as
54
+ * `{ cursor }` returns `reset: true` rather than resuming.
55
+ */
38
56
  id: string;
57
+ /**
58
+ * What this fact is ABOUT — `null` for an organization-level fact, which
59
+ * belongs to the organization and to no project. Those appear only on the
60
+ * organization feed; a project feed can never show them.
61
+ *
62
+ * May name a project that NO LONGER EXISTS: a fact outlives the project it
63
+ * describes, so do not assume this resolves.
64
+ */
65
+ project_id: string | null;
39
66
  /** Flat snake_case event name, e.g. `deploy_activated`, `mailbox_suspended`. */
40
67
  event_type: string;
41
68
  /** Event class stamped at write time (drives retention: mandatory classes keep 365 days, others 90). */
@@ -50,9 +77,18 @@ export interface ProjectEvent {
50
77
  /** Options for {@link Events.list} / {@link Events.listForOrg}. */
51
78
  export interface ListEventsOptions {
52
79
  /**
53
- * Opaque cursor from a prior page (`cursor` field or an event `id`).
54
- * Returns events strictly after it. Omit on first contact to start from
55
- * the earliest retained event.
80
+ * Opaque page cursor from a prior page's `cursor` field. Returns events
81
+ * strictly after it. Omit on first contact to start from the earliest
82
+ * retained event.
83
+ *
84
+ * A page cursor is bound to the PROJECTION that issued it — the feed you
85
+ * read plus any `source` / `eventType` filters. It is not portable:
86
+ * replaying a project feed's cursor against the organization feed, an
87
+ * unfiltered cursor against a filtered read, or an event `id` in place of a
88
+ * cursor all return `reset: true` instead of resuming, because resuming
89
+ * would silently skip exactly the rows the other projection omitted.
90
+ *
91
+ * So key any cursor you persist by the read shape it came from.
56
92
  */
57
93
  cursor?: string;
58
94
  /** Page size (server default 50, max 200). */
@@ -81,12 +117,17 @@ export interface ProjectEventFeedPage {
81
117
  /** True when more events are immediately available past `cursor`. */
82
118
  has_more: boolean;
83
119
  /**
84
- * True when the supplied cursor was unusable (malformed or older than the
85
- * retention floor). The page restarts from the earliest retained event and
86
- * `earliest_cursor` is provided never a bare error, never a silent skip.
120
+ * True when the supplied cursor was unusable malformed, older than the
121
+ * retention floor, issued for a DIFFERENT projection (another feed or
122
+ * filter set), or actually an event `id`. The page restarts from the
123
+ * earliest retained event and `earliest_cursor` is provided — never a bare
124
+ * error, never a silent skip.
87
125
  */
88
126
  reset: boolean;
89
- /** Present only when `reset` is true: a cursor just before the earliest retained event. */
127
+ /**
128
+ * Present only when `reset` is true: a page cursor just before the earliest
129
+ * retained event, issued for the projection you actually read.
130
+ */
90
131
  earliest_cursor?: string;
91
132
  /**
92
133
  * Sidecar overlay of open GLOBAL (unattributed) platform incidents, each
@@ -1 +1 @@
1
- {"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/events.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,YAAY;IAC3B,8FAA8F;IAC9F,EAAE,EAAE,MAAM,CAAC;IACX,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,yHAAyH;IACzH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,4EAA4E;IAC5E,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,KAAK,EAAE,OAAO,CAAC;IACf,2FAA2F;IAC3F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
1
+ {"version":3,"file":"events.types.d.ts","sourceRoot":"","sources":["../../src/namespaces/events.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,6EAA6E;AAC7E,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,+CAA+C;AAC/C,MAAM,WAAW,YAAY;IAC3B;;;;;;;;OAQG;IACH,EAAE,EAAE,MAAM,CAAC;IACX;;;;;;;OAOG;IACH,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,gFAAgF;IAChF,UAAU,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,yHAAyH;IACzH,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,4EAA4E;IAC5E,YAAY,EAAE,sBAAsB,EAAE,CAAC;IACvC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,mEAAmE;AACnE,MAAM,WAAW,iBAAiB;IAChC;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,KAAK,GAAG,UAAU,CAAC;IAC5B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,YAAY,EAAE,CAAC;IACvB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf,qEAAqE;IACrE,QAAQ,EAAE,OAAO,CAAC;IAClB;;;;;;OAMG;IACH,KAAK,EAAE,OAAO,CAAC;IACf;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,kBAAkB,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IACpD;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -6,8 +6,18 @@
6
6
  * The feed is the platform's durable, ordered record of operationally
7
7
  * significant facts (deploy activations, mailbox suspensions, transfers,
8
8
  * lifecycle cliffs, verification outcomes, and `platform_incident`
9
- * fault-attribution events). Cursors are OPAQUE (`evc_…`): store the page's
10
- * `cursor` and pass it back as `{ cursor }` next time — never parse it. The
9
+ * fault-attribution events).
10
+ *
11
+ * An ORGANIZATION owns each fact and `project_id` says what it is about, so
12
+ * three things follow. The org feed is a SUPERSET of the project feeds: it
13
+ * also carries organization-level facts, which belong to no project and
14
+ * arrive with `project_id: null`. A fact OUTLIVES the project it describes —
15
+ * deleting a project no longer erases its history, so a row may name a
16
+ * project that no longer exists. And an event's `id` is NOT a page cursor:
17
+ * see {@link ProjectEvent.id} and {@link ListEventsOptions.cursor}.
18
+ *
19
+ * Both tokens are OPAQUE (`evc_…`) — store the page's `cursor`, pass it back
20
+ * as `{ cursor }` next time, and never parse either one. The
11
21
  * platform owns the event vocabulary, `next_actions` synthesis, and reset
12
22
  * behavior; the SDK passes everything through (index signatures keep unknown
13
23
  * future fields, including the additive `platform_incidents[]` overlay and
@@ -1 +1 @@
1
- {"version":3,"file":"events.types.js","sourceRoot":"","sources":["../../src/namespaces/events.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG"}
1
+ {"version":3,"file":"events.types.js","sourceRoot":"","sources":["../../src/namespaces/events.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG"}