@relaymessenger/cli 0.4.4 → 0.5.0-staging.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.
- package/README.md +108 -118
- package/dist/cli.js +2 -172
- package/dist/cli.js.map +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +13 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +39 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +206 -0
- package/dist/config.js.map +1 -0
- package/dist/doctor.d.ts +20 -1
- package/dist/doctor.d.ts.map +1 -1
- package/dist/doctor.js +73 -112
- package/dist/doctor.js.map +1 -1
- package/dist/event-listen.d.ts +11 -0
- package/dist/event-listen.d.ts.map +1 -0
- package/dist/event-listen.js +37 -0
- package/dist/event-listen.js.map +1 -0
- package/dist/output.d.ts +4 -0
- package/dist/output.d.ts.map +1 -0
- package/dist/output.js +26 -0
- package/dist/output.js.map +1 -0
- package/dist/program.d.ts +14 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +655 -0
- package/dist/program.js.map +1 -0
- package/package.json +31 -37
- package/claude-plugin/marketplace/.claude-plugin/marketplace.json +0 -14
- package/claude-plugin/marketplace/plugins/relay/.claude-plugin/plugin.json +0 -27
- package/claude-plugin/marketplace/plugins/relay/LICENSE +0 -21
- package/claude-plugin/marketplace/plugins/relay/README.md +0 -173
- package/claude-plugin/marketplace/plugins/relay/commands/configure.md +0 -71
- package/claude-plugin/marketplace/plugins/relay/runtime/server.mjs +0 -26197
- package/dist/api.d.ts +0 -114
- package/dist/api.d.ts.map +0 -1
- package/dist/api.js +0 -162
- package/dist/api.js.map +0 -1
- package/dist/claude-settings.d.ts +0 -14
- package/dist/claude-settings.d.ts.map +0 -1
- package/dist/claude-settings.js +0 -47
- package/dist/claude-settings.js.map +0 -1
- package/dist/codex.d.ts +0 -25
- package/dist/codex.d.ts.map +0 -1
- package/dist/codex.js +0 -237
- package/dist/codex.js.map +0 -1
- package/dist/engine/acp.d.ts +0 -74
- package/dist/engine/acp.d.ts.map +0 -1
- package/dist/engine/acp.js +0 -413
- package/dist/engine/acp.js.map +0 -1
- package/dist/engine/catalog.d.ts +0 -26
- package/dist/engine/catalog.d.ts.map +0 -1
- package/dist/engine/catalog.js +0 -41
- package/dist/engine/catalog.js.map +0 -1
- package/dist/engine/process.d.ts +0 -12
- package/dist/engine/process.d.ts.map +0 -1
- package/dist/engine/process.js +0 -54
- package/dist/engine/process.js.map +0 -1
- package/dist/engine/types.d.ts +0 -57
- package/dist/engine/types.d.ts.map +0 -1
- package/dist/engine/types.js +0 -8
- package/dist/engine/types.js.map +0 -1
- package/dist/flags.d.ts +0 -9
- package/dist/flags.d.ts.map +0 -1
- package/dist/flags.js +0 -34
- package/dist/flags.js.map +0 -1
- package/dist/install.d.ts +0 -69
- package/dist/install.d.ts.map +0 -1
- package/dist/install.js +0 -513
- package/dist/install.js.map +0 -1
- package/dist/mcp.d.ts +0 -16
- package/dist/mcp.d.ts.map +0 -1
- package/dist/mcp.js +0 -127
- package/dist/mcp.js.map +0 -1
- package/dist/pair.d.ts +0 -20
- package/dist/pair.d.ts.map +0 -1
- package/dist/pair.js +0 -135
- package/dist/pair.js.map +0 -1
- package/dist/permissions.d.ts +0 -90
- package/dist/permissions.d.ts.map +0 -1
- package/dist/permissions.js +0 -361
- package/dist/permissions.js.map +0 -1
- package/dist/receive.d.ts +0 -113
- package/dist/receive.d.ts.map +0 -1
- package/dist/receive.js +0 -596
- package/dist/receive.js.map +0 -1
- package/dist/store.d.ts +0 -301
- package/dist/store.d.ts.map +0 -1
- package/dist/store.js +0 -551
- package/dist/store.js.map +0 -1
- package/openclaw-plugin/relaymessenger-openclaw-plugin-0.3.3.tgz +0 -0
package/dist/api.d.ts
DELETED
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility facade over the canonical @relaymessenger/sdk client.
|
|
3
|
-
*
|
|
4
|
-
* The running bridge uses the SDK for identity, polling, messages, typing,
|
|
5
|
-
* responding, and read receipts. This facade keeps the CLI's established
|
|
6
|
-
* positional signatures and implements only pairing and cursor-recovery
|
|
7
|
-
* endpoints that the current published SDK does not expose.
|
|
8
|
-
*/
|
|
9
|
-
import { normalizeRelayBaseUrl, RelayApiError } from "@relaymessenger/sdk";
|
|
10
|
-
import type { RelayEvent, RelayMentionRange, RelayMessage, RelayStyleRange } from "./store.js";
|
|
11
|
-
export { RelayApiError };
|
|
12
|
-
export declare const PRODUCTION_ORIGIN = "https://api.relayapp.im";
|
|
13
|
-
export declare const normalizeApiOrigin: typeof normalizeRelayBaseUrl;
|
|
14
|
-
/**
|
|
15
|
-
* Development/testing override for the Relay API origin. Production stays the
|
|
16
|
-
* default. The SDK owns all URL validation.
|
|
17
|
-
*/
|
|
18
|
-
export declare function resolveApiOrigin(fallback?: string): string;
|
|
19
|
-
export interface PairingCreated {
|
|
20
|
-
pairing_id: string;
|
|
21
|
-
code: string;
|
|
22
|
-
url: string;
|
|
23
|
-
poll_token: string;
|
|
24
|
-
expires_in: number;
|
|
25
|
-
}
|
|
26
|
-
export type PairingStatus = {
|
|
27
|
-
status: "pending";
|
|
28
|
-
} | {
|
|
29
|
-
status: "claimed";
|
|
30
|
-
agent_token: string;
|
|
31
|
-
agent?: Record<string, unknown>;
|
|
32
|
-
};
|
|
33
|
-
export interface EventsPage {
|
|
34
|
-
events: RelayEvent[];
|
|
35
|
-
next_cursor: number;
|
|
36
|
-
}
|
|
37
|
-
export interface EventCursorReconciliation {
|
|
38
|
-
reconciled: true;
|
|
39
|
-
resume_cursor: number;
|
|
40
|
-
}
|
|
41
|
-
export interface RelayConversation {
|
|
42
|
-
id: string;
|
|
43
|
-
kind?: "direct" | "group";
|
|
44
|
-
last_sequence?: number;
|
|
45
|
-
last_message_at?: string | null;
|
|
46
|
-
}
|
|
47
|
-
export type RelayOutgoingPart = {
|
|
48
|
-
type: "text";
|
|
49
|
-
text: string;
|
|
50
|
-
mentions?: RelayMentionRange[];
|
|
51
|
-
styles?: RelayStyleRange[];
|
|
52
|
-
} | {
|
|
53
|
-
type: "media";
|
|
54
|
-
attachment_id?: string;
|
|
55
|
-
url?: string;
|
|
56
|
-
width?: number;
|
|
57
|
-
height?: number;
|
|
58
|
-
blur_hash?: string;
|
|
59
|
-
} | {
|
|
60
|
-
type: "voice_memo";
|
|
61
|
-
attachment_id?: string;
|
|
62
|
-
url?: string;
|
|
63
|
-
duration_ms?: number;
|
|
64
|
-
} | {
|
|
65
|
-
type: "link_preview";
|
|
66
|
-
url: string;
|
|
67
|
-
} | {
|
|
68
|
-
type: "data";
|
|
69
|
-
data: Record<string, unknown>;
|
|
70
|
-
};
|
|
71
|
-
export interface PostMessageBody {
|
|
72
|
-
conversation_id: string;
|
|
73
|
-
parts: RelayOutgoingPart[];
|
|
74
|
-
reply_to?: {
|
|
75
|
-
message_id: string;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* Required in a group: Relay supplies this on the inbound invocation and
|
|
79
|
-
* consumes it when the reply commits.
|
|
80
|
-
*/
|
|
81
|
-
invocation_id?: string;
|
|
82
|
-
}
|
|
83
|
-
export declare class RelayClient {
|
|
84
|
-
private readonly token?;
|
|
85
|
-
private readonly fetchImpl;
|
|
86
|
-
readonly origin: string;
|
|
87
|
-
private readonly sdk;
|
|
88
|
-
constructor(origin: string, token?: string | undefined, fetchImpl?: typeof fetch);
|
|
89
|
-
/**
|
|
90
|
-
* Pairing, event reconciliation, and history inventory are not yet in the
|
|
91
|
-
* published SDK. Keep their transport narrow until generated SDK methods
|
|
92
|
-
* replace this compatibility path.
|
|
93
|
-
*/
|
|
94
|
-
private compatibilityRequest;
|
|
95
|
-
private authenticatedClient;
|
|
96
|
-
createPairing(deviceName: string, engine?: string): Promise<PairingCreated>;
|
|
97
|
-
waitPairing(pairingId: string, pollToken: string): Promise<PairingStatus>;
|
|
98
|
-
getMe(): Promise<Record<string, unknown>>;
|
|
99
|
-
getEvents(cursor: number, timeoutS?: number, limit?: number): Promise<EventsPage>;
|
|
100
|
-
reconcileEvents(expiredCursor: number): Promise<EventCursorReconciliation>;
|
|
101
|
-
postMessage(body: PostMessageBody, idempotencyKey: string): Promise<{
|
|
102
|
-
messages: RelayMessage[];
|
|
103
|
-
}>;
|
|
104
|
-
listConversations(limit?: number): Promise<{
|
|
105
|
-
conversations: RelayConversation[];
|
|
106
|
-
}>;
|
|
107
|
-
listMessages(conversationId: string, limit?: number): Promise<{
|
|
108
|
-
messages: RelayMessage[];
|
|
109
|
-
}>;
|
|
110
|
-
setTyping(conversationId: string, started: boolean, label?: string, invocationId?: string): Promise<void>;
|
|
111
|
-
setResponding(conversationId: string, messageId: string, label?: string, invocationId?: string): Promise<void>;
|
|
112
|
-
markRead(conversationId: string, messageId: string): Promise<void>;
|
|
113
|
-
}
|
|
114
|
-
//# sourceMappingURL=api.d.ts.map
|
package/dist/api.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAIL,qBAAqB,EACrB,aAAa,EAGd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,UAAU,EACV,iBAAiB,EACjB,YAAY,EACZ,eAAe,EAChB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,eAAO,MAAM,iBAAiB,4BAAyB,CAAC;AACxD,eAAO,MAAM,kBAAkB,8BAAwB,CAAC;AAExD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,GAAE,MAA0B,GAAG,MAAM,CAG7E;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB;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AE,CAAC,CAQvC;IAED,iBAAiB,CAAC,KAAK,SAAK,GAAG,OAAO,CAAC;QAAE,aAAa,EAAE,iBAAiB,EAAE,CAAA;KAAE,CAAC,CAK7E;IAED,YAAY,CACV,cAAc,EAAE,MAAM,EACtB,KAAK,SAAK,GACT,OAAO,CAAC;QAAE,QAAQ,EAAE,YAAY,EAAE,CAAA;KAAE,CAAC,CAKvC;IAED,SAAS,CACP,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,OAAO,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAOf;IAED,aAAa,CACX,cAAc,EAAE,MAAM,EACtB,SAAS,EAAE,MAAM,EACjB,KAAK,CAAC,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAOf;IAED,QAAQ,CAAC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;CACF"}
|
package/dist/api.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Compatibility facade over the canonical @relaymessenger/sdk client.
|
|
3
|
-
*
|
|
4
|
-
* The running bridge uses the SDK for identity, polling, messages, typing,
|
|
5
|
-
* responding, and read receipts. This facade keeps the CLI's established
|
|
6
|
-
* positional signatures and implements only pairing and cursor-recovery
|
|
7
|
-
* endpoints that the current published SDK does not expose.
|
|
8
|
-
*/
|
|
9
|
-
import { classifyRelayHttpStatus, createRelayClient, DEFAULT_RELAY_BASE_URL, normalizeRelayBaseUrl, RelayApiError, } from "@relaymessenger/sdk";
|
|
10
|
-
export { RelayApiError };
|
|
11
|
-
export const PRODUCTION_ORIGIN = DEFAULT_RELAY_BASE_URL;
|
|
12
|
-
export const normalizeApiOrigin = normalizeRelayBaseUrl;
|
|
13
|
-
/**
|
|
14
|
-
* Development/testing override for the Relay API origin. Production stays the
|
|
15
|
-
* default. The SDK owns all URL validation.
|
|
16
|
-
*/
|
|
17
|
-
export function resolveApiOrigin(fallback = PRODUCTION_ORIGIN) {
|
|
18
|
-
const override = process.env.RELAY_API_ORIGIN?.trim();
|
|
19
|
-
return normalizeRelayBaseUrl(override || fallback);
|
|
20
|
-
}
|
|
21
|
-
export class RelayClient {
|
|
22
|
-
token;
|
|
23
|
-
fetchImpl;
|
|
24
|
-
origin;
|
|
25
|
-
sdk;
|
|
26
|
-
constructor(origin, token, fetchImpl = fetch) {
|
|
27
|
-
this.token = token;
|
|
28
|
-
this.fetchImpl = fetchImpl;
|
|
29
|
-
this.origin = normalizeRelayBaseUrl(origin);
|
|
30
|
-
this.sdk = token
|
|
31
|
-
? createRelayClient({
|
|
32
|
-
baseUrl: this.origin,
|
|
33
|
-
token,
|
|
34
|
-
fetchImpl,
|
|
35
|
-
requestTimeoutMs: 30_000,
|
|
36
|
-
})
|
|
37
|
-
: undefined;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Pairing, event reconciliation, and history inventory are not yet in the
|
|
41
|
-
* published SDK. Keep their transport narrow until generated SDK methods
|
|
42
|
-
* replace this compatibility path.
|
|
43
|
-
*/
|
|
44
|
-
async compatibilityRequest(method, path, options = {}) {
|
|
45
|
-
const headers = { ...options.headers };
|
|
46
|
-
const bearer = options.bearer ?? this.token;
|
|
47
|
-
if (bearer)
|
|
48
|
-
headers.authorization = `Bearer ${bearer}`;
|
|
49
|
-
let body;
|
|
50
|
-
if (options.body !== undefined) {
|
|
51
|
-
headers["content-type"] = "application/json";
|
|
52
|
-
body = JSON.stringify(options.body);
|
|
53
|
-
}
|
|
54
|
-
const response = await this.fetchImpl(`${this.origin}${path}`, {
|
|
55
|
-
method,
|
|
56
|
-
headers,
|
|
57
|
-
body,
|
|
58
|
-
signal: AbortSignal.timeout(options.timeoutMs ?? 30_000),
|
|
59
|
-
});
|
|
60
|
-
const text = await response.text();
|
|
61
|
-
let json;
|
|
62
|
-
try {
|
|
63
|
-
json = text ? JSON.parse(text) : undefined;
|
|
64
|
-
}
|
|
65
|
-
catch {
|
|
66
|
-
json = undefined;
|
|
67
|
-
}
|
|
68
|
-
if (!response.ok) {
|
|
69
|
-
const envelope = json;
|
|
70
|
-
const code = envelope?.error?.code ?? envelope?.code;
|
|
71
|
-
const message = envelope?.error?.message ??
|
|
72
|
-
envelope?.message ??
|
|
73
|
-
text.slice(0, 300) ??
|
|
74
|
-
response.statusText;
|
|
75
|
-
const details = envelope?.error?.details;
|
|
76
|
-
throw new RelayApiError(`${method} ${path} → ${response.status}: ${message}`, {
|
|
77
|
-
status: response.status,
|
|
78
|
-
kind: classifyRelayHttpStatus(response.status),
|
|
79
|
-
...(code ? { code } : {}),
|
|
80
|
-
...(details ? { details } : {}),
|
|
81
|
-
});
|
|
82
|
-
}
|
|
83
|
-
return json;
|
|
84
|
-
}
|
|
85
|
-
authenticatedClient() {
|
|
86
|
-
if (!this.sdk) {
|
|
87
|
-
throw new Error("relay: Agent Token is required");
|
|
88
|
-
}
|
|
89
|
-
return this.sdk;
|
|
90
|
-
}
|
|
91
|
-
createPairing(deviceName, engine) {
|
|
92
|
-
return this.compatibilityRequest("POST", "/v1/pairings", {
|
|
93
|
-
body: {
|
|
94
|
-
device_name: deviceName,
|
|
95
|
-
...(engine ? { engine } : {}),
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
waitPairing(pairingId, pollToken) {
|
|
100
|
-
return this.compatibilityRequest("GET", `/v1/pairings/${encodeURIComponent(pairingId)}?wait=true`, { bearer: pollToken, timeoutMs: 45_000 });
|
|
101
|
-
}
|
|
102
|
-
async getMe() {
|
|
103
|
-
return { agent: await this.authenticatedClient().getMe() };
|
|
104
|
-
}
|
|
105
|
-
async getEvents(cursor, timeoutS = 25, limit = 100) {
|
|
106
|
-
const page = await this.authenticatedClient().pollEvents({
|
|
107
|
-
cursor,
|
|
108
|
-
timeoutSeconds: timeoutS,
|
|
109
|
-
limit,
|
|
110
|
-
});
|
|
111
|
-
return {
|
|
112
|
-
events: page.events,
|
|
113
|
-
next_cursor: page.nextCursor,
|
|
114
|
-
};
|
|
115
|
-
}
|
|
116
|
-
reconcileEvents(expiredCursor) {
|
|
117
|
-
return this.compatibilityRequest("POST", "/v1/events/reconcile", {
|
|
118
|
-
body: {
|
|
119
|
-
expired_cursor: expiredCursor,
|
|
120
|
-
history_reconciled: true,
|
|
121
|
-
},
|
|
122
|
-
headers: {
|
|
123
|
-
"idempotency-key": `event-cursor-reconcile:${expiredCursor}`,
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
postMessage(body, idempotencyKey) {
|
|
128
|
-
return this.authenticatedClient().sendMessage({
|
|
129
|
-
conversationId: body.conversation_id,
|
|
130
|
-
parts: body.parts,
|
|
131
|
-
idempotencyKey,
|
|
132
|
-
...(body.reply_to ? { replyTo: body.reply_to } : {}),
|
|
133
|
-
...(body.invocation_id ? { invocationId: body.invocation_id } : {}),
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
listConversations(limit = 50) {
|
|
137
|
-
return this.compatibilityRequest("GET", `/v1/conversations?limit=${encodeURIComponent(limit)}`);
|
|
138
|
-
}
|
|
139
|
-
listMessages(conversationId, limit = 20) {
|
|
140
|
-
return this.compatibilityRequest("GET", `/v1/conversations/${encodeURIComponent(conversationId)}/messages?limit=${encodeURIComponent(limit)}`);
|
|
141
|
-
}
|
|
142
|
-
setTyping(conversationId, started, label, invocationId) {
|
|
143
|
-
return this.authenticatedClient().setTyping({
|
|
144
|
-
conversationId,
|
|
145
|
-
started,
|
|
146
|
-
...(label ? { label } : {}),
|
|
147
|
-
...(invocationId ? { invocationId } : {}),
|
|
148
|
-
});
|
|
149
|
-
}
|
|
150
|
-
setResponding(conversationId, messageId, label, invocationId) {
|
|
151
|
-
return this.authenticatedClient().setResponding({
|
|
152
|
-
conversationId,
|
|
153
|
-
messageId,
|
|
154
|
-
...(label ? { label } : {}),
|
|
155
|
-
...(invocationId ? { invocationId } : {}),
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
markRead(conversationId, messageId) {
|
|
159
|
-
return this.authenticatedClient().markRead({ conversationId, messageId });
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
//# sourceMappingURL=api.js.map
|
package/dist/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,GAGd,MAAM,qBAAqB,CAAC;AAQ7B,OAAO,EAAE,aAAa,EAAE,CAAC;AAEzB,MAAM,CAAC,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACxD,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC;AAExD;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAQ,GAAW,iBAAiB;IACnE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,IAAI,EAAE,CAAC;IACtD,OAAO,qBAAqB,CAAC,QAAQ,IAAI,QAAQ,CAAC,CAAC;AACrD,CAAC;AAsED,MAAM,OAAO,WAAW;IAMH,KAAK;IACL,SAAS;IANnB,MAAM,CAAS;IACP,GAAG,CAA6B;IAEjD,YACE,MAAc,EACG,KAAc,EACd,SAAS,GAAiB,KAAK;qBAD/B,KAAK;yBACL,SAAS;QAE1B,IAAI,CAAC,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;QAC5C,IAAI,CAAC,GAAG,GAAG,KAAK;YACd,CAAC,CAAC,iBAAiB,CAAC;gBAChB,OAAO,EAAE,IAAI,CAAC,MAAM;gBACpB,KAAK;gBACL,SAAS;gBACT,gBAAgB,EAAE,MAAM;aACzB,CAAC;YACJ,CAAC,CAAC,SAAS,CAAC;IAChB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C5E,CAAC;CACF"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export interface ResolvedDefaultMode {
|
|
2
|
-
mode: string;
|
|
3
|
-
/** Settings file the winning value came from. */
|
|
4
|
-
source: string;
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Resolve permissions.defaultMode the way Claude Code does, highest
|
|
8
|
-
* precedence first: project .claude/settings.local.json, then project
|
|
9
|
-
* .claude/settings.json, then user ~/.claude/settings.json.
|
|
10
|
-
*/
|
|
11
|
-
export declare function resolveClaudeDefaultMode(projectDir?: string, home?: string): ResolvedDefaultMode | undefined;
|
|
12
|
-
/** One-line warning when phone approvals cannot fire, else undefined. */
|
|
13
|
-
export declare function claudeBypassWarning(projectDir?: string, home?: string): string | undefined;
|
|
14
|
-
//# sourceMappingURL=claude-settings.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"claude-settings.d.ts","sourceRoot":"","sources":["../src/claude-settings.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAYD;;;;GAIG;AACH,wBAAgB,wBAAwB,CACtC,UAAU,GAAE,MAAsB,EAClC,IAAI,GAAE,MAAkB,GACvB,mBAAmB,GAAG,SAAS,CAWjC;AAED,yEAAyE;AACzE,wBAAgB,mBAAmB,CACjC,UAAU,CAAC,EAAE,MAAM,EACnB,IAAI,CAAC,EAAE,MAAM,GACZ,MAAM,GAAG,SAAS,CAOpB"}
|
package/dist/claude-settings.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Best-effort read of the Claude Code permission mode that
|
|
3
|
-
* @agentclientprotocol/claude-agent-acp inherits. When the resolved
|
|
4
|
-
* permissions.defaultMode is bypassPermissions, the engine never sends
|
|
5
|
-
* session/request_permission, so Relay's phone Allow/Deny cards silently
|
|
6
|
-
* disappear. Missing or unreadable settings files are ignored (silent).
|
|
7
|
-
*/
|
|
8
|
-
import { readFileSync } from "node:fs";
|
|
9
|
-
import { homedir } from "node:os";
|
|
10
|
-
import { join } from "node:path";
|
|
11
|
-
function readDefaultMode(path) {
|
|
12
|
-
try {
|
|
13
|
-
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
14
|
-
const mode = parsed?.permissions?.defaultMode;
|
|
15
|
-
return typeof mode === "string" ? mode : undefined;
|
|
16
|
-
}
|
|
17
|
-
catch {
|
|
18
|
-
return undefined;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Resolve permissions.defaultMode the way Claude Code does, highest
|
|
23
|
-
* precedence first: project .claude/settings.local.json, then project
|
|
24
|
-
* .claude/settings.json, then user ~/.claude/settings.json.
|
|
25
|
-
*/
|
|
26
|
-
export function resolveClaudeDefaultMode(projectDir = process.cwd(), home = homedir()) {
|
|
27
|
-
const candidates = [
|
|
28
|
-
join(projectDir, ".claude", "settings.local.json"),
|
|
29
|
-
join(projectDir, ".claude", "settings.json"),
|
|
30
|
-
join(home, ".claude", "settings.json"),
|
|
31
|
-
];
|
|
32
|
-
for (const path of candidates) {
|
|
33
|
-
const mode = readDefaultMode(path);
|
|
34
|
-
if (mode !== undefined)
|
|
35
|
-
return { mode, source: path };
|
|
36
|
-
}
|
|
37
|
-
return undefined;
|
|
38
|
-
}
|
|
39
|
-
/** One-line warning when phone approvals cannot fire, else undefined. */
|
|
40
|
-
export function claudeBypassWarning(projectDir, home) {
|
|
41
|
-
const resolved = resolveClaudeDefaultMode(projectDir, home);
|
|
42
|
-
if (resolved?.mode !== "bypassPermissions")
|
|
43
|
-
return undefined;
|
|
44
|
-
return (`Claude permissions.defaultMode=bypassPermissions (${resolved.source}). ` +
|
|
45
|
-
"the engine never asks for approval, so Relay's phone Allow/Deny cards will not appear");
|
|
46
|
-
}
|
|
47
|
-
//# sourceMappingURL=claude-settings.js.map
|
|
@@ -1 +0,0 @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Aa;IAEb,MAAM,QAAQ,GAAG,wBAAwB,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5D,IAAI,QAAQ,EAAE,IAAI,KAAK,mBAAmB;QAAE,OAAO,SAAS,CAAC;IAC7D,OAAO,CACL,qDAAqD,QAAQ,CAAC,MAAM,KAAK;QACzE,uFAAuF,CACxF,CAAC;AACJ,CAAC"}
|
package/dist/codex.d.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { RelayClient } from "./api.js";
|
|
2
|
-
import { CodexNotifyPolicyStore, ConfigStore } from "./store.js";
|
|
3
|
-
export declare function requireClient(config?: ConfigStore): {
|
|
4
|
-
client: RelayClient;
|
|
5
|
-
ownerUserId?: string;
|
|
6
|
-
conversationId?: string;
|
|
7
|
-
projectRoot: string;
|
|
8
|
-
runtimeHome: string;
|
|
9
|
-
apiOrigin: string;
|
|
10
|
-
accountIdentity: string;
|
|
11
|
-
};
|
|
12
|
-
export interface NotifyCommandDependencies {
|
|
13
|
-
config?: ConfigStore;
|
|
14
|
-
policy?: CodexNotifyPolicyStore;
|
|
15
|
-
client?: RelayClient;
|
|
16
|
-
}
|
|
17
|
-
export declare function notifyCommand(argv: string[], out?: (line: string) => void, dependencies?: NotifyCommandDependencies): Promise<void>;
|
|
18
|
-
export declare function permissionRequestHook(write?: (json: unknown) => void): Promise<number>;
|
|
19
|
-
/**
|
|
20
|
-
* Exact PermissionRequest hook envelope from the Codex hooks reference:
|
|
21
|
-
* hookSpecificOutput.hookEventName is required — without it Codex treats the
|
|
22
|
-
* output as invalid and the phone decision is dropped.
|
|
23
|
-
*/
|
|
24
|
-
export declare function decisionJson(allow: boolean): unknown;
|
|
25
|
-
//# sourceMappingURL=codex.d.ts.map
|
package/dist/codex.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"AAyBA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAEvC,OAAO,EAEL,sBAAsB,EACtB,WAAW,EAMZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,aAAa,CAAC,MAAM,cAAoB,GAAG;IACzD,MAAM,EAAE,WAAW,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;CACzB,CA4BA;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,wBAAsB,aAAa,CACjC,IAAI,EAAE,MAAM,EAAE,EACd,GAAG,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAkB,EACzC,YAAY,GAAE,yBAA8B,GAC3C,OAAO,CAAC,IAAI,CAAC,CA0Cf;AAUD,wBAAsB,qBAAqB,CACzC,KAAK,GAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAkE,GAC3F,OAAO,CAAC,MAAM,CAAC,CA2HjB;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASpD"}
|
package/dist/codex.js
DELETED
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Codex-side entrypoints installed by `relaymessenger install-codex`:
|
|
3
|
-
*
|
|
4
|
-
* `relaymessenger notify` — Codex appends its notification JSON as the final argv
|
|
5
|
-
* arg (kebab-case): {"type":"agent-turn-complete","thread-id":…,"turn-id":…,
|
|
6
|
-
* "cwd":…,"input-messages":[…],"last-assistant-message":…}. That is the only
|
|
7
|
-
* notify event Codex emits; approvals come through the PermissionRequest hook.
|
|
8
|
-
*
|
|
9
|
-
* `relaymessenger hook permission-request` — Codex's hooks engine pipes
|
|
10
|
-
* {session_id, turn_id, cwd, tool_name, tool_input, permission_mode} on stdin
|
|
11
|
-
* and accepts a decision on stdout (developers.openai.com/codex/hooks):
|
|
12
|
-
* exit 0 + {"hookSpecificOutput":{"hookEventName":"PermissionRequest",
|
|
13
|
-
* "decision":{"behavior":"allow"|"deny"}}}
|
|
14
|
-
* exit 0 + no decision → fall through to Codex's normal approval flow
|
|
15
|
-
* The hook posts an Allow/Deny card to Relay and blocks on the phone tap
|
|
16
|
-
* (watching its per-request approval file — which a running `relaymessenger start`
|
|
17
|
-
* loop resolves — and polling the conversation directly). Timeout → deny.
|
|
18
|
-
*
|
|
19
|
-
* These entrypoints run in their own processes and never write state.json;
|
|
20
|
-
* that file is owned exclusively by the `start` loop. They read the pinned
|
|
21
|
-
* owner conversation via readStateSnapshot() and coordinate approvals only
|
|
22
|
-
* through per-request files in the active account runtime's approvals/.
|
|
23
|
-
*/
|
|
24
|
-
import { randomBytes } from "node:crypto";
|
|
25
|
-
import { basename, dirname } from "node:path";
|
|
26
|
-
import { RelayClient } from "./api.js";
|
|
27
|
-
import { buildPermissionCard, newRequestId, verdictFromMessage } from "./permissions.js";
|
|
28
|
-
import { ApprovalStore, CodexNotifyPolicyStore, ConfigStore, readStateSnapshot, resolveOwnerUserId, runtimeHomeForConfig, relayIdentityForConfig, } from "./store.js";
|
|
29
|
-
export function requireClient(config = new ConfigStore()) {
|
|
30
|
-
const projectRoot = new CodexNotifyPolicyStore().matchProject(process.cwd());
|
|
31
|
-
if (!projectRoot) {
|
|
32
|
-
throw new Error("This project is not opted in to Relay. Run `relaymessenger install-codex` from its root first.");
|
|
33
|
-
}
|
|
34
|
-
const loaded = config.load();
|
|
35
|
-
if (!loaded?.agent_token) {
|
|
36
|
-
throw new Error("Not paired. Run `relaymessenger pair` first.");
|
|
37
|
-
}
|
|
38
|
-
let ownerUserId;
|
|
39
|
-
try {
|
|
40
|
-
ownerUserId = resolveOwnerUserId(loaded);
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
ownerUserId = undefined;
|
|
44
|
-
}
|
|
45
|
-
return {
|
|
46
|
-
client: new RelayClient(loaded.api_origin, loaded.agent_token),
|
|
47
|
-
ownerUserId,
|
|
48
|
-
// The owner's conversation, pinned by the loop at the first owner
|
|
49
|
-
// message — never the most recent writer.
|
|
50
|
-
conversationId: readStateSnapshot(runtimeHomeForConfig(loaded, dirname(config.path))).owner_conversation_id,
|
|
51
|
-
projectRoot,
|
|
52
|
-
runtimeHome: runtimeHomeForConfig(loaded, dirname(config.path)),
|
|
53
|
-
apiOrigin: loaded.api_origin,
|
|
54
|
-
accountIdentity: relayIdentityForConfig(loaded),
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
export async function notifyCommand(argv, out = console.log, dependencies = {}) {
|
|
58
|
-
const raw = argv[argv.length - 1];
|
|
59
|
-
let payload = {};
|
|
60
|
-
try {
|
|
61
|
-
payload = raw ? JSON.parse(raw) : {};
|
|
62
|
-
}
|
|
63
|
-
catch {
|
|
64
|
-
// Not JSON — treat as free text.
|
|
65
|
-
payload = { "last-assistant-message": raw };
|
|
66
|
-
}
|
|
67
|
-
if (payload.type && payload.type !== "agent-turn-complete")
|
|
68
|
-
return;
|
|
69
|
-
const projectRoot = (dependencies.policy ?? new CodexNotifyPolicyStore()).matchProject(payload.cwd);
|
|
70
|
-
if (!projectRoot) {
|
|
71
|
-
out("relaymessenger notify: suppressed; this project was not explicitly opted in.");
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
const config = dependencies.config ?? new ConfigStore();
|
|
75
|
-
const loaded = config.load();
|
|
76
|
-
if (!loaded?.agent_token)
|
|
77
|
-
throw new Error("Not paired. Run `relaymessenger pair` first.");
|
|
78
|
-
const conversationId = readStateSnapshot(runtimeHomeForConfig(loaded, dirname(config.path))).owner_conversation_id;
|
|
79
|
-
const client = dependencies.client ?? new RelayClient(loaded.api_origin, loaded.agent_token);
|
|
80
|
-
if (!conversationId) {
|
|
81
|
-
out("relaymessenger notify: no pinned owner conversation yet; run `relaymessenger start` once and " +
|
|
82
|
-
"message the agent from the Relay app first.");
|
|
83
|
-
return;
|
|
84
|
-
}
|
|
85
|
-
const last = payload["last-assistant-message"];
|
|
86
|
-
const summary = typeof last === "string" && last.trim().length > 0
|
|
87
|
-
? last.trim()
|
|
88
|
-
: "Codex finished a turn.";
|
|
89
|
-
const turnId = payload["turn-id"] ?? randomBytes(6).toString("hex");
|
|
90
|
-
await client.postMessage({
|
|
91
|
-
conversation_id: conversationId,
|
|
92
|
-
parts: [{ type: "text", text: `Codex (${basename(projectRoot)}): ${summary}`.slice(0, 7900) }],
|
|
93
|
-
}, `relay-notify-${turnId}`);
|
|
94
|
-
}
|
|
95
|
-
async function readStdin() {
|
|
96
|
-
const chunks = [];
|
|
97
|
-
for await (const chunk of process.stdin)
|
|
98
|
-
chunks.push(chunk);
|
|
99
|
-
return Buffer.concat(chunks).toString("utf8");
|
|
100
|
-
}
|
|
101
|
-
const HOOK_TIMEOUT_MS = 9 * 60 * 1000; // under Codex's 600 s handler default
|
|
102
|
-
export async function permissionRequestHook(write = (json) => process.stdout.write(`${JSON.stringify(json)}\n`)) {
|
|
103
|
-
let input = {};
|
|
104
|
-
try {
|
|
105
|
-
input = JSON.parse(await readStdin());
|
|
106
|
-
}
|
|
107
|
-
catch {
|
|
108
|
-
return 0; // Unparseable input → no decision, Codex falls back to local approval.
|
|
109
|
-
}
|
|
110
|
-
const config = new ConfigStore().load();
|
|
111
|
-
const projectRoot = new CodexNotifyPolicyStore().matchProject(input.cwd);
|
|
112
|
-
if (!projectRoot)
|
|
113
|
-
return 0;
|
|
114
|
-
const conversationId = config?.agent_token
|
|
115
|
-
? readStateSnapshot(runtimeHomeForConfig(config)).owner_conversation_id
|
|
116
|
-
: undefined;
|
|
117
|
-
let ownerUserId;
|
|
118
|
-
try {
|
|
119
|
-
ownerUserId = config ? resolveOwnerUserId(config) : undefined;
|
|
120
|
-
}
|
|
121
|
-
catch {
|
|
122
|
-
ownerUserId = undefined;
|
|
123
|
-
}
|
|
124
|
-
if (!config?.agent_token || !conversationId || !ownerUserId) {
|
|
125
|
-
// Not paired / no pinned owner or conversation → we cannot verify who
|
|
126
|
-
// would answer, so fall through to Codex's local approval flow.
|
|
127
|
-
return 0;
|
|
128
|
-
}
|
|
129
|
-
const client = new RelayClient(config.api_origin, config.agent_token);
|
|
130
|
-
const approvals = new ApprovalStore();
|
|
131
|
-
const requestId = newRequestId();
|
|
132
|
-
const approval = {
|
|
133
|
-
request_id: requestId,
|
|
134
|
-
conversation_id: conversationId,
|
|
135
|
-
engine: "codex",
|
|
136
|
-
tool_name: input.tool_name,
|
|
137
|
-
created_at: new Date().toISOString(),
|
|
138
|
-
deadline_at: new Date(Date.now() + HOOK_TIMEOUT_MS).toISOString(),
|
|
139
|
-
options: [
|
|
140
|
-
{ option_id: "allow", label: "Allow", kind: "allow_once" },
|
|
141
|
-
{ option_id: "deny", label: "Deny", kind: "reject_once" },
|
|
142
|
-
],
|
|
143
|
-
source: "hook",
|
|
144
|
-
};
|
|
145
|
-
let card;
|
|
146
|
-
try {
|
|
147
|
-
card = buildPermissionCard({
|
|
148
|
-
requestId,
|
|
149
|
-
conversationId,
|
|
150
|
-
engineLabel: "Codex",
|
|
151
|
-
toolName: input.tool_name,
|
|
152
|
-
inputPreview: input.tool_input !== undefined ? JSON.stringify(input.tool_input) : undefined,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
catch (error) {
|
|
156
|
-
process.stderr.write(`relaymessenger: refusing concealed approval input (${error}); denying.\n`);
|
|
157
|
-
write(decisionJson(false));
|
|
158
|
-
return 0;
|
|
159
|
-
}
|
|
160
|
-
// Durable (create-once) before the card goes out. A running `relaymessenger
|
|
161
|
-
// start` loop sees the tap on the event stream and writes the resolution
|
|
162
|
-
// into this file; this process is the waiter that consumes it.
|
|
163
|
-
approvals.create(approval);
|
|
164
|
-
let posted;
|
|
165
|
-
try {
|
|
166
|
-
posted = await client.postMessage(card.body, card.idempotencyKey);
|
|
167
|
-
}
|
|
168
|
-
catch (error) {
|
|
169
|
-
approvals.consume(requestId);
|
|
170
|
-
process.stderr.write(`relaymessenger: approval card could not be delivered (${error}); denying.\n`);
|
|
171
|
-
write(decisionJson(false));
|
|
172
|
-
return 0;
|
|
173
|
-
}
|
|
174
|
-
// The card's text and data parts land as separate messages; a verdict must
|
|
175
|
-
// come after every one of them, so the watermark is the last sequence. A 202
|
|
176
|
-
// with no messages leaves no watermark to gate the verdict scan on, and a
|
|
177
|
-
// zero default would accept any earlier matching message, so refuse instead.
|
|
178
|
-
const cardSequence = posted.messages.at(-1)?.sequence;
|
|
179
|
-
if (cardSequence === undefined) {
|
|
180
|
-
approvals.consume(requestId);
|
|
181
|
-
process.stderr.write("relaymessenger: approval card send returned no committed messages; denying.\n");
|
|
182
|
-
write(decisionJson(false));
|
|
183
|
-
return 0;
|
|
184
|
-
}
|
|
185
|
-
const finish = (allow) => {
|
|
186
|
-
approvals.consume(requestId);
|
|
187
|
-
write(decisionJson(allow));
|
|
188
|
-
return 0;
|
|
189
|
-
};
|
|
190
|
-
const deadline = Date.now() + HOOK_TIMEOUT_MS;
|
|
191
|
-
while (Date.now() < deadline) {
|
|
192
|
-
await new Promise((resolve) => setTimeout(resolve, 2500));
|
|
193
|
-
// Path 1: a running start loop resolved our approval file.
|
|
194
|
-
const shared = approvals.get(requestId);
|
|
195
|
-
if (shared?.resolution)
|
|
196
|
-
return finish(shared.resolution.behavior === "allow");
|
|
197
|
-
if (!shared) {
|
|
198
|
-
// Aged out from under us — treat as deny.
|
|
199
|
-
break;
|
|
200
|
-
}
|
|
201
|
-
// Path 2: poll the conversation directly (works without `relaymessenger start`).
|
|
202
|
-
try {
|
|
203
|
-
const { messages } = await client.listMessages(conversationId, 10);
|
|
204
|
-
const verdict = messages
|
|
205
|
-
.filter((message) => message.sender.kind === "user" &&
|
|
206
|
-
message.sender.id === ownerUserId &&
|
|
207
|
-
message.conversation_id === conversationId &&
|
|
208
|
-
message.sequence > cardSequence)
|
|
209
|
-
.sort((a, b) => a.sequence - b.sequence)
|
|
210
|
-
.map((message) => verdictFromMessage(message))
|
|
211
|
-
.find((candidate) => candidate?.request_id === requestId);
|
|
212
|
-
if (verdict)
|
|
213
|
-
return finish(verdict.behavior === "allow");
|
|
214
|
-
}
|
|
215
|
-
catch {
|
|
216
|
-
// transient — keep polling until deadline
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
process.stderr.write("relaymessenger: no approval from Relay within the window; denying.\n");
|
|
220
|
-
return finish(false);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Exact PermissionRequest hook envelope from the Codex hooks reference:
|
|
224
|
-
* hookSpecificOutput.hookEventName is required — without it Codex treats the
|
|
225
|
-
* output as invalid and the phone decision is dropped.
|
|
226
|
-
*/
|
|
227
|
-
export function decisionJson(allow) {
|
|
228
|
-
return {
|
|
229
|
-
hookSpecificOutput: {
|
|
230
|
-
hookEventName: "PermissionRequest",
|
|
231
|
-
decision: allow
|
|
232
|
-
? { behavior: "allow" }
|
|
233
|
-
: { behavior: "deny", message: "Denied from the Relay app." },
|
|
234
|
-
},
|
|
235
|
-
};
|
|
236
|
-
}
|
|
237
|
-
//# sourceMappingURL=codex.js.map
|
package/dist/codex.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"codex.js","sourceRoot":"","sources":["../src/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACzF,OAAO,EACL,aAAa,EACb,sBAAsB,EACtB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