trellis 3.2.2 → 3.2.4
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/CHANGELOG.md +10 -0
- package/README.md +4 -0
- package/dist/better-sqlite-backend-CDYOAJDF.js +209 -0
- package/dist/boot-middleware-LBJX4N2S.js +9 -0
- package/dist/boot-middleware-PATBLD52.js +9 -0
- package/dist/bridge-G5DPW6TY.js +2361 -0
- package/dist/bridge-JSSPQPRH.js +2389 -0
- package/dist/bridge-LNXE4HAW.js +2389 -0
- package/dist/bridge-OAAXJWSA.js +2389 -0
- package/dist/bridge-SFS63RHC.js +2367 -0
- package/dist/bridge-U5TOUBVM.js +2389 -0
- package/dist/browser/index.js +9 -9
- package/dist/{chunk-KSU2GW22.js → chunk-276W52FK.js} +8 -0
- package/dist/{chunk-KFQGP6VL.js → chunk-2ESYSVXG.js} +15 -0
- package/dist/{chunk-L5N5PR2S.js → chunk-2WW2X2BR.js} +313 -77
- package/dist/chunk-3XCOAP6G.js +48 -0
- package/dist/chunk-53PDCTJ3.js +1856 -0
- package/dist/{chunk-N6MYZT4O.js → chunk-547FZFKO.js} +1 -1
- package/dist/{chunk-H6JB3PZ3.js → chunk-5KSGGKET.js} +1 -1
- package/dist/{chunk-J2TXUFCZ.js → chunk-6RWGFC3N.js} +134 -20
- package/dist/{chunk-QB5ISE47.js → chunk-7WVOPXJV.js} +3 -3
- package/dist/chunk-CMSFD6OV.js +11801 -0
- package/dist/{chunk-RSWUFTO2.js → chunk-CPUYCCLT.js} +2 -2
- package/dist/{chunk-4HYPLFJD.js → chunk-FA5TFVA5.js} +1 -1
- package/dist/{chunk-4XIVMVHC.js → chunk-G3XIHPSQ.js} +1 -1
- package/dist/{chunk-JHHEXEDM.js → chunk-GCQF75T4.js} +3 -3
- package/dist/{chunk-FKQO5A3H.js → chunk-GHG4H3AS.js} +2 -2
- package/dist/{chunk-GLM4HGN4.js → chunk-GRWQPKYK.js} +1 -1
- package/dist/{chunk-PZ4XYZ4J.js → chunk-GXA73CNC.js} +33 -8
- package/dist/{chunk-6GEZ6DN5.js → chunk-H6VTC5SS.js} +3 -3
- package/dist/{chunk-S3XLFZ27.js → chunk-IHHSOBJS.js} +1 -1
- package/dist/chunk-IJNC25UD.js +2243 -0
- package/dist/{chunk-VDAKEOML.js → chunk-J6OUIION.js} +1 -1
- package/dist/chunk-JAVAYMMS.js +6 -0
- package/dist/{chunk-S6GBJ2ZB.js → chunk-JCQQFLO5.js} +1 -1
- package/dist/{chunk-FWRS4CSC.js → chunk-KQG6ZYXP.js} +3 -3
- package/dist/chunk-KXAISKZT.js +119 -0
- package/dist/chunk-N3R74ZSR.js +7949 -0
- package/dist/{chunk-GU374KWZ.js → chunk-NLFRRGX6.js} +3 -3
- package/dist/{chunk-XMQ7G77X.js → chunk-OB4CMMX6.js} +1 -1
- package/dist/chunk-OKNASCZY.js +182 -0
- package/dist/chunk-ONOPPX5E.js +394 -0
- package/dist/chunk-QMSU2RAH.js +98 -0
- package/dist/{chunk-TCKXSOBP.js → chunk-RARKFVWU.js} +8 -1
- package/dist/{chunk-2W3MHTMG.js → chunk-SJWVDS5M.js} +835 -127
- package/dist/{chunk-SPSPV5BC.js → chunk-SZ3VAB5P.js} +159 -2
- package/dist/chunk-V2ASD6RQ.js +147 -0
- package/dist/{chunk-KQ4A2D2P.js → chunk-V4YCJDYL.js} +58 -38
- package/dist/{chunk-LNUIGRDZ.js → chunk-VWKLKLYB.js} +1 -1
- package/dist/chunk-W5PADCDF.js +1856 -0
- package/dist/{chunk-MLC5BUYO.js → chunk-WMERMSWI.js} +1 -1
- package/dist/{chunk-IZX2PLIB.js → chunk-WXAURJUD.js} +835 -127
- package/dist/chunk-YC5I32PS.js +147 -0
- package/dist/{chunk-VBYUTRXX.js → chunk-YKVB4LUQ.js} +3 -3
- package/dist/{chunk-7ZFRVCUE.js → chunk-YPT6XMS4.js} +48 -64
- package/dist/cli/deploy-cli.d.ts.map +1 -1
- package/dist/{deploy-cli-C35HTITO.js → cli/deploy-cli.js} +45 -6
- package/dist/cli/gateway-deploy-cli.d.ts +19 -0
- package/dist/cli/gateway-deploy-cli.d.ts.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +1363 -884
- package/dist/cli/lane.d.ts.map +1 -1
- package/dist/cli/protocol.d.ts +6 -0
- package/dist/cli/protocol.d.ts.map +1 -0
- package/dist/client/index.browser.js +2 -2
- package/dist/client/index.js +11 -11
- package/dist/client/sdk.browser.d.ts +28 -1
- package/dist/client/sdk.browser.d.ts.map +1 -1
- package/dist/client/sdk.browser.js +2 -2
- package/dist/client/sdk.js +2 -2
- package/dist/cms/index.js +1 -1
- package/dist/config-KMY6RRK3.js +19 -0
- package/dist/core/index.js +17 -17
- package/dist/core/kernel/boot-middleware.d.ts +1 -1
- package/dist/core/kernel/boot-middleware.d.ts.map +1 -1
- package/dist/core/kernel/schema-middleware.d.ts +2 -1
- package/dist/core/kernel/schema-middleware.d.ts.map +1 -1
- package/dist/core/kernel/trellis-kernel.d.ts +10 -10
- package/dist/core/kernel/trellis-kernel.d.ts.map +1 -1
- package/dist/core/persist/factory.js +2 -2
- package/dist/core/persist/sqljs-backend.js +2 -2
- package/dist/db/index.js +32 -27
- package/dist/decisions/index.js +4 -4
- package/dist/embeddings/index.js +2 -2
- package/dist/engine.d.ts +24 -6
- package/dist/engine.d.ts.map +1 -1
- package/dist/gateway-deploy-cli-4TU4V3QI.js +312 -0
- package/dist/gateway-deploy-cli-A4ISTDHJ.js +298 -0
- package/dist/gateway-deploy-cli-D3XTKJQJ.js +312 -0
- package/dist/gateway-deploy-cli-ECV3OQCN.js +305 -0
- package/dist/gateway-deploy-cli-JUHKVIJE.js +296 -0
- package/dist/gateway-deploy-cli-NSDW2JLT.js +310 -0
- package/dist/gateway-serve-CM5EAZ52.js +113 -0
- package/dist/import-AJLYHFIA.js +10 -0
- package/dist/index.js +11 -11
- package/dist/launch-explorer-FVX6ZABW.js +95 -0
- package/dist/links/index.js +2 -2
- package/dist/mcp/bridge.d.ts +45 -0
- package/dist/mcp/bridge.d.ts.map +1 -0
- package/dist/mcp/discovery.d.ts +15 -0
- package/dist/mcp/discovery.d.ts.map +1 -0
- package/dist/mcp/gateway-config.d.ts +20 -0
- package/dist/mcp/gateway-config.d.ts.map +1 -0
- package/dist/mcp/gateway-serve.d.ts +19 -0
- package/dist/mcp/gateway-serve.d.ts.map +1 -0
- package/dist/mcp/gateway-serve.js +119 -0
- package/dist/mcp/graph-summary.d.ts +47 -0
- package/dist/mcp/graph-summary.d.ts.map +1 -0
- package/dist/mcp/room-audit.d.ts +14 -0
- package/dist/mcp/room-audit.d.ts.map +1 -0
- package/dist/mcp/room-helpers.d.ts +43 -0
- package/dist/mcp/room-helpers.d.ts.map +1 -0
- package/dist/mcp/room-registry.d.ts +32 -0
- package/dist/mcp/room-registry.d.ts.map +1 -0
- package/dist/mcp/room.d.ts +28 -0
- package/dist/mcp/room.d.ts.map +1 -0
- package/dist/plugins/agent-memory/index.js +1 -1
- package/dist/plugins/idea-garden/index.js +1 -1
- package/dist/plugins/plan-approval/index.js +1 -1
- package/dist/plugins/proactive-watcher/index.js +1 -1
- package/dist/protocol/envelope.d.ts +30 -0
- package/dist/protocol/envelope.d.ts.map +1 -0
- package/dist/protocol/index.d.ts +3 -0
- package/dist/protocol/index.d.ts.map +1 -0
- package/dist/protocol/whereami.d.ts +33 -0
- package/dist/protocol/whereami.d.ts.map +1 -0
- package/dist/query-KHDDIR5G.js +31 -0
- package/dist/react/index.js +3 -3
- package/dist/react/realtime.js +1 -1
- package/dist/react/schema-hooks.js +6 -6
- package/dist/realtime/index.js +3 -3
- package/dist/realtime/relay-server.d.ts.map +1 -1
- package/dist/realtime/room.d.ts.map +1 -1
- package/dist/realtime.bundle.js +2 -0
- package/dist/relay-server-BT6DCJ7F.js +12 -0
- package/dist/relay-server-MPQVGNQU.js +12 -0
- package/dist/relay-server-PAPW2EWC.js +12 -0
- package/dist/remote-manager-6ERQUBSL.js +224 -0
- package/dist/remote-manager-G665WWYY.js +224 -0
- package/dist/remote-manager-HJTEZ4OF.js +224 -0
- package/dist/remote-manager-NYP2Y5UR.js +224 -0
- package/dist/remote-manager-WGLCAMMC.js +224 -0
- package/dist/scaffold/write.d.ts.map +1 -1
- package/dist/schema/index.js +1 -1
- package/dist/server/cors.d.ts +13 -0
- package/dist/server/cors.d.ts.map +1 -0
- package/dist/server/deploy-gateway.d.ts +27 -0
- package/dist/server/deploy-gateway.d.ts.map +1 -0
- package/dist/server/deploy.d.ts +1 -1
- package/dist/server/deploy.d.ts.map +1 -1
- package/dist/server/deploy.js +10 -0
- package/dist/server/discovery-mcp-gateway.d.ts +13 -0
- package/dist/server/discovery-mcp-gateway.d.ts.map +1 -0
- package/dist/server/index.js +44 -37
- package/dist/server/mcp-gateway.d.ts +27 -0
- package/dist/server/mcp-gateway.d.ts.map +1 -0
- package/dist/server/mcp-oauth-metadata.d.ts +31 -0
- package/dist/server/mcp-oauth-metadata.d.ts.map +1 -0
- package/dist/server/node-adapter.d.ts +7 -0
- package/dist/server/node-adapter.d.ts.map +1 -1
- package/dist/server/node-adapter.js +2 -2
- package/dist/server/realtime.d.ts.map +1 -1
- package/dist/server/server.d.ts +8 -0
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/streamable-mcp-gateway.d.ts +12 -0
- package/dist/server/streamable-mcp-gateway.d.ts.map +1 -0
- package/dist/server/usage-meter.d.ts +11 -0
- package/dist/server/usage-meter.d.ts.map +1 -1
- package/dist/server-4VEZHXXS.js +23 -0
- package/dist/{server-ZVWGLLRF.js → server-556BMK4C.js} +1 -1
- package/dist/server-FQT2VYRE.js +23 -0
- package/dist/server-HGZE4ECC.js +23 -0
- package/dist/server-J4JKEAMH.js +23 -0
- package/dist/server-LXPM5TFR.js +23 -0
- package/dist/{server-MB3OPSPI.js → server-POB4NEUX.js} +2 -2
- package/dist/server-VJKAPGPG.js +23 -0
- package/dist/server-YHS3XIIG.js +23 -0
- package/dist/server-ZHTPWPXS.js +23 -0
- package/dist/sprites-NC6D7YZS.js +27 -0
- package/dist/svelte/index.js +3 -3
- package/dist/svelte/schema-hooks.js +4 -4
- package/dist/sync/index.js +4 -4
- package/dist/tenancy-2SZTP4UD.js +16 -0
- package/dist/tenancy-7MTSESMJ.js +16 -0
- package/dist/tenancy-U4E7ZEAG.js +16 -0
- package/dist/vcs/decompose.d.ts.map +1 -1
- package/dist/vcs/index.js +5 -5
- package/dist/vcs/lane-disk-materialize.d.ts +11 -0
- package/dist/vcs/lane-disk-materialize.d.ts.map +1 -0
- package/dist/vcs/lane-worktree.d.ts +21 -0
- package/dist/vcs/lane-worktree.d.ts.map +1 -0
- package/dist/vcs/store.d.ts +28 -0
- package/dist/vcs/store.d.ts.map +1 -0
- package/dist/vcs/types.d.ts +5 -0
- package/dist/vcs/types.d.ts.map +1 -1
- package/dist/vm-config-YZRJ3KUB.js +21 -0
- package/dist/vue/index.js +3 -3
- package/dist/vue/schema-hooks.js +4 -4
- package/package.json +4 -3
- package/dist/chunk-FF36CQHZ.js +0 -61
- package/dist/chunk-GFZCJ4EH.js +0 -108
- package/dist/chunk-KIJITUZB.js +0 -419
- package/dist/chunk-SGMDTWJJ.js +0 -149
- package/dist/chunk-UQISRW6T.js +0 -203
- package/dist/db/trellis.css +0 -1
- package/dist/deploy-LQ7GUGJ5.js +0 -9
- package/dist/deploy-YNVG5E4E.js +0 -9
- package/dist/deploy-cli-24BCHAXY.js +0 -67
- package/dist/sprites-RU3E4XQN.js +0 -15
- package/dist/tenancy-NBLLGCNJ.js +0 -14
|
@@ -7,6 +7,37 @@ function browserOnlyRemoteError(feature) {
|
|
|
7
7
|
`${feature} is not available in browser bundles. Use remote mode with \`new TrellisDb({ url })\`, or import \`trellis/client\` in Node.`
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
|
+
function randomId() {
|
|
11
|
+
if (typeof globalThis.crypto?.randomUUID === "function") {
|
|
12
|
+
return globalThis.crypto.randomUUID();
|
|
13
|
+
}
|
|
14
|
+
return `${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 11)}`;
|
|
15
|
+
}
|
|
16
|
+
function needsXhrForBody() {
|
|
17
|
+
if (typeof globalThis.window !== "undefined" && window.__TRELLIS_NATIVE_HTTP__) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
if (typeof navigator === "undefined") return false;
|
|
21
|
+
const ua = navigator.userAgent;
|
|
22
|
+
if (/iPad|iPhone|iPod/i.test(ua)) return true;
|
|
23
|
+
if (navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1) return true;
|
|
24
|
+
if (/AppleWebKit/i.test(ua) && /KHTML, like Gecko\)/i.test(ua) && !/Safari\/|Chrome\/|Chromium\/|Edg\/|Version\//i.test(ua)) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
function xhrRequest(method, url, headers, body) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
const xhr = new XMLHttpRequest();
|
|
32
|
+
xhr.open(method, url);
|
|
33
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
34
|
+
xhr.setRequestHeader(key, value);
|
|
35
|
+
}
|
|
36
|
+
xhr.onload = () => resolve({ status: xhr.status, text: xhr.responseText });
|
|
37
|
+
xhr.onerror = () => reject(new Error(`XHR network error on ${method} ${url}`));
|
|
38
|
+
xhr.send(body);
|
|
39
|
+
});
|
|
40
|
+
}
|
|
10
41
|
var TrellisDb = class {
|
|
11
42
|
opts;
|
|
12
43
|
_ws = null;
|
|
@@ -101,10 +132,21 @@ var TrellisDb = class {
|
|
|
101
132
|
*/
|
|
102
133
|
async registerType(schema) {
|
|
103
134
|
const def = "@id" in schema ? schema : schema.definition;
|
|
135
|
+
const label = def?.label ?? (def?.["@id"] ? String(def["@id"]).replace(/^trellis:/, "") : "unknown");
|
|
136
|
+
if (!def?.["@id"]) {
|
|
137
|
+
throw new Error(`registerType(${label}): schema is missing a definition with @id`);
|
|
138
|
+
}
|
|
104
139
|
try {
|
|
105
140
|
await this._fetch("POST", "/ontologies", def);
|
|
106
141
|
} catch (err) {
|
|
107
142
|
if (err instanceof FetchError && err.status === 409) return;
|
|
143
|
+
if (err instanceof FetchError) {
|
|
144
|
+
const serverMsg = typeof err.body?.message === "string" ? String(err.body.message) : err.message;
|
|
145
|
+
throw new FetchError(err.status, serverMsg, err.body, {
|
|
146
|
+
...err.context,
|
|
147
|
+
operation: `registerType(${label})`
|
|
148
|
+
});
|
|
149
|
+
}
|
|
108
150
|
throw err;
|
|
109
151
|
}
|
|
110
152
|
}
|
|
@@ -176,7 +218,7 @@ var TrellisDb = class {
|
|
|
176
218
|
* Callback is fired immediately with the initial result, then on every update.
|
|
177
219
|
*/
|
|
178
220
|
subscribe(eql, callback, opts) {
|
|
179
|
-
const subId = `sub_${
|
|
221
|
+
const subId = `sub_${randomId()}`;
|
|
180
222
|
this._subCallbacks.set(subId, callback);
|
|
181
223
|
this._ensureWs().then((ws) => {
|
|
182
224
|
ws.send(
|
|
@@ -184,6 +226,7 @@ var TrellisDb = class {
|
|
|
184
226
|
type: "subscribe",
|
|
185
227
|
id: subId,
|
|
186
228
|
query: eql,
|
|
229
|
+
...this.opts.tenantId ? { tenantId: this.opts.tenantId } : {},
|
|
187
230
|
...opts?.entityType ? { entityType: opts.entityType } : {},
|
|
188
231
|
...opts?.resolve ? { resolve: opts.resolve } : {}
|
|
189
232
|
})
|
|
@@ -214,23 +257,69 @@ var TrellisDb = class {
|
|
|
214
257
|
// -------------------------------------------------------------------------
|
|
215
258
|
// Private
|
|
216
259
|
// -------------------------------------------------------------------------
|
|
260
|
+
/**
|
|
261
|
+
* Tenant isolation, not authorization: when `tenantId` is supplied out-of-band
|
|
262
|
+
* (not bound to the JWT), the server trusts the query param. Safe for ephemeral
|
|
263
|
+
* showcase rooms with unguessable ids; real multi-tenant auth must bind the
|
|
264
|
+
* tenant to the auth token instead. Skipped when the JWT already carries it.
|
|
265
|
+
*/
|
|
266
|
+
_applyTenant(path) {
|
|
267
|
+
const tenantId = this.opts.tenantId;
|
|
268
|
+
if (!tenantId) return path;
|
|
269
|
+
const sep = path.includes("?") ? "&" : "?";
|
|
270
|
+
return `${path}${sep}tenantId=${encodeURIComponent(tenantId)}`;
|
|
271
|
+
}
|
|
217
272
|
async _fetch(method, path, body) {
|
|
218
|
-
const url = `${this.opts.url}${path}`;
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
}
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
273
|
+
const url = `${this.opts.url}${this._applyTenant(path)}`;
|
|
274
|
+
let jsonBody;
|
|
275
|
+
if (body !== void 0) {
|
|
276
|
+
jsonBody = JSON.stringify(body);
|
|
277
|
+
if (jsonBody === void 0) {
|
|
278
|
+
throw new Error(`Request body is not JSON-serializable (${method} ${path})`);
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
const headers = {
|
|
282
|
+
"Content-Type": "application/json",
|
|
283
|
+
...this.opts.apiKey ? { Authorization: `Bearer ${this.opts.apiKey}` } : {}
|
|
284
|
+
};
|
|
285
|
+
const transport = jsonBody !== void 0 && needsXhrForBody() ? "xhr" : "fetch";
|
|
286
|
+
headers["X-Trellis-Transport"] = transport;
|
|
287
|
+
const bodyBytes = jsonBody ? new TextEncoder().encode(jsonBody).byteLength : 0;
|
|
288
|
+
let status;
|
|
289
|
+
let text;
|
|
290
|
+
if (transport === "xhr" && jsonBody !== void 0) {
|
|
291
|
+
({ status, text } = await xhrRequest(method, url, headers, jsonBody));
|
|
292
|
+
} else {
|
|
293
|
+
const res = await fetch(url, {
|
|
294
|
+
method,
|
|
295
|
+
headers,
|
|
296
|
+
body: jsonBody
|
|
297
|
+
});
|
|
298
|
+
status = res.status;
|
|
299
|
+
text = await res.text();
|
|
300
|
+
}
|
|
301
|
+
let data = null;
|
|
302
|
+
if (text) {
|
|
303
|
+
try {
|
|
304
|
+
data = JSON.parse(text);
|
|
305
|
+
} catch {
|
|
306
|
+
data = { raw: text };
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
if (status < 200 || status >= 300) {
|
|
310
|
+
const server = data;
|
|
311
|
+
const message = typeof server?.message === "string" && server.message || typeof server?.error === "string" && server.error || "request failed";
|
|
312
|
+
const err = new FetchError(status, message, data, {
|
|
313
|
+
method,
|
|
314
|
+
path,
|
|
315
|
+
url,
|
|
316
|
+
requestBodyBytes: bodyBytes,
|
|
317
|
+
responseBytes: text.length,
|
|
318
|
+
transport
|
|
319
|
+
});
|
|
320
|
+
console.error("[trellis]", err.toString());
|
|
321
|
+
throw err;
|
|
322
|
+
}
|
|
234
323
|
return data;
|
|
235
324
|
}
|
|
236
325
|
_ensureWs() {
|
|
@@ -274,12 +363,37 @@ var TrellisDb = class {
|
|
|
274
363
|
return this._wsPromise;
|
|
275
364
|
}
|
|
276
365
|
};
|
|
277
|
-
var FetchError = class extends Error {
|
|
278
|
-
constructor(status, message, body) {
|
|
279
|
-
super(
|
|
366
|
+
var FetchError = class _FetchError extends Error {
|
|
367
|
+
constructor(status, message, body, context = {}) {
|
|
368
|
+
super(_FetchError.format(status, message, context));
|
|
280
369
|
this.status = status;
|
|
281
370
|
this.body = body;
|
|
282
371
|
this.name = "FetchError";
|
|
372
|
+
this.context = context;
|
|
373
|
+
}
|
|
374
|
+
context;
|
|
375
|
+
static format(status, message, ctx) {
|
|
376
|
+
const parts = [`HTTP ${status}`];
|
|
377
|
+
if (ctx.operation) parts.push(ctx.operation);
|
|
378
|
+
if (ctx.method && ctx.path) parts.push(`${ctx.method} ${ctx.path}`);
|
|
379
|
+
parts.push(message);
|
|
380
|
+
if (ctx.requestBodyBytes !== void 0) {
|
|
381
|
+
parts.push(`sent ${ctx.requestBodyBytes}B`);
|
|
382
|
+
}
|
|
383
|
+
if (ctx.responseBytes !== void 0) {
|
|
384
|
+
parts.push(`response ${ctx.responseBytes}B`);
|
|
385
|
+
}
|
|
386
|
+
if (ctx.transport) parts.push(ctx.transport);
|
|
387
|
+
return parts.join(" \xB7 ");
|
|
388
|
+
}
|
|
389
|
+
toString() {
|
|
390
|
+
const extra = [];
|
|
391
|
+
if (this.body && typeof this.body === "object") {
|
|
392
|
+
const b = this.body;
|
|
393
|
+
if (typeof b.path === "string") extra.push(`server ${b.method} ${b.path}`);
|
|
394
|
+
if (typeof b.bodyBytes === "number") extra.push(`server saw ${b.bodyBytes}B`);
|
|
395
|
+
}
|
|
396
|
+
return extra.length ? `${this.message} (${extra.join(", ")})` : this.message;
|
|
283
397
|
}
|
|
284
398
|
};
|
|
285
399
|
|
|
@@ -18,7 +18,7 @@ var TrellisDb = class _TrellisDb {
|
|
|
18
18
|
* Create a TrellisDb instance from `.trellis-db.json` in the given directory.
|
|
19
19
|
*/
|
|
20
20
|
static async fromConfig(dir = ".") {
|
|
21
|
-
const { readConfig } = await import("./config-
|
|
21
|
+
const { readConfig } = await import("./config-KMY6RRK3.js");
|
|
22
22
|
const config = readConfig(dir);
|
|
23
23
|
if (!config)
|
|
24
24
|
throw new Error(
|
|
@@ -146,7 +146,7 @@ var TrellisDb = class _TrellisDb {
|
|
|
146
146
|
query: eql
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
const { parseSimple } = await import("./query-
|
|
149
|
+
const { parseSimple } = await import("./query-KHDDIR5G.js");
|
|
150
150
|
const pool = await this._getPool();
|
|
151
151
|
const tenantId = this.opts.tenantId ?? null;
|
|
152
152
|
const kernel = pool.get(tenantId);
|
|
@@ -330,7 +330,7 @@ var TrellisDb = class _TrellisDb {
|
|
|
330
330
|
async _getPool() {
|
|
331
331
|
if (this._pool) return this._pool;
|
|
332
332
|
if (!this._poolPromise) {
|
|
333
|
-
this._poolPromise = import("./tenancy-
|
|
333
|
+
this._poolPromise = import("./tenancy-U4E7ZEAG.js").then(({ TenantPool }) => {
|
|
334
334
|
const path = this.opts.path;
|
|
335
335
|
this._pool = new TenantPool(path);
|
|
336
336
|
return this._pool;
|