alink-cli 0.7.4 → 0.8.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 +21 -3
- package/bin/agentlink-account.js +72 -40
- package/bin/agentlink-prompts.js +55 -0
- package/bin/agentlink.js +151 -85
- package/bin/migrate-legacy-machines.js +290 -0
- package/dist/bin.mjs +24 -49
- package/dist/bin.mjs.map +1 -1
- package/dist/ui.js +49044 -0
- package/package.json +7 -3
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
// CloudBase's Node adapter resolves optional dependencies through a runtime
|
|
4
|
+
// `require`; expose this package's resolver so its bundled `ws` dependency is found.
|
|
5
|
+
globalThis.require ??= createRequire(import.meta.url);
|
|
6
|
+
|
|
7
|
+
import { loadAgentLinkAccountConfig } from "./agentlink-account.js";
|
|
8
|
+
import { accountCredentials } from "./agentlink-prompts.js";
|
|
9
|
+
|
|
10
|
+
export const MACHINE_ID_PATTERN = /^[A-Za-z0-9_-]+$/;
|
|
11
|
+
export const ENCKEY_PATTERN = /^[A-Za-z0-9_-]{43}$/;
|
|
12
|
+
|
|
13
|
+
export function isValidMachineId(value) {
|
|
14
|
+
return typeof value === "string" && value.length > 0 && MACHINE_ID_PATTERN.test(value);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function isValidEnckey(value) {
|
|
18
|
+
return typeof value === "string" && ENCKEY_PATTERN.test(value);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function timestamp(value) {
|
|
22
|
+
const parsed = typeof value === "number" ? value : Number(value);
|
|
23
|
+
return Number.isFinite(parsed) && parsed > 0 ? Math.trunc(parsed) : undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function isValidCanonicalRow(row) {
|
|
27
|
+
return (
|
|
28
|
+
row &&
|
|
29
|
+
typeof row === "object" &&
|
|
30
|
+
isValidMachineId(row.machine_id) &&
|
|
31
|
+
isValidEnckey(row.enckey) &&
|
|
32
|
+
timestamp(row.created_at) !== undefined
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export function validateLegacyMachineRecord(value, index) {
|
|
37
|
+
const record = value && typeof value === "object" ? value : {};
|
|
38
|
+
const machineId = typeof record.machineId === "string" ? record.machineId : "";
|
|
39
|
+
const enckey = typeof record.enckey === "string" ? record.enckey : "";
|
|
40
|
+
const createdAt = timestamp(record.createdAt);
|
|
41
|
+
const errors = [];
|
|
42
|
+
|
|
43
|
+
if (!machineId) errors.push("missing machineId");
|
|
44
|
+
else if (!isValidMachineId(machineId)) errors.push("invalid machineId");
|
|
45
|
+
|
|
46
|
+
if (!enckey) errors.push("missing enckey");
|
|
47
|
+
else if (!isValidEnckey(enckey)) errors.push("invalid enckey");
|
|
48
|
+
|
|
49
|
+
if (createdAt === undefined) errors.push("invalid createdAt");
|
|
50
|
+
|
|
51
|
+
if (record.name !== undefined && typeof record.name !== "string") errors.push("invalid name");
|
|
52
|
+
if (record.hostname !== undefined && typeof record.hostname !== "string")
|
|
53
|
+
errors.push("invalid hostname");
|
|
54
|
+
|
|
55
|
+
if (errors.length > 0) {
|
|
56
|
+
return { ok: false, index, machineId: machineId || "(unknown)", errors };
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const normalized = {
|
|
60
|
+
machineId,
|
|
61
|
+
enckey,
|
|
62
|
+
createdAt,
|
|
63
|
+
...(typeof record.name === "string" && record.name ? { name: record.name } : {}),
|
|
64
|
+
...(typeof record.hostname === "string" && record.hostname ? { hostname: record.hostname } : {}),
|
|
65
|
+
...(timestamp(record.connectedAt) !== undefined
|
|
66
|
+
? { connectedAt: timestamp(record.connectedAt) }
|
|
67
|
+
: {}),
|
|
68
|
+
};
|
|
69
|
+
return { ok: true, index, record: normalized };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function dedupeLegacyRecords(records) {
|
|
73
|
+
const byId = new Map();
|
|
74
|
+
for (const record of records) {
|
|
75
|
+
const existing = byId.get(record.machineId);
|
|
76
|
+
if (!existing || record.createdAt > existing.createdAt) byId.set(record.machineId, record);
|
|
77
|
+
}
|
|
78
|
+
return Array.from(byId.values()).sort((a, b) => a.machineId.localeCompare(b.machineId));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function planLegacyMachineMigration({ legacyRecords, existingRows }) {
|
|
82
|
+
const validationResults = (legacyRecords || []).map(validateLegacyMachineRecord);
|
|
83
|
+
const valid = validationResults.filter((r) => r.ok).map((r) => r.record);
|
|
84
|
+
const invalid = validationResults.filter((r) => !r.ok);
|
|
85
|
+
const deduped = dedupeLegacyRecords(valid);
|
|
86
|
+
|
|
87
|
+
const existingById = new Map((existingRows || []).map((r) => [r.machine_id, r]));
|
|
88
|
+
const toMigrate = [];
|
|
89
|
+
const skipped = [];
|
|
90
|
+
|
|
91
|
+
for (const record of deduped) {
|
|
92
|
+
const existing = existingById.get(record.machineId);
|
|
93
|
+
if (existing && isValidCanonicalRow(existing)) {
|
|
94
|
+
skipped.push({ machineId: record.machineId, reason: "existing canonical row" });
|
|
95
|
+
} else {
|
|
96
|
+
toMigrate.push(record);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
toMigrate,
|
|
102
|
+
skipped,
|
|
103
|
+
invalid,
|
|
104
|
+
counts: {
|
|
105
|
+
legacy: legacyRecords?.length ?? 0,
|
|
106
|
+
valid: valid.length,
|
|
107
|
+
invalid: invalid.length,
|
|
108
|
+
duplicates: valid.length - deduped.length,
|
|
109
|
+
skipped: skipped.length,
|
|
110
|
+
toMigrate: toMigrate.length,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export async function runLegacyMachineMigration({
|
|
116
|
+
legacyRecords,
|
|
117
|
+
existingRows,
|
|
118
|
+
upsert,
|
|
119
|
+
apply,
|
|
120
|
+
}) {
|
|
121
|
+
const plan = planLegacyMachineMigration({ legacyRecords, existingRows });
|
|
122
|
+
const migrated = [];
|
|
123
|
+
|
|
124
|
+
if (apply) {
|
|
125
|
+
const now = Date.now();
|
|
126
|
+
for (const record of plan.toMigrate) {
|
|
127
|
+
await upsert({ ...record, updatedAt: now });
|
|
128
|
+
migrated.push(record.machineId);
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return { ...plan, migrated };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function formatMigrationReport({ ownerId, apply, counts, invalid, skipped, migrated }) {
|
|
136
|
+
const lines = [
|
|
137
|
+
`[migrate-legacy-machines] owner=${ownerId} mode=${apply ? "apply" : "dry-run"}`,
|
|
138
|
+
` legacy rows: ${counts.legacy}`,
|
|
139
|
+
` valid rows: ${counts.valid}`,
|
|
140
|
+
` invalid rows: ${counts.invalid}`,
|
|
141
|
+
` duplicates removed: ${counts.duplicates}`,
|
|
142
|
+
` skipped (existing canonical): ${counts.skipped}`,
|
|
143
|
+
` to migrate: ${counts.toMigrate}`,
|
|
144
|
+
];
|
|
145
|
+
|
|
146
|
+
if (invalid.length > 0) {
|
|
147
|
+
lines.push(" invalid records:");
|
|
148
|
+
for (const entry of invalid) {
|
|
149
|
+
lines.push(
|
|
150
|
+
` - index ${entry.index} machineId=${entry.machineId} errors=${entry.errors.join(", ")}`,
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (skipped.length > 0) {
|
|
156
|
+
lines.push(" skipped (existing canonical):");
|
|
157
|
+
for (const entry of skipped) {
|
|
158
|
+
lines.push(` - ${entry.machineId}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
if (apply) {
|
|
163
|
+
lines.push(` migrated: ${migrated.length}`);
|
|
164
|
+
for (const machineId of migrated) {
|
|
165
|
+
lines.push(` - ${machineId}`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
return lines.join("\n");
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async function readLegacyStorage(app, ownerId) {
|
|
173
|
+
const { data, error } = await app.storage
|
|
174
|
+
.from("agentlink-machines")
|
|
175
|
+
.download(`${ownerId}/machines.json`);
|
|
176
|
+
if (error) {
|
|
177
|
+
if (/not found|no such|404/i.test(error.message || "")) return [];
|
|
178
|
+
throw new Error(`读取 legacy Storage 机器列表失败:${error.message}`);
|
|
179
|
+
}
|
|
180
|
+
const parsed = JSON.parse(await data.text());
|
|
181
|
+
return Array.isArray(parsed.machines) ? parsed.machines : [];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
async function readCanonicalRows(database) {
|
|
185
|
+
const { data, error } = await database
|
|
186
|
+
.from("agentlink_machine_keys")
|
|
187
|
+
.select("machine_id,name,hostname,enckey,connected_at,created_at")
|
|
188
|
+
.order("updated_at", { ascending: false });
|
|
189
|
+
if (error) throw new Error(`读取 canonical 机器记录失败:${error.message}`);
|
|
190
|
+
return Array.isArray(data) ? data : [];
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
async function upsertCanonicalRow(database, ownerId, record) {
|
|
194
|
+
const { error } = await database.from("agentlink_machine_keys").upsert(
|
|
195
|
+
{
|
|
196
|
+
owner_id: ownerId,
|
|
197
|
+
machine_id: record.machineId,
|
|
198
|
+
name: record.name ?? null,
|
|
199
|
+
hostname: record.hostname ?? null,
|
|
200
|
+
enckey: record.enckey,
|
|
201
|
+
connected_at: record.connectedAt ?? null,
|
|
202
|
+
created_at: record.createdAt,
|
|
203
|
+
updated_at: record.updatedAt,
|
|
204
|
+
},
|
|
205
|
+
{ onConflict: "owner_id,machine_id" },
|
|
206
|
+
);
|
|
207
|
+
if (error) throw new Error(`写入 canonical 机器记录失败:${error.message}`);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function nextArg(argv, name) {
|
|
211
|
+
const index = argv.indexOf(name);
|
|
212
|
+
return index >= 0 && index + 1 < argv.length ? argv[index + 1] : undefined;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
function hasArg(argv, name) {
|
|
216
|
+
return argv.includes(name);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export function parseMigrationArgs(argv) {
|
|
220
|
+
const apply = hasArg(argv, "--apply");
|
|
221
|
+
const hub = nextArg(argv, "--hub");
|
|
222
|
+
const rejected = argv.filter(
|
|
223
|
+
(arg) => arg === "--password" || arg === "--access-key" || arg === "--owner" || arg === "--env",
|
|
224
|
+
);
|
|
225
|
+
if (rejected.length > 0) {
|
|
226
|
+
throw new Error(`不允许通过命令行传入敏感参数或 owner:${rejected.join(", ")}`);
|
|
227
|
+
}
|
|
228
|
+
return { apply, hub };
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export async function runMigration({
|
|
232
|
+
hubUrl,
|
|
233
|
+
apply,
|
|
234
|
+
getCredentials,
|
|
235
|
+
fetchFn,
|
|
236
|
+
cloudbaseSdk,
|
|
237
|
+
}) {
|
|
238
|
+
const { identifier, password } = await getCredentials();
|
|
239
|
+
const config = await loadAgentLinkAccountConfig(hubUrl, fetchFn);
|
|
240
|
+
if (!config?.cloudbaseEnvId) throw new Error("Hub 未返回 CloudBase 环境 ID。");
|
|
241
|
+
|
|
242
|
+
const sdk = cloudbaseSdk ?? (await import("@cloudbase/js-sdk")).default;
|
|
243
|
+
const app = sdk.init({ env: config.cloudbaseEnvId, region: "ap-shanghai" });
|
|
244
|
+
const auth = app.auth();
|
|
245
|
+
const signedIn = await auth.signInWithPassword(
|
|
246
|
+
identifier.includes("@") ? { email: identifier, password } : { username: identifier, password },
|
|
247
|
+
);
|
|
248
|
+
if (signedIn?.error) throw new Error(signedIn.error.message || "CloudBase 登录失败。");
|
|
249
|
+
|
|
250
|
+
try {
|
|
251
|
+
const user = await auth.getCurrentUser();
|
|
252
|
+
if (!user?.uid) throw new Error("CloudBase 账号登录状态无效。");
|
|
253
|
+
const ownerId = user.uid;
|
|
254
|
+
|
|
255
|
+
const database = app.rdb();
|
|
256
|
+
const legacyRecords = await readLegacyStorage(app, ownerId);
|
|
257
|
+
const existingRows = await readCanonicalRows(database);
|
|
258
|
+
const report = await runLegacyMachineMigration({
|
|
259
|
+
legacyRecords,
|
|
260
|
+
existingRows,
|
|
261
|
+
upsert: (record) => upsertCanonicalRow(database, ownerId, record),
|
|
262
|
+
apply,
|
|
263
|
+
});
|
|
264
|
+
return { ownerId, report };
|
|
265
|
+
} finally {
|
|
266
|
+
await auth.signOut().catch(() => undefined);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
async function main(argv) {
|
|
271
|
+
const { apply, hub } = parseMigrationArgs(argv);
|
|
272
|
+
const hubUrl = hub || process.env.AGENTLINK_DEFAULT_HUB || "wss://link.harmopath.com";
|
|
273
|
+
const { ownerId, report } = await runMigration({
|
|
274
|
+
hubUrl,
|
|
275
|
+
apply,
|
|
276
|
+
getCredentials: accountCredentials,
|
|
277
|
+
fetchFn: fetch,
|
|
278
|
+
});
|
|
279
|
+
console.log(formatMigrationReport({ ownerId, apply, ...report }));
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
if (import.meta.url.startsWith("file:")) {
|
|
283
|
+
const scriptPath = new URL(import.meta.url).pathname;
|
|
284
|
+
if (process.argv[1] === scriptPath || process.argv[1].endsWith("migrate-legacy-machines.js")) {
|
|
285
|
+
main(process.argv.slice(2)).catch((error) => {
|
|
286
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
287
|
+
process.exit(1);
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
package/dist/bin.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { $ as make$62, A as withLoggerDisabled, At as matchStatus, B as limitsServices, Bt as post$1, C as update$2, Ct as setHeader, D as compression, Dt as uint8Array$1, Et as text$2, F as schemaHeaders, Ft as appendUrlParams, G as CloseEvent, Gt as setUrl, Ht as setBody, I as schemaSearchParams, It as bodyFormData, Jt as HttpClientErrorSchema, K as SocketError, Kt as DecodeError, L as toURL, Lt as bodyJson, M as ParsedSearchParams, O as cors$1, Ot as urlParams$1, P as schemaCookies, Pt as schemaBodyJson, Q as join, Rt as get$4, S as set$2, Sn as __commonJSMin, T as appendPreResponseHandler, Tt as stream, Ut as setHeader$1, Vt as prependUrl, Wt as setHeaders, X as makeWebSocket, Xt as isHttpClientError, Y as make$63, Yt as StatusCodeError, Z as awaitEmpty, Zt as empty$2, _ as get$3, _n as fromInput, _t as mergeCookies, a as layer$40, an as CurrentRedactedNames, b as makeUnsafe$3, bn as hasBody, cn as fromRecordUnsafe, d as HttpClient, dn as jsonUnsafe$1, en as set$3, et as run$4, f as TracerPropagationEnabled, g as transformResponse$1, gn as urlParams, gt as jsonUnsafe, h as retryTransient, hn as uint8Array, ht as isHttpServerResponse, j as HttpServerRequest, k as logger, kt as filterStatusOk, l as serve$1, ln as merge, lt as symbol$1, m as mapRequest, mn as text$1, mt as file, o as HttpServer, on as empty$3, ot as RouteNotFound, p as filterStatusOk$1, pt as empty$1, q as SocketErrorReason, qt as HttpClientError, r as Mime_default, rt as HttpServerError, sn as fromInput$1, t as layerWebSocketConstructor, tt as runtime, u as withLogAddress, un as isHttpBody, ut as toResponse, v as getAndSet, vn as schemaRecord, w as updateAndGet, wn as __require, wt as setHeaders$1, x as modify$2, xn as map$3, xt as schemaJson, y as make$60, yn as toRecord, yt as redirect, zt as make$61 } from "./NodeSocket-08w4osAf.mjs";
|
|
4
|
-
import { $ as decodeUnknownExit, $c as combine$1, $d as isNotNull, $i as makeUnsafe$7, $l as fromInput$2, $o as service, $s as taggedEnum, $t as Union$1, $u as empty$5, A as StructWithRest, Ac as die$2, Ad as getStackTraceLimit, Ai as makeUnsafe$5, Al as fnUntraced$1, An as encodeBase64, Ao as never, Ar as mapError$1, As as withTracerEnabled, At as suspend$1, Au as reduce, B as Union, Ba as catch_, Bc as die$1, Bd as NodeInspectSymbol, Bn as now, Bo as provideContext, Br as run$5, Bt as value, C as Number$1, Ca as annotateCurrentSpan, Cc as make$73, Cd as match$1, Ci as fromTransform, Cn as parseJson, Cr as fromSubscription, Cs as void_$1, Ct as isTrimmed, Cu as fromIterable, D as String$1, Da as as, Dc as TracerEnabled, Dd as make$69, Dn as decodeBase64String, Do as matchCauseEffect, Dr as map$8, Dt as mutable, Du as map$5, E as Record, Ea as annotateSpans, Ec as MinimumLogLevel, Ed as Number$2, Ei as pipeTo, Eo as match$2, Er as make$71, Es as withFiber$1, Et as makeFilter, Fa as catchFilter, Fc as isDeferred, Fd as isEffect$1, Fn as isGreaterThan$1, Fo as option, Fs as timer, Ft as toJsonSchemaDocument, Fu as map$7, G as annotateKey, Ga as die, Gc as isSuccess, Gd as equals, Gi as unbounded$2, Gl as Tracer, Gn as InvalidValue$1, Go as retry, Gr as runForEach, Gs as parse$2, Gt as toJsonSchemaMultiDocument, Gu as isFailure$1, H as UnknownFromJsonString$1, Ha as context, Hc as failCause$4, Hd as format, Hi as sliding$1, Hl as MinimumTraceLevel, Hn as toEpochMillis, Ho as raceFirst, Hr as runDrain, Hs as spaced, Ht as toMultiDocumentOpenApi3_1, Hu as failVoid, I as URLFromString, Ia as catchIf, Id as withFiber, Ii as make$75, In as isGreaterThanOrEqualTo$1, Io as orDie, Ir as pipeThroughChannel, Is as update$3, It as toType, J as decodeEffect, Ja as exit, Jc as void_$2, Ji as sliding, Jn as Path, Jo as runPromiseWith, Js as currentTimeMillis, Ju as succeed$2, K as brand, Kc as match$3, Ki as publish, Kl as externalSpan, Ko as runFork, Kr as runForEachArray, Ks as round, Kt as escapeToken, Ku as isSuccess$1, L as Uint8Array$1, La as catchReason, Lc as make$70, Ld as assignProperty, Li as offer$1, Ll as sync$1, Ln as isLessThan$1, Lo as orElseSucceed, Ls as withAttributes, Lt as withConstructorDefault, M as TaggedStruct, Ma as catchCause, Mc as fail$3, Md as Prototype, Mi as end, Mn as encodeHex, Mo as onExit, Ms as zipWith, Mt as toCodecJson, Mu as sort, N as TemplateLiteral, Na as catchDefect, Nc as failCause$2, Nd as PipeInspectableProto, Nn as add$3, Ns as counter, Nt as toCodecJsonAST, O as StringFromUriComponent, Oa as asSome, Oc as TracerTimingEnabled, Oi as splitLines, On as decodeBase64Url, Or as mapArrayEffect, Os as withParentSpan, Ot as optional$3, Ou as match, Pi as failCause$3, Pl as reportCauseUnsafe, Pn as formatIso, Po as onInterrupt, Pr as onExit$1, Ps as snapshotUnsafe, Pt as toCodecStringTree, Q as decodeUnknownEffect, Qa as flatMap$1, Qd as hasProperty, Ql as format$1, Qo as scopedWith, Qs as TaggedError, Qt as isSchemaError, Qu as add$2, R as Undefined, Ra as catchTag, Ri as offerAll, Rl as tracerLogger$1, Rn as make$68, Ro as promise, Rr as provideContext$1, Rs as addDelay, Rt as withDecodingDefault, S as NullOr, Sa as andThen, Sc as forkUnsafe, Sd as map$6, Sl as CurrentLoggers$1, Sn as onSome, So as map$4, Ss as useSpan, St as isSchema, Su as flatMapNullishOr, T as OptionFromNullOr, Ta as annotateLogsScoped, Tc as provide$2, Td as some, Ti as mapEffect$2, Tn as stringifyJson, Tr as isStream, Ts as withErrorReporting, Tt as make$67, Tu as isReadonlyArrayNonEmpty, U as Void, Ua as contextWith, Uc as interrupt$3, Ui as take$1, Ul as NativeSpan, Un as toUtc, Uo as repeat, Ur as runFold, Us as catchDone, Ut as apply, Uu as getOrThrow, V as Unknown, Vc as fail$4, Vd as toJson, Vi as shutdown$1, Vn as toDate, Vo as provideService, Vr as runCollect, Vs as passthrough, Vt as VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP, Vu as fail$1, W as annotate$2, Wa as currentParentSpan, Wc as isFailure, Wi as takeAll, Wl as ParentSpan, Wn as Forbidden$1, Wo as result, Wr as runFoldEffect, Ws as isDoneCause, Wt as toRepresentations, Wu as getOrUndefined$2, X as decodeSync, Xa as failCause$1, Xc as NoSuchElementError, Xi as unbounded$1, Xn as FileSystem, Xo as scope, Xr as takeWhile, Xu as Reference, Y as decodeExit, Ya as fail, Yi as subscribe, Ys as currentTimeNanos, Z as decodeTo, Za as filterOrFail, Zc as StackTrace, Zd as compose$1, Zl as days, Zo as scoped, Zr as toAsyncIterable, Zs as TaggedClass, Zt as SchemaError, Zu as Service$2, _a as Transaction, _c as Scope, _d as getOrElse, _f as pipe, _l as pretty, _n as Transformation, _o as logError, _s as tx, _t as isMaxLength, _u as filter$1, a as Class, aa as runIn, ac as effectDiscard, ad as make$65, an as isLiteral, ao as forkChild, ar as debounce, as as suspend, at as encodeUnknownExit, au as max, b as NonEmptyString, ba as addFinalizer, bc as close, bd as isNone, bi as decodeText$1, bn as transformOrFail, bo as logWarning$1, br as fromPubSub, bt as isNonEmpty, bu as findFirstIndex, c as Defect, ca as empty$6, cc as launch, cd as omit, cf as compose, ci as invalidate, cl as hasInterruptsOnly, cn as isOptional, co as fromResult, cr as drain, cs as tapCause, ct as instanceOf, cu as nanos, d as ErrorClass, da as size$2, dc as provideMerge, dd as filter, df as constUndefined, dl as isCause, dn as isVoid, do as ignoreCause, ds as tapErrorTag, dt as isFinite, ea as await_, ec as CurrentMemoMap, ed as get$5, ef as isNotUndefined, eo as flatten$1,
|
|
4
|
+
import { $ as decodeUnknownExit, $c as combine$1, $d as isNotNull, $i as makeUnsafe$7, $l as fromInput$2, $o as service, $s as taggedEnum, $t as Union$1, $u as empty$5, A as StructWithRest, Ac as die$2, Ad as getStackTraceLimit, Ai as makeUnsafe$5, Al as fnUntraced$1, An as encodeBase64, Ao as never, Ar as mapError$1, As as withTracerEnabled, At as suspend$1, Au as reduce, B as Union, Ba as catch_, Bc as die$1, Bd as NodeInspectSymbol, Bn as now, Bo as provideContext, Br as run$5, Bt as value, C as Number$1, Ca as annotateCurrentSpan, Cc as make$73, Cd as match$1, Ci as fromTransform, Cn as parseJson, Cr as fromSubscription, Cs as void_$1, Ct as isTrimmed, Cu as fromIterable, D as String$1, Da as as, Dc as TracerEnabled, Dd as make$69, Dn as decodeBase64String, Do as matchCauseEffect, Dr as map$8, Dt as mutable, Du as map$5, E as Record, Ea as annotateSpans, Ec as MinimumLogLevel, Ed as Number$2, Ei as pipeTo, Eo as match$2, Er as make$71, Es as withFiber$1, Et as makeFilter, Fa as catchFilter, Fc as isDeferred, Fd as isEffect$1, Fn as isGreaterThan$1, Fo as option, Fs as timer, Ft as toJsonSchemaDocument, Fu as map$7, G as annotateKey, Ga as die, Gc as isSuccess, Gd as equals, Gi as unbounded$2, Gl as Tracer, Gn as InvalidValue$1, Go as retry, Gr as runForEach, Gs as parse$2, Gt as toJsonSchemaMultiDocument, Gu as isFailure$1, H as UnknownFromJsonString$1, Ha as context, Hc as failCause$4, Hd as format, Hi as sliding$1, Hl as MinimumTraceLevel, Hn as toEpochMillis, Ho as raceFirst, Hr as runDrain, Hs as spaced, Ht as toMultiDocumentOpenApi3_1, Hu as failVoid, I as URLFromString, Ia as catchIf, Id as withFiber, Ii as make$75, In as isGreaterThanOrEqualTo$1, Io as orDie, Ir as pipeThroughChannel, Is as update$3, It as toType, J as decodeEffect, Ja as exit, Jc as void_$2, Ji as sliding, Jn as Path, Jo as runPromiseWith, Js as currentTimeMillis, Ju as succeed$2, K as brand, Kc as match$3, Ki as publish, Kl as externalSpan, Ko as runFork, Kr as runForEachArray, Ks as round, Kt as escapeToken, Ku as isSuccess$1, L as Uint8Array$1, La as catchReason, Lc as make$70, Ld as assignProperty, Li as offer$1, Ll as sync$1, Ln as isLessThan$1, Lo as orElseSucceed, Ls as withAttributes, Lt as withConstructorDefault, M as TaggedStruct, Ma as catchCause, Mc as fail$3, Md as Prototype, Mi as end, Mn as encodeHex, Mo as onExit, Ms as zipWith, Mt as toCodecJson, Mu as sort, N as TemplateLiteral, Na as catchDefect, Nc as failCause$2, Nd as PipeInspectableProto, Nn as add$3, Ns as counter, Nt as toCodecJsonAST, O as StringFromUriComponent, Oa as asSome, Oc as TracerTimingEnabled, Oi as splitLines, On as decodeBase64Url, Or as mapArrayEffect, Os as withParentSpan, Ot as optional$3, Ou as match, Pi as failCause$3, Pl as reportCauseUnsafe, Pn as formatIso, Po as onInterrupt, Pr as onExit$1, Ps as snapshotUnsafe, Pt as toCodecStringTree, Q as decodeUnknownEffect, Qa as flatMap$1, Qd as hasProperty, Ql as format$1, Qo as scopedWith, Qs as TaggedError, Qt as isSchemaError, Qu as add$2, R as Undefined, Ra as catchTag, Ri as offerAll, Rl as tracerLogger$1, Rn as make$68, Ro as promise, Rr as provideContext$1, Rs as addDelay, Rt as withDecodingDefault, S as NullOr, Sa as andThen, Sc as forkUnsafe, Sd as map$6, Sl as CurrentLoggers$1, Sn as onSome, So as map$4, Ss as useSpan, St as isSchema, Su as flatMapNullishOr, T as OptionFromNullOr, Ta as annotateLogsScoped, Tc as provide$2, Td as some, Ti as mapEffect$2, Tn as stringifyJson, Tr as isStream, Ts as withErrorReporting, Tt as make$67, Tu as isReadonlyArrayNonEmpty, U as Void, Ua as contextWith, Uc as interrupt$3, Ui as take$1, Ul as NativeSpan, Un as toUtc, Uo as repeat, Ur as runFold, Us as catchDone, Ut as apply, Uu as getOrThrow, V as Unknown, Vc as fail$4, Vd as toJson, Vi as shutdown$1, Vn as toDate, Vo as provideService, Vr as runCollect, Vs as passthrough, Vt as VALID_OPEN_API_COMPONENTS_SCHEMAS_KEY_REGEXP, Vu as fail$1, W as annotate$2, Wa as currentParentSpan, Wc as isFailure, Wi as takeAll, Wl as ParentSpan, Wn as Forbidden$1, Wo as result, Wr as runFoldEffect, Ws as isDoneCause, Wt as toRepresentations, Wu as getOrUndefined$2, X as decodeSync, Xa as failCause$1, Xc as NoSuchElementError, Xi as unbounded$1, Xn as FileSystem, Xo as scope, Xr as takeWhile, Xu as Reference, Y as decodeExit, Ya as fail, Yi as subscribe, Ys as currentTimeNanos, Z as decodeTo, Za as filterOrFail, Zc as StackTrace, Zd as compose$1, Zl as days, Zo as scoped, Zr as toAsyncIterable, Zs as TaggedClass, Zt as SchemaError, Zu as Service$2, _a as Transaction, _c as Scope, _d as getOrElse, _f as pipe, _l as pretty, _n as Transformation, _o as logError, _s as tx, _t as isMaxLength, _u as filter$1, a as Class, aa as runIn, ac as effectDiscard, ad as make$65, an as isLiteral, ao as forkChild, ar as debounce, as as suspend, at as encodeUnknownExit, au as max, b as NonEmptyString, ba as addFinalizer, bc as close, bd as isNone, bi as decodeText$1, bn as transformOrFail, bo as logWarning$1, br as fromPubSub, bt as isNonEmpty, bu as findFirstIndex, c as Defect, ca as empty$6, cc as launch, cd as omit, cf as compose, ci as invalidate, cl as hasInterruptsOnly, cn as isOptional, co as fromResult, cr as drain, cs as tapCause, ct as instanceOf, cu as nanos, d as ErrorClass, da as size$2, dc as provideMerge, dd as filter, df as constUndefined, dl as isCause, dn as isVoid, do as ignoreCause, ds as tapErrorTag, dt as isFinite, ea as await_, ec as CurrentMemoMap, ed as get$5, ef as isNotUndefined, eo as flatten$1, et as decodeUnknownOption, eu as fromInputUnsafe, f as Exit, fa as toArray, fc as succeed$3, fd as firstSomeOf, ff as constVoid, fl as isFailReason, fn as resolveAt, fo as interrupt$1, fr as fail$5, fs as timeout, ft as isGreaterThan, fu as zero, g as Literals, gc as unwrap, gd as fromUndefinedOr, gf as identity, gi as forEach$1, gl as map$9, go as logDebug, gr as fromAsyncIterable, gs as try_, gt as isLessThanOrEqualTo, gu as ensure, h as Literal, hc as tap$1, hd as fromNullishOr, hi as drain$1, hn as toEncoded, ho as log$1, hr as flatMap$2, hs as tryPromise, ht as isLessThan, hu as empty$4, i as Cause, ia as join$1, ic as effectContext, id as getUnsafe$1, if as isTagged, il as findErrorOption, in as isDeclaration, io as forever, ir as concat, is as succeedSome, it as encodeUnknownEffect, j as TaggedErrorClass, ja as callback, jd as setStackTraceLimit, ji as bounded, jn as encodeBase64Url, jo as onError, jr as merge$2, js as yieldNow, jt as tag, ju as reverse, k as Struct, ka as asVoid, kc as _await, ki as make$72, kn as decodeBase64UrlString, ko as matchEffect, kr as mapEffect$1, ks as withSpan, kt as optionalKey, l as Duration, la as head, lc as mergeAll, ld as contains, lf as constFalse, li as make$66, ll as interrupt$2, ln as isSuspend, lo as gen, lr as empty$7, ls as tapDefect, lt as is, lu as seconds, m as Int, ma as PlatformError, mc as sync$2, md as flatten, mf as dual, mn as resolveIdentifier, mo as isEffect, mr as filter$2, mt as isInt, n as ArraySchema, na as interrupt$4, nc as buildWithMemoMap, nd as getOrElse$1, nf as isObject$1, ni as unwrap$1, nl as fail$2, nn as getAST, no as fnUntraced, nr as catchCause$1, ns as succeed$1, nt as encodeEffect, o as DateTimeUtc, oa as append$1, oc as empty$8, od as makeUnsafe$4, oi as get$6, ol as hasDies, on as isNull, oo as forkIn, or as decodeText, os as sync, ot as fieldsAssign, ou as millis, p as Finite, pc as succeedContext, pd as flatMap$3, pf as constant, pn as resolveDescription, po as interruptible, pr as failCause$5, ps as timeoutOption, pt as isGreaterThanOrEqualTo, pu as allocate, q as declare, qa as ensuring, qi as shutdown$2, ql as make$74, qn as makeFormatterDefault, qo as runForkWith, qs as Clock, qt as assign, r as Boolean$1, rc as effect, rd as getOrUndefined$1, rf as isString, ri as withSpan$1, rn as getLastEncoding, ro as forEach, rr as changes, rs as succeedNone, rt as encodeSync, s as DateTimeUtcFromString, sa as drop$1, sd as merge$1, sf as cast, si as has, sl as hasInterrupts, sn as isObjects, so as forkScoped, ss as tap, st as fromJsonString, su as minutes, t as Any, ta as getCurrent, tc as build, td as getOption, tf as isNullish, ti as transformPull, to as fn, ts as sleep, tt as encode$1, tu as hours, u as DurationFromMillis, ua as isEmpty$2, uc as provide, ud as exists, uf as constTrue, ul as interruptors, un as isUnion, uo as ignore$1, ur as encodeText, us as tapError, ut as isBetween, uu as toMillis, v as Never, va as acquireRelease, vc as addFinalizer$1, vd as getOrNull, vf as pipeArguments, vl as prettyErrors, vo as logFatal, vr as fromEffect, vs as txRetry, vt as isMaxProperties, vu as filterMap, w as Option, wa as annotateLogs, wc as makeUnsafe$8, wd as none, wl as consolePretty$1, wo as mapError, wr as groupedWithin, ws as whileLoop, wu as isArrayNonEmpty, x as Null, xa as all, xc as closeUnsafe, xd as isSome, xi as filterArray, xl as ConsoleRef, xn as trim, xo as makeSpanScoped, xr as fromQueue, xs as updateContext, xt as isPattern, xu as findLast, y as NonEmptyArray, ya as acquireUseRelease, yc as addFinalizerExit, yd as getOrUndefined, yi as mapInput, yl as squash, yn as transform$1, yo as logInfo, yr as fromIterable$1, ys as uninterruptible, yt as isMinLength, yu as findFirst, z as UndefinedOr, za as catchTags, zc as succeed$4, zi as offerUnsafe, zn as makeUnsafe$6, zo as provide$1, zr as provideService$1, zs as forever$1, zt as make$64 } from "./Schema-B3i-HrZQ.mjs";
|
|
5
5
|
import { a as isQuitError, g as ChildProcessSpawner, h as make$76, i as Terminal$1, l as Crypto, n as layer$41, o as Stdio, r as QuitError, s as make$77, u as fromReadable } from "./NodeServices-DDZTiw5K.mjs";
|
|
6
6
|
import { _ as withDefault$2, a as all$1, c as logLevel, d as option$1, f as port, g as url$1, i as TrueValues, l as map$10, m as string$4, n as FalseValues, o as boolean$3, p as schema$1, r as Record$1, s as int, t as Boolean$2, u as number } from "./Config-Bj2ZPCsP.mjs";
|
|
7
7
|
import { c as getOption$1, d as make$78, f as makeWith$1, l as invalidate$1, n as SqlClient, p as set$4, s as get$7, u as keys } from "./SqlClient-DcM69ZvI.mjs";
|
|
@@ -20619,6 +20619,12 @@ const EnvironmentIdentificationMode = Literals([
|
|
|
20619
20619
|
"none"
|
|
20620
20620
|
]);
|
|
20621
20621
|
const DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE = "artwork";
|
|
20622
|
+
const ClientLanguage = Literals([
|
|
20623
|
+
"system",
|
|
20624
|
+
"en",
|
|
20625
|
+
"zh-CN"
|
|
20626
|
+
]);
|
|
20627
|
+
const DEFAULT_CLIENT_LANGUAGE = "system";
|
|
20622
20628
|
/**
|
|
20623
20629
|
* A user-chosen font family (a single name or a comma-separated list). Empty
|
|
20624
20630
|
* means "use the app default"; clients compose their own fallback stacks.
|
|
@@ -20626,6 +20632,7 @@ const DEFAULT_ENVIRONMENT_IDENTIFICATION_MODE = "artwork";
|
|
|
20626
20632
|
const FontFamilyPreference = String$1.check(isMaxLength(200));
|
|
20627
20633
|
const DEFAULT_CLIENT_SETTINGS = decodeSync(Struct({
|
|
20628
20634
|
autoOpenPlanSidebar: Boolean$1.pipe(withDecodingDefault(succeed$1(false))),
|
|
20635
|
+
language: ClientLanguage.pipe(withDecodingDefault(succeed$1(DEFAULT_CLIENT_LANGUAGE))),
|
|
20629
20636
|
confirmThreadArchive: Boolean$1.pipe(withDecodingDefault(succeed$1(false))),
|
|
20630
20637
|
confirmThreadDelete: Boolean$1.pipe(withDecodingDefault(succeed$1(true))),
|
|
20631
20638
|
dismissedProviderUpdateNotificationKeys: ArraySchema(TrimmedNonEmptyString).pipe(withDecodingDefault(succeed$1([]))),
|
|
@@ -20935,6 +20942,7 @@ const ServerSettingsPatch = Struct({
|
|
|
20935
20942
|
});
|
|
20936
20943
|
Struct({
|
|
20937
20944
|
autoOpenPlanSidebar: optionalKey(Boolean$1),
|
|
20945
|
+
language: optionalKey(ClientLanguage),
|
|
20938
20946
|
confirmThreadArchive: optionalKey(Boolean$1),
|
|
20939
20947
|
confirmThreadDelete: optionalKey(Boolean$1),
|
|
20940
20948
|
diffIgnoreWhitespace: optionalKey(Boolean$1),
|
|
@@ -49138,7 +49146,6 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49138
49146
|
const services = yield* context();
|
|
49139
49147
|
const scope = get$5(services, Scope);
|
|
49140
49148
|
const entries = /* @__PURE__ */ new Map();
|
|
49141
|
-
const hooks = yield* serviceOption(RequestHooks);
|
|
49142
49149
|
let isShutdown = false;
|
|
49143
49150
|
yield* addFinalizer$1(scope, withFiber$1((parent) => {
|
|
49144
49151
|
isShutdown = true;
|
|
@@ -49169,11 +49176,6 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49169
49176
|
const onEffectRequest = (rpc, middleware, span, payload, headers, context, discard) => withFiber$1((parentFiber) => {
|
|
49170
49177
|
if (isShutdown) return interrupt$1;
|
|
49171
49178
|
const id = generateRequestId();
|
|
49172
|
-
const onStart = isSome(hooks) && hooks.value.onRequestStart ? hooks.value.onRequestStart({
|
|
49173
|
-
id,
|
|
49174
|
-
tag: rpc._tag,
|
|
49175
|
-
stream: false
|
|
49176
|
-
}) : void_$1;
|
|
49177
49179
|
const send = middleware((message) => options.onFromClient({
|
|
49178
49180
|
message,
|
|
49179
49181
|
context,
|
|
@@ -49190,7 +49192,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49190
49192
|
} : {},
|
|
49191
49193
|
headers: merge(parentFiber.getRef(CurrentHeaders), headers)
|
|
49192
49194
|
});
|
|
49193
|
-
if (discard) return
|
|
49195
|
+
if (discard) return send;
|
|
49194
49196
|
let fiber;
|
|
49195
49197
|
return onInterrupt(callback((resume) => {
|
|
49196
49198
|
const entry = {
|
|
@@ -49205,14 +49207,13 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49205
49207
|
}
|
|
49206
49208
|
};
|
|
49207
49209
|
entries.set(id, entry);
|
|
49208
|
-
fiber =
|
|
49210
|
+
fiber = send.pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, runForkWith(parentFiber.context));
|
|
49209
49211
|
fiber.addObserver((exit) => {
|
|
49210
49212
|
if (exit._tag === "Failure") return resume(exit);
|
|
49211
49213
|
});
|
|
49212
49214
|
}), (interruptors) => {
|
|
49213
|
-
const entry = entries.get(id);
|
|
49214
49215
|
entries.delete(id);
|
|
49215
|
-
return andThen(interrupt$4(fiber), sendInterrupt(id, Array.from(interruptors), context
|
|
49216
|
+
return andThen(interrupt$4(fiber), sendInterrupt(id, Array.from(interruptors), context));
|
|
49216
49217
|
});
|
|
49217
49218
|
});
|
|
49218
49219
|
const onStreamRequest = fnUntraced(function* (rpc, middleware, payload, headers, streamBufferSize, context) {
|
|
@@ -49220,17 +49221,11 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49220
49221
|
const span = disableTracing ? void 0 : yield* makeSpanScoped(`${spanPrefix}.${rpc._tag}`, { attributes: options.spanAttributes });
|
|
49221
49222
|
const fiber = getCurrent();
|
|
49222
49223
|
const id = generateRequestId();
|
|
49223
|
-
const onStart = isSome(hooks) && hooks.value.onRequestStart ? hooks.value.onRequestStart({
|
|
49224
|
-
id,
|
|
49225
|
-
tag: rpc._tag,
|
|
49226
|
-
stream: true
|
|
49227
|
-
}) : void_$1;
|
|
49228
49224
|
const scope = getUnsafe$1(fiber.context, Scope);
|
|
49229
49225
|
yield* addFinalizerExit(scope, (exit) => {
|
|
49230
|
-
|
|
49231
|
-
if (!entry) return void_$1;
|
|
49226
|
+
if (!entries.has(id)) return void_$1;
|
|
49232
49227
|
entries.delete(id);
|
|
49233
|
-
return sendInterrupt(id, isFailure(exit) ? Array.from(interruptors(exit.cause)) : [], context
|
|
49228
|
+
return sendInterrupt(id, isFailure(exit) ? Array.from(interruptors(exit.cause)) : [], context);
|
|
49234
49229
|
});
|
|
49235
49230
|
const queue = yield* bounded(streamBufferSize);
|
|
49236
49231
|
entries.set(id, {
|
|
@@ -49238,10 +49233,9 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49238
49233
|
rpc,
|
|
49239
49234
|
queue,
|
|
49240
49235
|
scope,
|
|
49241
|
-
context
|
|
49242
|
-
chunkCount: 0
|
|
49236
|
+
context
|
|
49243
49237
|
});
|
|
49244
|
-
yield*
|
|
49238
|
+
yield* middleware((message) => options.onFromClient({
|
|
49245
49239
|
message,
|
|
49246
49240
|
context,
|
|
49247
49241
|
discard: false
|
|
@@ -49256,7 +49250,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49256
49250
|
sampled: span.sampled
|
|
49257
49251
|
} : {},
|
|
49258
49252
|
headers: merge(fiber.getRef(CurrentHeaders), headers)
|
|
49259
|
-
})
|
|
49253
|
+
}).pipe(span ? withParentSpan(span, { captureStackTrace: false }) : identity, catchCause((error) => failCause$3(queue, error)), interruptible, forkIn(scope, { startImmediately: true }));
|
|
49260
49254
|
return queue;
|
|
49261
49255
|
});
|
|
49262
49256
|
const getRpcClientMiddleware = (rpc) => {
|
|
@@ -49278,10 +49272,7 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49278
49272
|
});
|
|
49279
49273
|
};
|
|
49280
49274
|
};
|
|
49281
|
-
const sendInterrupt = (requestId, interruptors, context
|
|
49282
|
-
id: requestId,
|
|
49283
|
-
tag
|
|
49284
|
-
}) : void_$1).pipe(andThen(callback((resume) => {
|
|
49275
|
+
const sendInterrupt = (requestId, interruptors, context) => callback((resume) => {
|
|
49285
49276
|
const parentFiber = getCurrent();
|
|
49286
49277
|
options.onFromClient({
|
|
49287
49278
|
message: {
|
|
@@ -49294,20 +49285,14 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49294
49285
|
}).pipe(timeout(1e3), runForkWith(parentFiber.context)).addObserver(() => {
|
|
49295
49286
|
resume(void_$1);
|
|
49296
49287
|
});
|
|
49297
|
-
})
|
|
49288
|
+
});
|
|
49298
49289
|
const write = (message) => {
|
|
49299
49290
|
switch (message._tag) {
|
|
49300
49291
|
case "Chunk": {
|
|
49301
49292
|
const requestId = message.requestId;
|
|
49302
49293
|
const entry = entries.get(requestId);
|
|
49303
49294
|
if (!entry || entry._tag !== "Queue") return void_$1;
|
|
49304
|
-
|
|
49305
|
-
const onChunk = isSome(hooks) && hooks.value.onRequestChunk ? hooks.value.onRequestChunk({
|
|
49306
|
-
id: requestId,
|
|
49307
|
-
tag: entry.rpc._tag,
|
|
49308
|
-
chunkCount
|
|
49309
|
-
}) : void_$1;
|
|
49310
|
-
return offerAll(entry.queue, message.values).pipe(andThen(onChunk), supportsAck ? flatMap$1(() => options.onFromClient({
|
|
49295
|
+
return offerAll(entry.queue, message.values).pipe(supportsAck ? flatMap$1(() => options.onFromClient({
|
|
49311
49296
|
message: {
|
|
49312
49297
|
_tag: "Ack",
|
|
49313
49298
|
requestId: message.requestId
|
|
@@ -49321,16 +49306,11 @@ const makeNoSerialization$1 = /*#__PURE__*/ fnUntraced(function* (group, options
|
|
|
49321
49306
|
const entry = entries.get(requestId);
|
|
49322
49307
|
if (!entry) return void_$1;
|
|
49323
49308
|
entries.delete(requestId);
|
|
49324
|
-
|
|
49325
|
-
id: requestId,
|
|
49326
|
-
tag: entry.rpc._tag,
|
|
49327
|
-
stream: entry._tag === "Queue",
|
|
49328
|
-
exit: message.exit
|
|
49329
|
-
}) : void_$1;
|
|
49330
|
-
if (entry._tag === "Effect") return onExit.pipe(andThen(sync(() => {
|
|
49309
|
+
if (entry._tag === "Effect") {
|
|
49331
49310
|
entry.resume(message.exit);
|
|
49332
|
-
|
|
49333
|
-
|
|
49311
|
+
return void_$1;
|
|
49312
|
+
}
|
|
49313
|
+
return message.exit._tag === "Success" ? end(entry.queue) : failCause$3(entry.queue, message.exit.cause);
|
|
49334
49314
|
}
|
|
49335
49315
|
case "Defect": return clearEntries(die$1(message.defect));
|
|
49336
49316
|
case "ClientEnd": return void_$1;
|
|
@@ -49511,11 +49491,6 @@ var Protocol$1 = class extends Service$2()("effect/rpc/RpcClient/Protocol") {
|
|
|
49511
49491
|
*/
|
|
49512
49492
|
static make = withRunClient;
|
|
49513
49493
|
};
|
|
49514
|
-
/**
|
|
49515
|
-
* @since 4.0.0
|
|
49516
|
-
* @category RequestHooks
|
|
49517
|
-
*/
|
|
49518
|
-
var RequestHooks = class extends Service$2()("effect/rpc/RpcClient/RequestHooks") {};
|
|
49519
49494
|
Service$2()("effect/rpc/RpcClient/ConnectionHooks");
|
|
49520
49495
|
const decodeDefect = /*#__PURE__*/ decodeSync(/*#__PURE__*/ Defect());
|
|
49521
49496
|
//#endregion
|