@run402/sdk 4.31.0 → 4.32.1
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/core-dist/binding-file.d.ts +24 -0
- package/core-dist/binding-file.js +83 -0
- package/dist/namespaces/events.d.ts +13 -4
- package/dist/namespaces/events.d.ts.map +1 -1
- package/dist/namespaces/events.js +13 -4
- package/dist/namespaces/events.js.map +1 -1
- package/dist/namespaces/events.types.d.ts +52 -11
- package/dist/namespaces/events.types.d.ts.map +1 -1
- package/dist/namespaces/events.types.js +12 -2
- package/dist/namespaces/events.types.js.map +1 -1
- package/package.json +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,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
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
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
|
|
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
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
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,MAAM,MAAM,GAAG,IAAI,eAAe,EAAE,CAAC;IACrC,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,IAAI,IAAI,CAAC,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;IACjE,IAAI,IAAI,CAAC,SAAS,KAAK,SAAS,EAAE,CAAC;QACjC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IACtG,CAAC;IACD,MAAM,EAAE,GAAG,MAAM,CAAC,QAAQ,EAAE,CAAC;IAC7B,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE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|
@@ -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).
|
|
10
|
-
*
|
|
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
|
|
45
|
+
/** One immutable fact from the events feed. */
|
|
36
46
|
export interface ProjectEvent {
|
|
37
|
-
/**
|
|
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
|
|
54
|
-
*
|
|
55
|
-
*
|
|
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
|
|
85
|
-
* retention floor
|
|
86
|
-
*
|
|
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
|
-
/**
|
|
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
|
|
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).
|
|
10
|
-
*
|
|
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
|
|
1
|
+
{"version":3,"file":"events.types.js","sourceRoot":"","sources":["../../src/namespaces/events.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@run402/sdk",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.32.1",
|
|
4
4
|
"description": "Typed TypeScript client for the Run402 API. Kernel shared by the run402-mcp server, the run402 CLI, and user-deployed run402 functions.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|