@letta-ai/letta-code 0.34.19 → 0.34.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/mcp-client.js +2 -2
- package/dist/mcp-client.js.map +1 -1
- package/dist/mcp-oauth.js +2 -2
- package/dist/mcp-oauth.js.map +1 -1
- package/dist/types/agent/mcp-originator-authority-file.d.ts +75 -0
- package/dist/types/agent/mcp-originator-authority-file.d.ts.map +1 -0
- package/dist/types/agent/mcp-originator-authority.d.ts +134 -0
- package/dist/types/agent/mcp-originator-authority.d.ts.map +1 -0
- package/dist/types/agent/mcp-originator-keepalive.d.ts +61 -0
- package/dist/types/agent/mcp-originator-keepalive.d.ts.map +1 -0
- package/dist/types/agent/mcp-originator-tokens.d.ts +207 -0
- package/dist/types/agent/mcp-originator-tokens.d.ts.map +1 -0
- package/dist/types/agent/modify.d.ts.map +1 -1
- package/dist/types/auth/oauth-refresh.d.ts +3 -1
- package/dist/types/auth/oauth-refresh.d.ts.map +1 -1
- package/dist/types/auth/oauth.d.ts +1 -1
- package/dist/types/auth/oauth.d.ts.map +1 -1
- package/dist/types/auth/org-credentials-session.d.ts +9 -3
- package/dist/types/auth/org-credentials-session.d.ts.map +1 -1
- package/dist/types/backend/api/request.d.ts +3 -1
- package/dist/types/backend/api/request.d.ts.map +1 -1
- package/dist/types/backend/api/unified-mcp.d.ts +7 -0
- package/dist/types/backend/api/unified-mcp.d.ts.map +1 -1
- package/dist/types/cli/subcommands/mcp.d.ts.map +1 -1
- package/dist/types/runtime-context.d.ts +6 -0
- package/dist/types/runtime-context.d.ts.map +1 -1
- package/dist/types/tools/impl/task.d.ts +2 -0
- package/dist/types/tools/impl/task.d.ts.map +1 -1
- package/dist/types/tools/toolset.d.ts +2 -0
- package/dist/types/tools/toolset.d.ts.map +1 -1
- package/dist/types/types/input-command.d.ts +59 -0
- package/dist/types/types/input-command.d.ts.map +1 -0
- package/dist/types/types/input-create-message.d.ts +42 -0
- package/dist/types/types/input-create-message.d.ts.map +1 -0
- package/dist/types/types/protocol_v2.d.ts +3 -63
- package/dist/types/types/protocol_v2.d.ts.map +1 -1
- package/dist/types/websocket/listener/queue.d.ts.map +1 -1
- package/dist/types/websocket/listener/types.d.ts +16 -0
- package/dist/types/websocket/listener/types.d.ts.map +1 -1
- package/dist/types/websocket/ws-event-redaction.d.ts.map +1 -1
- package/letta.js +2125 -1174
- package/npm-shrinkwrap.json +2 -2
- package/package.json +1 -1
- package/scripts/source-file-size-baseline.json +1 -2
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable-file layer for MCP originator authority records: types, wire
|
|
3
|
+
* validation, lattice merges, path resolution, and the locked whole-file
|
|
4
|
+
* read/write primitives. Split out of mcp-originator-authority.ts so both
|
|
5
|
+
* modules stay under the source-file size limit; all policy (gates,
|
|
6
|
+
* transactions, pending retirements) lives in the parent module.
|
|
7
|
+
*/
|
|
8
|
+
export type McpOriginatorAuthorityState = "live" | "headerless" | "terminal";
|
|
9
|
+
/** The non-live end states a retirement can target. */
|
|
10
|
+
export type McpOriginatorRetirementState = Exclude<McpOriginatorAuthorityState, "live">;
|
|
11
|
+
export type AuthorityRecord = {
|
|
12
|
+
/** Highest mint generation observed for this run (any delivery kind). */
|
|
13
|
+
floor?: number;
|
|
14
|
+
state: McpOriginatorAuthorityState;
|
|
15
|
+
/**
|
|
16
|
+
* Durable retirement intent (evil-shub round-9 P1): set when the actual
|
|
17
|
+
* headerless/terminal mark could not be persisted. Every gate treats a
|
|
18
|
+
* record carrying an intent as NOT live, so peers fail closed even though
|
|
19
|
+
* the final state never landed; cleared when the mark lands.
|
|
20
|
+
*/
|
|
21
|
+
retiringTo?: McpOriginatorRetirementState;
|
|
22
|
+
updatedAtMs: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A wire or disk generation is meaningful only as a nonnegative safe
|
|
26
|
+
* integer (evil-shub round-6 P1): a string, negative, fractional, or NaN
|
|
27
|
+
* value used to flow straight into Math.max, producing a NaN floor that
|
|
28
|
+
* silently disabled every later floor comparison (NaN < x is false).
|
|
29
|
+
*/
|
|
30
|
+
export declare function isValidGeneration(generation: unknown): generation is number;
|
|
31
|
+
/**
|
|
32
|
+
* A record timestamp is meaningful only as a nonnegative safe integer not
|
|
33
|
+
* impossibly far in the future (evil-shub round-8 P1). A negative or NaN
|
|
34
|
+
* value flows into pruneExpired as `now - t > TTL` = always true, erasing
|
|
35
|
+
* live/terminal boundaries on the very next access — a fail-OPEN read of a
|
|
36
|
+
* corrupt file. A far-future value never prunes, pinning a stale floor.
|
|
37
|
+
*/
|
|
38
|
+
export declare function isValidUpdatedAtMs(updatedAtMs: unknown, nowMs: number): updatedAtMs is number;
|
|
39
|
+
/** Test-only: point persistence at a fixture path (null = in-memory only). */
|
|
40
|
+
export declare function configureAuthorityPersistencePathForTests(path: string | null): void;
|
|
41
|
+
export declare function authorityPersistentPath(): string | null;
|
|
42
|
+
export declare const STATE_RANK: Record<McpOriginatorAuthorityState, number>;
|
|
43
|
+
/**
|
|
44
|
+
* Merge a durable retirement intent under the same monotonicity as the
|
|
45
|
+
* state lattice: once expressed, an intent is never silently relaxed, and a
|
|
46
|
+
* pending terminal subsumes a pending headerless. Intents are meaningless
|
|
47
|
+
* once the record left `live` (the landed mark is the stronger boundary).
|
|
48
|
+
*/
|
|
49
|
+
export declare function mergeRetirementIntents(a: McpOriginatorRetirementState | undefined, b: McpOriginatorRetirementState | undefined): McpOriginatorRetirementState | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* Merge two records for the same run under the monotone lattice: max floor,
|
|
52
|
+
* max state, max timestamp, strongest retirement intent. Never relaxes
|
|
53
|
+
* either side.
|
|
54
|
+
*/
|
|
55
|
+
export declare function mergeRecords(a: AuthorityRecord, b: AuthorityRecord | undefined): AuthorityRecord;
|
|
56
|
+
/**
|
|
57
|
+
* Read the durable file. `degraded: true` means the file EXISTS but could
|
|
58
|
+
* not be read, parsed, or fully validated: the durable floor/retirement
|
|
59
|
+
* state is unknown, so callers must fail CLOSED (deny admission, deny token
|
|
60
|
+
* use) and must never overwrite the damaged file — writing a fresh file
|
|
61
|
+
* over it would erase a persisted headerless/terminal boundary and let a
|
|
62
|
+
* duplicate re-arm authority the operator already revoked (evil-shub
|
|
63
|
+
* round-5 P1). A missing file is NOT degraded: nothing was ever persisted.
|
|
64
|
+
*/
|
|
65
|
+
export declare function readAuthorityRecords(path: string): {
|
|
66
|
+
records: Map<string, AuthorityRecord>;
|
|
67
|
+
degraded: boolean;
|
|
68
|
+
};
|
|
69
|
+
/**
|
|
70
|
+
* Write with the same discipline as the disposition ledger: unique tmp file,
|
|
71
|
+
* fsync before rename, fsync the directory after. Throws on failure — the
|
|
72
|
+
* caller decides whether the mutation must degrade to in-memory only.
|
|
73
|
+
*/
|
|
74
|
+
export declare function writeAuthorityRecords(path: string, records: Map<string, AuthorityRecord>): void;
|
|
75
|
+
//# sourceMappingURL=mcp-originator-authority-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-originator-authority-file.d.ts","sourceRoot":"","sources":["../../../src/agent/mcp-originator-authority-file.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,MAAM,MAAM,2BAA2B,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,CAAC;AAE7E,uDAAuD;AACvD,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD,2BAA2B,EAC3B,MAAM,CACP,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,yEAAyE;IACzE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,2BAA2B,CAAC;IACnC;;;;;OAKG;IACH,UAAU,CAAC,EAAE,4BAA4B,CAAC;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,GAAG,UAAU,IAAI,MAAM,CAM3E;AAKD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,OAAO,EACpB,KAAK,EAAE,MAAM,GACZ,WAAW,IAAI,MAAM,CAOvB;AASD,8EAA8E;AAC9E,wBAAgB,yCAAyC,CACvD,IAAI,EAAE,MAAM,GAAG,IAAI,GAClB,IAAI,CAEN;AAED,wBAAgB,uBAAuB,IAAI,MAAM,GAAG,IAAI,CAoBvD;AAED,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,2BAA2B,EAAE,MAAM,CAIlE,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,CAAC,EAAE,4BAA4B,GAAG,SAAS,EAC3C,CAAC,EAAE,4BAA4B,GAAG,SAAS,GAC1C,4BAA4B,GAAG,SAAS,CAI1C;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAC1B,CAAC,EAAE,eAAe,EAClB,CAAC,EAAE,eAAe,GAAG,SAAS,GAC7B,eAAe,CAcjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG;IAClD,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACtC,QAAQ,EAAE,OAAO,CAAC;CACnB,CAsEA;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,eAAe,CAAC,GACpC,IAAI,CAuBN"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Durable MCP originator authority records (USER_SCOPED_MCP_CONNECTIONS).
|
|
3
|
+
*
|
|
4
|
+
* The in-memory token Map in mcp-originator-tokens.ts forgets everything on
|
|
5
|
+
* teardown, which leaves three paired holes (evil-shub round-3 review):
|
|
6
|
+
*
|
|
7
|
+
* - No generation floor: a zombie delivery from a superseded mint attempt is
|
|
8
|
+
* accepted whenever the newer generation is not (or no longer) visible in
|
|
9
|
+
* memory — before the newer frame arrives, or after a restart forgot it.
|
|
10
|
+
* - Liveness is not authority: the durable input ledger can prove a run's
|
|
11
|
+
* input is still live, but not that the run still OWNS MCP authority. An
|
|
12
|
+
* approval origin swap or a mixed-batch merge deliberately deletes the
|
|
13
|
+
* run's token so the continuation stays headerless; a duplicate frame
|
|
14
|
+
* would otherwise recreate the key and re-arm the header mid-turn.
|
|
15
|
+
* - Terminal runs must stay retired: a post-terminal duplicate must never
|
|
16
|
+
* re-insert a token.
|
|
17
|
+
*
|
|
18
|
+
* This module keeps a small durable record per super run id:
|
|
19
|
+
*
|
|
20
|
+
* { floor?: number; state: "live" | "headerless" | "terminal";
|
|
21
|
+
* retiringTo?: "headerless" | "terminal"; updatedAtMs }
|
|
22
|
+
*
|
|
23
|
+
* floor is the maximum observed mint generation; state transitions only ever
|
|
24
|
+
* move live → headerless|terminal (never back), mirroring the fail-closed
|
|
25
|
+
* intent of the boundaries that set them. retiringTo is a durable retirement
|
|
26
|
+
* INTENT (evil-shub round-9 P1): when a headerless/terminal mark cannot be
|
|
27
|
+
* persisted, the intent is written instead so peers treat the record as NOT
|
|
28
|
+
* live (fail closed for admission and token use) and a restarted process
|
|
29
|
+
* reloads the pending retirement and resumes the retry. Records survive
|
|
30
|
+
* process restarts in the same ~/.letta/state/<server-namespace>/ directory
|
|
31
|
+
* as the accepted input disposition ledger.
|
|
32
|
+
*
|
|
33
|
+
* Bounded by design: originator tokens carry a 1-hour absolute TTL ceiling
|
|
34
|
+
* server-side, so any record older than AUTHORITY_RECORD_TTL_MS (2h, twice
|
|
35
|
+
* the ceiling) can only describe dead tokens and is pruned on access.
|
|
36
|
+
*
|
|
37
|
+
* Persistence is serialized read-modify-write under the shared interprocess
|
|
38
|
+
* durable-file lock: every transaction re-reads and merges the file, so
|
|
39
|
+
* concurrent listener processes sharing the server-scoped file cannot erase
|
|
40
|
+
* each other's records (whole-file last-writer-wins would). Mutations are
|
|
41
|
+
* durable-first — callers retire volatile token state only after the mark
|
|
42
|
+
* lands. A failed write still applies the boundary in-memory (fail-closed
|
|
43
|
+
* for the live process) and logs every failure, never throwing into the
|
|
44
|
+
* input path.
|
|
45
|
+
*/
|
|
46
|
+
import { type McpOriginatorAuthorityState, type McpOriginatorRetirementState } from "./mcp-originator-authority-file";
|
|
47
|
+
export type { McpOriginatorAuthorityState, McpOriginatorRetirementState, } from "./mcp-originator-authority-file";
|
|
48
|
+
/**
|
|
49
|
+
* Re-attempt every pending retirement. Exported for the listener's
|
|
50
|
+
* teardown hook and driven explicitly by tests; the timer path calls it
|
|
51
|
+
* on an interval until the map drains.
|
|
52
|
+
*/
|
|
53
|
+
export declare function retryPendingMcpOriginatorRetirements(): void;
|
|
54
|
+
/** Test-only: pending retirements, for asserting retry registration. */
|
|
55
|
+
export declare function readPendingMcpOriginatorRetirementsForTests(): ReadonlyMap<string, {
|
|
56
|
+
state: McpOriginatorRetirementState;
|
|
57
|
+
generation?: number;
|
|
58
|
+
createdAtMs: number;
|
|
59
|
+
}>;
|
|
60
|
+
/**
|
|
61
|
+
* Record an accepted originator delivery (any kind: token, tombstone).
|
|
62
|
+
* Bumps the generation floor; never relaxes a headerless/terminal state.
|
|
63
|
+
* Returns false when the floor bump could not be persisted (see
|
|
64
|
+
* mutateDurableFirst) — callers must not treat the delivery as durably
|
|
65
|
+
* recorded.
|
|
66
|
+
*/
|
|
67
|
+
export declare function noteMcpOriginatorDelivery(runId: string, generation: number | undefined): boolean;
|
|
68
|
+
/**
|
|
69
|
+
* Atomic admission: evaluate the gate AND, when it passes, durably bump the
|
|
70
|
+
* generation floor — both inside ONE locked transaction (evil-shub round-5
|
|
71
|
+
* P1). The pre-round-6 allows() + note() pair released the lock between the
|
|
72
|
+
* check and the floor write, so a concurrent process could advance the
|
|
73
|
+
* floor or mark the run headerless/terminal in the gap and this process
|
|
74
|
+
* would still install its stale token. Here the check, the floor write, and
|
|
75
|
+
* the durable persistence are indivisible: if the durable write fails, the
|
|
76
|
+
* whole transaction throws and admission is DENIED (fail closed — the
|
|
77
|
+
* caller drops the delivery and does not ACK, so redelivery retries).
|
|
78
|
+
* A degraded durable file also denies: the persisted boundary is unknown.
|
|
79
|
+
*/
|
|
80
|
+
/**
|
|
81
|
+
* Admission outcome (evil-shub round-8 P1 verdict split). A PERMANENT
|
|
82
|
+
* denial means this exact delivery can never be admitted — a stale
|
|
83
|
+
* generation at-or-below the durable floor, a legacy delivery beneath a
|
|
84
|
+
* known generation contract, a headerless/terminal run, or a malformed
|
|
85
|
+
* generation. Redelivering it would loop forever, so the caller must
|
|
86
|
+
* consume/drop the frame (no work, no redelivery). A RETRYABLE denial
|
|
87
|
+
* means the durable boundary could not be evaluated at all (degraded
|
|
88
|
+
* durable file, failed transaction): the caller must not commit work and
|
|
89
|
+
* must not ACK, so redelivery retries the whole admission once the
|
|
90
|
+
* infrastructure heals.
|
|
91
|
+
*/
|
|
92
|
+
export type McpOriginatorAdmission = {
|
|
93
|
+
admitted: true;
|
|
94
|
+
} | {
|
|
95
|
+
admitted: false;
|
|
96
|
+
permanent: boolean;
|
|
97
|
+
};
|
|
98
|
+
export declare function admitMcpOriginatorDelivery(runId: string, generation: number | undefined): McpOriginatorAdmission;
|
|
99
|
+
/**
|
|
100
|
+
* Use-time authority recheck for token handout (evil-shub round-5 P1): the
|
|
101
|
+
* admission gate only runs at delivery; a revoked or deliberately retired
|
|
102
|
+
* run must not keep spending its token. Consulted by getMcpOriginatorToken
|
|
103
|
+
* on every scoped call: a non-live state or a floor ahead of the held
|
|
104
|
+
* generation withdraws the token (the call proceeds unattributed). Fail
|
|
105
|
+
* closed on degraded/unreadable durable state.
|
|
106
|
+
*/
|
|
107
|
+
export declare function mcpOriginatorAuthorityPermitsUse(runId: string, generation: number | undefined): boolean;
|
|
108
|
+
/**
|
|
109
|
+
* Mark a run's authority deliberately retired mid-turn (approval origin
|
|
110
|
+
* swap, mixed-batch merge): the continuation must stay headerless, so no
|
|
111
|
+
* later delivery of ANY generation may recreate the entry.
|
|
112
|
+
*/
|
|
113
|
+
export declare function markMcpOriginatorHeaderless(runId: string, deletedGeneration?: number): boolean;
|
|
114
|
+
/** Mark a run terminal: no later delivery may recreate the entry. */
|
|
115
|
+
export declare function markMcpOriginatorTerminal(runId: string, deletedGeneration?: number): boolean;
|
|
116
|
+
/**
|
|
117
|
+
* Admission gate consulted before every create/refresh/tombstone write.
|
|
118
|
+
* Rejects zombies below the floor, legacy deliveries beneath a known
|
|
119
|
+
* generation contract, and ANY delivery for a headerless/terminal run.
|
|
120
|
+
*/
|
|
121
|
+
export declare function mcpOriginatorAuthorityAllows(runId: string, generation: number | undefined): boolean;
|
|
122
|
+
/** Test-only: point persistence at a fixture path (null = in-memory only). */
|
|
123
|
+
export declare function configureMcpOriginatorAuthorityPersistenceForTests(path: string | null): void;
|
|
124
|
+
/** Test-only: shorten the record TTL (null restores the 2h default). */
|
|
125
|
+
export declare function configureMcpOriginatorAuthorityTtlForTests(ttlMs: number | null): void;
|
|
126
|
+
/** Test-only: drop every record and forget any loaded state. */
|
|
127
|
+
export declare function resetMcpOriginatorAuthority(): void;
|
|
128
|
+
/** Test-only diagnostics. */
|
|
129
|
+
export declare function readMcpOriginatorAuthorityForTests(runId: string): {
|
|
130
|
+
floor?: number;
|
|
131
|
+
state: McpOriginatorAuthorityState;
|
|
132
|
+
retiringTo?: McpOriginatorRetirementState;
|
|
133
|
+
} | undefined;
|
|
134
|
+
//# sourceMappingURL=mcp-originator-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-originator-authority.d.ts","sourceRoot":"","sources":["../../../src/agent/mcp-originator-authority.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAKH,OAAO,EAKL,KAAK,2BAA2B,EAChC,KAAK,4BAA4B,EAMlC,MAAM,iCAAiC,CAAC;AAEzC,YAAY,EACV,2BAA2B,EAC3B,4BAA4B,GAC7B,MAAM,iCAAiC,CAAC;AAgMz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AA0C,CACxD,KAAK,EAAE,MAAM,GAAG,IAAI,GACnB,IAAI,CAEN;AAED,gEAAgE;AAChE,wBAAgB,2BAA2B,IAAI,IAAI,CAQlD;AAED,6BAA6B;AAC7B,wBAAgB,kCAAkC,CAAC,KAAK,EAAE,MAAM,GAC5D;IACE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,2BAA2B,CAAC;IACnC,UAAU,CAAC,EAAE,4BAA4B,CAAC;CAC3C,GACD,SAAS,CAcZ"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Active-turn renewal for MCP originator tokens (USER_SCOPED_MCP_CONNECTIONS).
|
|
3
|
+
*
|
|
4
|
+
* The server slides a pair's TTL back to the full 300s window on every
|
|
5
|
+
* successful verify — which today means on every MCP tool call carrying the
|
|
6
|
+
* header. A turn whose tool calls are spaced further apart than that window
|
|
7
|
+
* (long LLM generations, approval waits, sandbox stalls) would find its
|
|
8
|
+
* token expired at the next call and silently continue unattributed
|
|
9
|
+
* (evil-shub round-5 P1 lease/renewal). While this process holds a live
|
|
10
|
+
* token entry for a run, this module pings
|
|
11
|
+
* POST /v1/mcp-originator-tokens/verify on an interval comfortably below
|
|
12
|
+
* the sliding TTL, keeping the pair alive for exactly as long as the token
|
|
13
|
+
* is held — never longer: tombstones, retirements, withdrawals, and store
|
|
14
|
+
* clears all stop the keepalive, and the absolute 1h ceiling binds
|
|
15
|
+
* server-side regardless.
|
|
16
|
+
*
|
|
17
|
+
* Renewal is not authority: a token the server has revoked or fenced comes
|
|
18
|
+
* back { valid: false }, the local entry is withdrawn immediately, and the
|
|
19
|
+
* turn continues headerless. Network failures tolerate three consecutive
|
|
20
|
+
* ticks before giving up loudly; the server-side TTL remains the bound.
|
|
21
|
+
* The token value is never logged.
|
|
22
|
+
*/
|
|
23
|
+
type VerifyResult = {
|
|
24
|
+
valid: boolean;
|
|
25
|
+
};
|
|
26
|
+
type VerifyFn = (token: string, signal: AbortSignal) => Promise<VerifyResult>;
|
|
27
|
+
/**
|
|
28
|
+
* Store access is injected by the caller (the token store) so this module
|
|
29
|
+
* never imports the store: the dependency points one way
|
|
30
|
+
* (store → keepalive), which keeps the import graph acyclic.
|
|
31
|
+
*/
|
|
32
|
+
export type KeepaliveHooks = {
|
|
33
|
+
/** Current raw token for the run, or undefined once the entry is gone. */
|
|
34
|
+
getToken: () => string | undefined;
|
|
35
|
+
/** Withdraw the entry after a server denial (turn continues headerless). */
|
|
36
|
+
withdraw: () => void;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Ensure a keepalive is running for a run holding a live token entry.
|
|
40
|
+
* Idempotent per run; called by the token store on every entry install.
|
|
41
|
+
* A RE-install (a fresh delivery replacing the held token) refreshes the
|
|
42
|
+
* hooks and resets the failure counter (evil-shub round-6 P1): strikes
|
|
43
|
+
* against the old token must not bleed into the new one's renewal budget.
|
|
44
|
+
*/
|
|
45
|
+
export declare function startMcpOriginatorKeepalive(superRunId: string, hooks: KeepaliveHooks): void;
|
|
46
|
+
/** Stop renewing a run's token (entry removal, tombstone, store clear). */
|
|
47
|
+
export declare function stopMcpOriginatorKeepalive(superRunId: string): void;
|
|
48
|
+
/** Stop every keepalive (listener session teardown, tests). */
|
|
49
|
+
export declare function stopAllMcpOriginatorKeepalives(): void;
|
|
50
|
+
/** Test-only: install a verify stub and/or a shorter interval; pass null to restore. */
|
|
51
|
+
export declare function configureMcpOriginatorKeepaliveForTests(config: {
|
|
52
|
+
verify?: VerifyFn;
|
|
53
|
+
intervalMs?: number;
|
|
54
|
+
verifyTimeoutMs?: number;
|
|
55
|
+
} | null): void;
|
|
56
|
+
/** Test-only: synchronously drive one tick for a run. */
|
|
57
|
+
export declare function runMcpOriginatorKeepaliveTickForTests(superRunId: string): Promise<void>;
|
|
58
|
+
/** Test-only: is a keepalive interval registered for this run? */
|
|
59
|
+
export declare function hasMcpOriginatorKeepaliveForTests(superRunId: string): boolean;
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=mcp-originator-keepalive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-originator-keepalive.d.ts","sourceRoot":"","sources":["../../../src/agent/mcp-originator-keepalive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAqBH,KAAK,YAAY,GAAG;IAAE,KAAK,EAAE,OAAO,CAAA;CAAE,CAAC;AACvC,KAAK,QAAQ,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAkC9E;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAC3B,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,MAAM,GAAG,SAAS,CAAC;IACnC,4EAA4E;IAC5E,QAAQ,EAAE,MAAM,IAAI,CAAC;CACtB,CAAC;AAwJF;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CACzC,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,cAAc,GACpB,IAAI,CAyCN;AAED,2EAA2E;AAC3E,wBAAgB,0BAA0B,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAKnE;AAED,+DAA+D;AAC/D,wBAAgB,8BAA8B,IAAI,IAAI,CAIrD;AAED,wFAAwF;AACxF,wBAAgB,uCAAuC,CACrD,MAAM,EAAE;IACN,MAAM,CAAC,EAAE,QAAQ,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,IAAI,GACP,IAAI,CAQN;AAED,yDAAyD;AACzD,wBAAsB,qCAAqC,CACzD,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAYf;AAED,kEAAkE;AAClE,wBAAgB,iCAAiC,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAE7E"}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* In-memory store for MCP originator tokens (USER_SCOPED_MCP_CONNECTIONS).
|
|
3
|
+
*
|
|
4
|
+
* The cloud relay delivers a short-lived originator token on the top-level
|
|
5
|
+
* run-input frame (`mcp_originator_token`, alongside `super_run_id` — never
|
|
6
|
+
* inside the user-message payload) when the super run is attributed to a
|
|
7
|
+
* principal. The listener forwards that token as the
|
|
8
|
+
* `x-letta-mcp-originator-token` header on MCP tool-run calls so cloud-api can
|
|
9
|
+
* authorize user-scoped MCP connections on behalf of the originating
|
|
10
|
+
* principal.
|
|
11
|
+
*
|
|
12
|
+
* Hygiene contract (pinned in the design doc):
|
|
13
|
+
* - Tokens live ONLY in this process-local Map, keyed by super run id.
|
|
14
|
+
* - The token value is never logged (boolean-presence diagnostics only),
|
|
15
|
+
* never persisted to disk, and never copied into tool args, transcripts,
|
|
16
|
+
* or durable listener records. Only the super run id may travel on turn
|
|
17
|
+
* plumbing (IncomingMessage, runtime context); lookups happen here.
|
|
18
|
+
* - Entries are deleted when the owning run reaches a terminal state and the
|
|
19
|
+
* whole store is cleared on listener session teardown (and process exit).
|
|
20
|
+
*
|
|
21
|
+
* Ordering contract (mint generations):
|
|
22
|
+
* - The producer re-mints per delivery attempt inside one atomic Lua script
|
|
23
|
+
* that INCRs a per-run generation counter, so every delivery carries a
|
|
24
|
+
* strictly newer generation than any earlier attempt. A delivery whose
|
|
25
|
+
* generation is OLDER than the stored entry is a zombie from a superseded
|
|
26
|
+
* attempt and is dropped; an equal generation is an idempotent re-delivery
|
|
27
|
+
* and last-write-wins within it.
|
|
28
|
+
* - Mixed-version rule: an entry WITHOUT a generation was written by a
|
|
29
|
+
* legacy producer and accepts any delivery; an entry WITH a generation
|
|
30
|
+
* rejects legacy (generation-less) deliveries, including tokenless clears
|
|
31
|
+
* — a stale legacy frame must never erase known-newer authority.
|
|
32
|
+
* - Tokenless deliveries record a tombstone (null token) rather than
|
|
33
|
+
* deleting, so a later stale create cannot resurrect the key below the
|
|
34
|
+
* tombstone's generation. Finalizers still hard-delete at terminal.
|
|
35
|
+
*
|
|
36
|
+
* Consumer side only: this module does not verify tokens, enforce ACLs, or
|
|
37
|
+
* decide attribution. When no token is held for a run, callers simply omit
|
|
38
|
+
* the header and the call proceeds unattributed.
|
|
39
|
+
*
|
|
40
|
+
* Authority floor (durable, mcp-originator-authority.ts): generation
|
|
41
|
+
* comparison alone only protects against generations this volatile Map still
|
|
42
|
+
* remembers. A durable per-run record carries the max observed generation
|
|
43
|
+
* (the floor) plus a monotone live → headerless|terminal state across
|
|
44
|
+
* restarts, so a zombie from a superseded mint is rejected even on an empty
|
|
45
|
+
* Map, and a run whose authority was deliberately retired (origin swap,
|
|
46
|
+
* mixed-batch merge, terminal) can never be re-armed by a duplicate frame.
|
|
47
|
+
*/
|
|
48
|
+
/**
|
|
49
|
+
* Resolve the held token for a super run, or undefined when the run is
|
|
50
|
+
* unattributed (no token delivered), the entry is a tombstone, or the token
|
|
51
|
+
* was already dropped.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getMcpOriginatorToken(superRunId: string | null | undefined): string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Seed a token directly (tests and local fixtures). Production entries only
|
|
56
|
+
* ever arrive through recordMcpOriginatorDelivery; a seeded entry is legacy
|
|
57
|
+
* (no generation) so any real delivery can supersede it.
|
|
58
|
+
*/
|
|
59
|
+
export declare function setMcpOriginatorToken(superRunId: string, token: string): void;
|
|
60
|
+
/** Drop the token for a super run that reached a terminal state. */
|
|
61
|
+
export declare function deleteMcpOriginatorToken(superRunId: string): void;
|
|
62
|
+
/** Drop every held token (listener session teardown, tests). */
|
|
63
|
+
export declare function clearMcpOriginatorTokens(): void;
|
|
64
|
+
/** Presence-only diagnostic: how many runs currently hold a token. */
|
|
65
|
+
export declare function mcpOriginatorTokenCount(): number;
|
|
66
|
+
/**
|
|
67
|
+
* The parsed originator delivery from an inbound frame — the single shape
|
|
68
|
+
* the pre-commit gate hands to the ack path so the ack installs EXACTLY
|
|
69
|
+
* what was admitted (evil-shub round-9 P1).
|
|
70
|
+
*/
|
|
71
|
+
export type McpOriginatorParsedDelivery = {
|
|
72
|
+
superRunId?: string;
|
|
73
|
+
token?: string;
|
|
74
|
+
generation?: number;
|
|
75
|
+
/**
|
|
76
|
+
* True when the frame CARRIED a generation that failed shape validation —
|
|
77
|
+
* distinguishable from a legacy frame carrying no generation at all.
|
|
78
|
+
*/
|
|
79
|
+
malformedGeneration?: boolean;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* Extract the originator delivery from an inbound top-level run-input frame.
|
|
83
|
+
*
|
|
84
|
+
* This is the single parse site for the relay contract fields. Wire data is
|
|
85
|
+
* untrusted: present-but-malformed tokens/ids are treated as absent (the
|
|
86
|
+
* turn then runs unattributed) rather than rejecting the whole input. A
|
|
87
|
+
* present-but-malformed GENERATION is different (evil-shub round-6 P1 #1):
|
|
88
|
+
* degrading it to "legacy" would let a first malformed delivery install a
|
|
89
|
+
* token beneath the generation contract entirely (no floor exists yet to
|
|
90
|
+
* reject it), so the parse surfaces `malformedGeneration` and admission
|
|
91
|
+
* denies the delivery fail-closed.
|
|
92
|
+
*/
|
|
93
|
+
export declare function readMcpOriginatorDelivery(payload: unknown): McpOriginatorParsedDelivery;
|
|
94
|
+
/**
|
|
95
|
+
* Apply an accepted input's originator delivery to the store.
|
|
96
|
+
*
|
|
97
|
+
* Used only by ack paths that did NOT pass through the router's pre-commit
|
|
98
|
+
* gate (duplicate re-acks and accepted approval payloads): it evaluates
|
|
99
|
+
* admission itself. Gated frames use installPreGatedMcpOriginatorDelivery
|
|
100
|
+
* instead — the gate's verdict is their single admission decision.
|
|
101
|
+
*
|
|
102
|
+
* Call only once the input has been ACCEPTED (queued or started); tokens
|
|
103
|
+
* belonging to rejected or dropped inputs must never reach the store.
|
|
104
|
+
*
|
|
105
|
+
* `allowCreate: false` (duplicate re-acks and accepted approval/teleport
|
|
106
|
+
* payloads — accepts that create no new owning turn) restricts the delivery
|
|
107
|
+
* to refreshing an entry that already exists. Two escape hatches keep live
|
|
108
|
+
* work from running headerless without reopening the orphaned-token hole:
|
|
109
|
+
*
|
|
110
|
+
* - `mayRecreateOwner`: when the entry is missing, the delivery may
|
|
111
|
+
* (re)create it if this predicate proves the DURABLE input ledger still
|
|
112
|
+
* shows a live accepted started/queued owner for this input — i.e. the
|
|
113
|
+
* work survived a process crash or an ACK loss and a finalizer still
|
|
114
|
+
* exists for it. Terminal disposition tombstones do not qualify, so a
|
|
115
|
+
* post-terminal duplicate can never re-insert an orphaned token.
|
|
116
|
+
* - Tombstones count as existing entries for ordering purposes: a stale
|
|
117
|
+
* create below the tombstone generation is dropped even when recreation
|
|
118
|
+
* would otherwise be allowed.
|
|
119
|
+
*/
|
|
120
|
+
/**
|
|
121
|
+
* Outcome of recording a delivery (evil-shub round-6 P1, split in round 8).
|
|
122
|
+
*
|
|
123
|
+
* - "denied_retryable": the durable admission gate could not be evaluated
|
|
124
|
+
* (degraded authority file, failed transaction). The caller MUST NOT ack
|
|
125
|
+
* the frame and MUST NOT commit work for it: Cloud's delivery gate
|
|
126
|
+
* treats an unacked frame as undeliverable and redelivers, retrying the
|
|
127
|
+
* whole admission once the infrastructure heals.
|
|
128
|
+
* - "denied_permanent": this exact delivery can never be admitted — a
|
|
129
|
+
* stale generation at-or-below the durable floor, a legacy delivery
|
|
130
|
+
* beneath a known generation contract, a headerless/terminal run, or a
|
|
131
|
+
* malformed generation. Redelivering it would loop forever with zero
|
|
132
|
+
* chance of success, so the caller CONSUMES the frame (acks or rejects
|
|
133
|
+
* it, per path) without installing a token and without running work
|
|
134
|
+
* under it.
|
|
135
|
+
* - "admitted" covers every post-admission outcome (stored, refreshed,
|
|
136
|
+
* create-deferred, tombstoned) — those are idempotent and ack normally.
|
|
137
|
+
* - "none" means the frame carried no originator stamp at all.
|
|
138
|
+
*/
|
|
139
|
+
export type McpOriginatorDeliveryVerdict = "admitted" | "denied_retryable" | "denied_permanent" | "none";
|
|
140
|
+
/**
|
|
141
|
+
* Volatile install half for a delivery the pre-commit gate ALREADY admitted
|
|
142
|
+
* (evil-shub round-9 P1). Runs NO durable transaction and makes NO admission
|
|
143
|
+
* decision: the gate's atomic admit (floor bump included) is the single
|
|
144
|
+
* admission verdict for this frame, so the ack path can never flip committed
|
|
145
|
+
* work to denied after the fact. A retirement racing the gap between gate
|
|
146
|
+
* and install is fenced at use time by mcpOriginatorAuthorityPermitsUse,
|
|
147
|
+
* which re-consults the durable authority on every token use.
|
|
148
|
+
*
|
|
149
|
+
* `allowCreate: false` restricts the delivery to refreshing an entry that
|
|
150
|
+
* already exists; `mayRecreateOwner` is the narrow escape hatch (see
|
|
151
|
+
* recordMcpOriginatorDelivery).
|
|
152
|
+
*/
|
|
153
|
+
export declare function installPreGatedMcpOriginatorDelivery(delivery: McpOriginatorParsedDelivery, options?: {
|
|
154
|
+
allowCreate?: boolean;
|
|
155
|
+
mayRecreateOwner?: () => boolean;
|
|
156
|
+
}): void;
|
|
157
|
+
export declare function recordMcpOriginatorDelivery(frame: unknown, options?: {
|
|
158
|
+
allowCreate?: boolean;
|
|
159
|
+
mayRecreateOwner?: () => boolean;
|
|
160
|
+
}): McpOriginatorDeliveryVerdict;
|
|
161
|
+
/**
|
|
162
|
+
* Pre-commit admission gate (evil-shub round-8 P1; sole admission decision
|
|
163
|
+
* as of round-9 P1): evaluates ONLY the durable admission half of the
|
|
164
|
+
* delivery path — parse, malformed check, and the atomic durable admit
|
|
165
|
+
* (which bumps the generation floor) — without touching the volatile token
|
|
166
|
+
* store. The input router runs this BEFORE the durable input
|
|
167
|
+
* commit/enqueue/start so a denied frame never commits work it cannot be
|
|
168
|
+
* authorized for, and hands the returned `delivery` to the ack path, which
|
|
169
|
+
* installs it via installPreGatedMcpOriginatorDelivery with NO second
|
|
170
|
+
* admission transaction — a re-admission at ack time could flip committed
|
|
171
|
+
* work to denied when a retirement lands in the gate→ack gap (TOCTOU).
|
|
172
|
+
* Retirement in that gap is instead fenced at use time by
|
|
173
|
+
* mcpOriginatorAuthorityPermitsUse.
|
|
174
|
+
*/
|
|
175
|
+
export declare function gateMcpOriginatorDeliveryAdmission(frame: unknown): {
|
|
176
|
+
verdict: McpOriginatorDeliveryVerdict;
|
|
177
|
+
/**
|
|
178
|
+
* The parsed delivery, present when (and only when) the verdict is
|
|
179
|
+
* "admitted": exactly what the ack path must install.
|
|
180
|
+
*/
|
|
181
|
+
delivery?: McpOriginatorParsedDelivery;
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Fail closed when a turn's originator authority changes mid-run.
|
|
185
|
+
*
|
|
186
|
+
* An approval continuation that consumes a queued input from a DIFFERENT
|
|
187
|
+
* super run must not keep running under the original run's token, and the
|
|
188
|
+
* queued run's own token is consumed by this very merge. Retire both runs'
|
|
189
|
+
* held tokens so subsequent MCP calls omit the header (unattributed) instead
|
|
190
|
+
* of borrowing either run's authority. Same-run follow-ups are a no-op and
|
|
191
|
+
* keep their token (their run is still the one executing).
|
|
192
|
+
*/
|
|
193
|
+
export declare function retireMcpOriginatorTokensOnOriginSwap(turnSuperRunId: string | null | undefined, queuedSuperRunId: string | null | undefined): void;
|
|
194
|
+
/**
|
|
195
|
+
* Terminal retirement for the finalizer: drop the held token and mark the
|
|
196
|
+
* run terminal durably, so a post-terminal duplicate can never re-insert an
|
|
197
|
+
* orphaned token even after a restart forgot the deletion.
|
|
198
|
+
*/
|
|
199
|
+
export declare function retireMcpOriginatorTokenOnTerminal(superRunId: string | null | undefined): void;
|
|
200
|
+
/**
|
|
201
|
+
* Mixed-batch merge retirement: constituents' tokens can never be
|
|
202
|
+
* legitimately used by the unattributed merged turn, so they are retired and
|
|
203
|
+
* durably marked headerless — the merged finalizer cannot delete them later,
|
|
204
|
+
* and constituent duplicates must never recreate them.
|
|
205
|
+
*/
|
|
206
|
+
export declare function retireMcpOriginatorTokenOnMixedMerge(superRunId: string | null | undefined): void;
|
|
207
|
+
//# sourceMappingURL=mcp-originator-tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-originator-tokens.d.ts","sourceRoot":"","sources":["../../../src/agent/mcp-originator-tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AAuBH;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GACpC,MAAM,GAAG,SAAS,CAepB;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAG7E;AAED,oEAAoE;AACpE,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI,CAGjE;AAiBD,gEAAgE;AAChE,wBAAgB,wBAAwB,IAAI,IAAI,CAG/C;AAED,sEAAsE;AACtE,wBAAgB,uBAAuB,IAAI,MAAM,CAMhD;AAED;;;;GAIG;AACH,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,OAAO,GACf,2BAA2B,CAiC7B;AAgBD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,4BAA4B,GACpC,UAAU,GACV,kBAAkB,GAClB,kBAAkB,GAClB,MAAM,CAAC;AA2BX;;;;;;;;;;;;GAYG;AACH,wBAAgB,oCAAoC,CAClD,QAAQ,EAAE,2BAA2B,EACrC,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,OAAO,CAAA;CAAE,GACpE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AAM,CAAC,CAAC;KACtB,CAAC;CACH,GACA,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,MAAM,EACf,mBAAmB,EAAE,MAAM,GAAG,IAAI,GACjC,OAAO,CAAC,wBAAwB,CAAC,CAgBnC;AAED;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,UAAU,GAAG,IAAI,CAAC;CAC1B;AAED;;;;;;;GAOG;AACH,wBAAsB,uBAAuB,CAC3C,OAAO,EAAE,MAAM,EACf,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,wBAAwB,CAAC,CAwEnC;AAED;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,wBAAwB,CAAC,CA2GnC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { refreshAccessToken, type TokenResponse } from "./oauth";
|
|
2
2
|
type RefreshAccessToken = typeof refreshAccessToken;
|
|
3
|
-
export declare function refreshAccessTokenSingleFlight(refreshToken: string, deviceId: string, deviceName?: string, refresh?: RefreshAccessToken
|
|
3
|
+
export declare function refreshAccessTokenSingleFlight(refreshToken: string, deviceId: string, deviceName?: string, refresh?: RefreshAccessToken, options?: {
|
|
4
|
+
signal?: AbortSignal;
|
|
5
|
+
}): Promise<TokenResponse>;
|
|
4
6
|
export {};
|
|
5
7
|
//# sourceMappingURL=oauth-refresh.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth-refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/oauth-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,KAAK,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAIpD,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuC,
|
|
1
|
+
{"version":3,"file":"oauth-refresh.d.ts","sourceRoot":"","sources":["../../../src/auth/oauth-refresh.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAEtE,KAAK,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAIpD,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,EAChB,UAAU,CAAC,EAAE,MAAM,EACnB,OAAO,GAAE,kBAAuC,EAChD,OAAO,CAAC,EAAE;IAAE,MAAM,CAAC,EAAE,WAAW,CAAA;CAAE,GACjC,OAAO,CAAC,aAAa,CAAC,CAuBxB"}
|
|
@@ -68,7 +68,7 @@ export declare function pollForToken(deviceCode: string, interval: number | unde
|
|
|
68
68
|
/**
|
|
69
69
|
* Refresh an access token using a refresh token
|
|
70
70
|
*/
|
|
71
|
-
export declare function refreshAccessToken(refreshToken: string, deviceId: string, deviceName?: string): Promise<TokenResponse>;
|
|
71
|
+
export declare function refreshAccessToken(refreshToken: string, deviceId: string, deviceName?: string, signal?: AbortSignal): Promise<TokenResponse>;
|
|
72
72
|
/**
|
|
73
73
|
* Revoke a refresh token (logout)
|
|
74
74
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth.d.ts","sourceRoot":"","sources":["../../../src/auth/oauth.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAMH,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAM3D;;;;;GAKG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,CA+B3C;AAED,eAAO,MAA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Aa,CAAC,CAqDxB;AAED;;GAEG;AACH,wBAAsB,WAAW,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAqCrE;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAElB;AAED,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,0BAA0B,CAAC,CAwBrC"}
|
|
@@ -24,7 +24,9 @@ export declare class OrgCredentialSession {
|
|
|
24
24
|
update(credentials: SignedIn): void;
|
|
25
25
|
/** Last known token, for readers that cannot await (shell env, scrubbing). */
|
|
26
26
|
peekAccessToken(): string;
|
|
27
|
-
getAccessToken(
|
|
27
|
+
getAccessToken(options?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}): Promise<string>;
|
|
28
30
|
private refresh;
|
|
29
31
|
}
|
|
30
32
|
/**
|
|
@@ -34,13 +36,17 @@ export declare class OrgCredentialSession {
|
|
|
34
36
|
*/
|
|
35
37
|
export declare function activateOrgCredentials(organizationId: string, deviceId: string, credentials: SignedIn, refresh?: RefreshAccessToken): void;
|
|
36
38
|
/** Undefined means an ordinary CLI process, never an organization fallback. */
|
|
37
|
-
export declare function getOrgAccessToken(
|
|
39
|
+
export declare function getOrgAccessToken(options?: {
|
|
40
|
+
signal?: AbortSignal;
|
|
41
|
+
}): Promise<string> | undefined;
|
|
38
42
|
/**
|
|
39
43
|
* The credential a process-level session owns, if any: the organization
|
|
40
44
|
* sign-in for `letta server --org`, else the Desktop token. Undefined means
|
|
41
45
|
* the caller should fall through to the ambient key and the global sign-in.
|
|
42
46
|
*/
|
|
43
|
-
export declare function getSessionAccessToken(
|
|
47
|
+
export declare function getSessionAccessToken(options?: {
|
|
48
|
+
signal?: AbortSignal;
|
|
49
|
+
}): Promise<string | undefined>;
|
|
44
50
|
/** Sync counterpart for readers that cannot await; may lag one refresh. */
|
|
45
51
|
export declare function peekOrgAccessToken(): string | undefined;
|
|
46
52
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"org-credentials-session.d.ts","sourceRoot":"","sources":["../../../src/auth/org-credentials-session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,sCAAsC,CAAC;AAQ9C,KAAK,QAAQ,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACpD,KAAK,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"org-credentials-session.d.ts","sourceRoot":"","sources":["../../../src/auth/org-credentials-session.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,sCAAsC,CAAC;AAQ9C,KAAK,QAAQ,GAAG,cAAc,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AACpD,KAAK,kBAAkB,GAAG,OAAO,kBAAkB,CAAC;AAkDpD;;;;;;;GAOG;AACH,qBAAa,oBAAoB;IAK7B,QAAQ,CAAC,cAAc,EAAE,MAAM;IAC/B,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAEzB,OAAO,CAAC,QAAQ,CAAC,UAAU;IAC3B,OAAO,CAAC,QAAQ,CAAC,aAAa;IARhC,OAAO,CAAC,OAAO,CAAW;IAC1B,OAAO,CAAC,OAAO,CAAgC;gBAGpC,cAAc,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EACjC,WAAW,EAAE,QAAQ,EACJ,UAAU,GAAE,MAAmB,EAC/B,aAAa,GAAE,kBAAuC;IAKzE,4EAA4E;IAC5E,MAAM,CAAC,WAAW,EAAE,QAAQ,GAAG,IAAI;IAInC,8EAA8E;IAC9E,eAAe,IAAI,MAAM;IAInB,cAAc,CAAC,OAAO,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,WAAW,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;YAuB3D,OAAO;CAkCtB;AAWD;;;;GAIG;AACH,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,QAAQ,EAAE,MAAM,EAChB,WAAW,EAAE,QAAQ,EACrB,OAAO,GAAE,kBAAuC,GAC/C,IAAI,CAYN;AAED,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,OAAO,CAAC,EAAE;IAC1C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAE9B;AAED;;;;GAIG;AACH,wBAAsB,qBAAqB,CAAC,OAAO,CAAC,EAAE;IACpD,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAE9B;AAED,2EAA2E;AAC3E,wBAAgB,kBAAkB,IAAI,MAAM,GAAG,SAAS,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACpE,MAAM,EAAE,CAAC,GACR,CAAC,CAQH;AAED,eAAO,MAAM,yBAAyB;aAC3B,IAAI;CAGd,CAAC"}
|
|
@@ -20,7 +20,9 @@ export declare class ApiRequestError extends Error {
|
|
|
20
20
|
readonly headers?: Headers | undefined;
|
|
21
21
|
constructor(message: string, status: number, responseText: string, headers?: Headers | undefined);
|
|
22
22
|
}
|
|
23
|
-
export declare function getApiRequestConfig(
|
|
23
|
+
export declare function getApiRequestConfig(options?: {
|
|
24
|
+
signal?: AbortSignal;
|
|
25
|
+
}): Promise<ApiRequestConfig>;
|
|
24
26
|
/**
|
|
25
27
|
* Centralized seam for direct Letta API fetches that are not covered by the
|
|
26
28
|
* generated SDK. Keep raw route fetches here so local-mode can swap this layer
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/backend/api/request.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,6EAA6E;IAC7E,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACtE;AAED,qBAAa,eAAgB,SAAQ,KAAK;IAGtC,QAAQ,CAAC,MAAM,EAAE,MAAM;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM;IAC7B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO;gBAH1B,OAAO,EAAE,MAAM,EACN,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,OAAO,YAAA;CAK7B;AAED,wBAAsB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"request.d.ts","sourceRoot":"","sources":["../../../../src/backend/api/request.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG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MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,OAAO,GAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,MAAM,CAAM,GACrD,OAAO,CAAC,CAAC,CAAC,CAyBZ"}
|
|
@@ -3,6 +3,7 @@ export interface UnifiedMcpClient {
|
|
|
3
3
|
get(path: string): Promise<unknown>;
|
|
4
4
|
post(path: string, options?: {
|
|
5
5
|
body?: unknown;
|
|
6
|
+
headers?: Record<string, string>;
|
|
6
7
|
}): Promise<unknown>;
|
|
7
8
|
mcpServers?: {
|
|
8
9
|
list(): Promise<unknown[]>;
|
|
@@ -58,5 +59,11 @@ export declare function runUnifiedMcpTool(params: {
|
|
|
58
59
|
toolId: string;
|
|
59
60
|
args: Record<string, unknown>;
|
|
60
61
|
timeoutMs?: number;
|
|
62
|
+
/**
|
|
63
|
+
* Originator token held for the active super run. Sent verbatim as the
|
|
64
|
+
* `x-letta-mcp-originator-token` header; when absent the call proceeds
|
|
65
|
+
* unattributed and the header is omitted entirely. Never logged here.
|
|
66
|
+
*/
|
|
67
|
+
originatorToken?: string;
|
|
61
68
|
}): Promise<UnifiedMcpRunResult>;
|
|
62
69
|
//# sourceMappingURL=unified-mcp.d.ts.map
|