@morlay/ui-conversation-message-actions 0.0.14-alpha.1 → 0.0.14-alpha.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/README.md +12 -1
- package/dist/client.js +39 -27
- package/dist/index.d.mts +2 -10
- package/dist/index.mjs +1 -1
- package/dist/{plan-Bw4zoI4N.d.mts → plan-BdU_mnTv.d.mts} +9 -2
- package/dist/plan.d.mts +2 -2
- package/dist/plan.mjs +17 -2
- package/dist/{src-Da2ZVKlq.mjs → src-ks167MhO.mjs} +54 -8
- package/dist/testing.d.mts +1 -1
- package/dist/testing.mjs +1293 -233
- package/package.json +19 -19
- package/src/client/chat-node/MessageIconActions.tsx +4 -2
- package/src/client/controller.ts +21 -2
- package/src/index.ts +100 -24
- package/src/plan.ts +20 -3
package/dist/testing.mjs
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { n as SessionEditor } from "./src-
|
|
1
|
+
import { n as SessionEditor } from "./src-ks167MhO.mjs";
|
|
2
2
|
import { createRequire } from "node:module";
|
|
3
3
|
import { Context, Service } from "@deepseek-ai/cordis";
|
|
4
|
+
import { KNOWN_SESSION_EVENT_TYPES, SESSION_FORMAT_VERSION, Session, Session as Session$1, SessionId, SessionId as SessionIdBrand, SessionLogOffset, SessionSeq, SessionSeq as SessionSeq$1, SessionStore } from "@deepseek-ai/dsh-session";
|
|
4
5
|
import { SessionBranch, SessionBranchError, balanceRewindPrefix, buildTimeline } from "@morlay/session-branch";
|
|
5
|
-
import crypto, { randomUUID } from "node:crypto";
|
|
6
|
+
import crypto, { createHash, randomUUID } from "node:crypto";
|
|
6
7
|
import { TokenMeter } from "@deepseek-ai/dsh-token-meter";
|
|
7
|
-
import { KNOWN_SESSION_EVENT_TYPES, SESSION_FORMAT_VERSION, Session, Session as Session$1, SessionId, SessionId as SessionIdBrand, SessionLogOffset, SessionSeq, SessionSeq as SessionSeq$1, SessionStore } from "@deepseek-ai/dsh-session";
|
|
8
8
|
import SessionProjectionRegistry from "@deepseek-ai/dsh-session-projection";
|
|
9
9
|
import { SessionAlreadyExistsError, SessionAlreadyOwnedError, SessionHandleClosedError, SessionPersistence, SessionPersistenceNotFoundError, SessionPersistenceRevision, SessionReadOnlyError, assertContiguous, assertVersion, materializeAppendBatch, materializeCreateHeader, validateStoredEvents } from "@deepseek-ai/dsh-session-persistence";
|
|
10
10
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
11
11
|
import { AssistantStreamAccumulator, MessageId, freezeMessage } from "@deepseek-ai/dsh-llm";
|
|
12
12
|
import fs, { existsSync, readdirSync, statSync } from "node:fs";
|
|
13
13
|
import { mkdir, open } from "node:fs/promises";
|
|
14
|
+
import { fileURLToPath } from "node:url";
|
|
14
15
|
import { DatabaseSync } from "node:sqlite";
|
|
15
16
|
import { createRequire as createRequire$1 } from "module";
|
|
16
17
|
//#region \0rolldown/runtime.js
|
|
@@ -5193,7 +5194,7 @@ import_lib.default.TypeOverrides;
|
|
|
5193
5194
|
import_lib.default.defaults;
|
|
5194
5195
|
var esm_default = import_lib.default;
|
|
5195
5196
|
//#endregion
|
|
5196
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5197
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/array.js
|
|
5197
5198
|
const DEFAULT_DELIM = ",";
|
|
5198
5199
|
function parsePgArrayValue(arrayString, startFrom, inQuotes, delim) {
|
|
5199
5200
|
for (let i = startFrom; i < arrayString.length; i++) {
|
|
@@ -5259,7 +5260,7 @@ function makePgArray(array, delim = DEFAULT_DELIM) {
|
|
|
5259
5260
|
return buildPgArray(array, delim);
|
|
5260
5261
|
}
|
|
5261
5262
|
//#endregion
|
|
5262
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5263
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/postgis_extension/utils.js
|
|
5263
5264
|
function hexToBytes(hex) {
|
|
5264
5265
|
const bytes = [];
|
|
5265
5266
|
for (let c = 0; c < hex.length; c += 2) bytes.push(Number.parseInt(hex.slice(c, c + 2), 16));
|
|
@@ -5296,7 +5297,7 @@ function parseEWKB(hex) {
|
|
|
5296
5297
|
throw new Error("Unsupported geometry type");
|
|
5297
5298
|
}
|
|
5298
5299
|
//#endregion
|
|
5299
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5300
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/entity.js
|
|
5300
5301
|
const entityKind = Symbol.for("drizzle:entityKind");
|
|
5301
5302
|
function is(value, type) {
|
|
5302
5303
|
if (!value || typeof value !== "object") return false;
|
|
@@ -5309,7 +5310,7 @@ function is(value, type) {
|
|
|
5309
5310
|
return false;
|
|
5310
5311
|
}
|
|
5311
5312
|
//#endregion
|
|
5312
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5313
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/codecs.js
|
|
5313
5314
|
const noopCodecs = {};
|
|
5314
5315
|
const arrayToItemTypeCodecNameMap = {
|
|
5315
5316
|
cast: "cast",
|
|
@@ -5380,10 +5381,10 @@ function refineCodecs(source, extension = {}) {
|
|
|
5380
5381
|
return result;
|
|
5381
5382
|
}
|
|
5382
5383
|
//#endregion
|
|
5383
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5384
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/column-common.js
|
|
5384
5385
|
const OriginalColumn = Symbol.for("drizzle:OriginalColumn");
|
|
5385
5386
|
//#endregion
|
|
5386
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5387
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/column.js
|
|
5387
5388
|
const noop$1 = (v) => v;
|
|
5388
5389
|
noop$1.isNoop = true;
|
|
5389
5390
|
var Column = class {
|
|
@@ -5454,11 +5455,11 @@ var Column = class {
|
|
|
5454
5455
|
}
|
|
5455
5456
|
};
|
|
5456
5457
|
//#endregion
|
|
5457
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5458
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/table.utils.js
|
|
5458
5459
|
/** @internal */
|
|
5459
5460
|
const TableName = Symbol.for("drizzle:Name");
|
|
5460
5461
|
//#endregion
|
|
5461
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5462
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/table.js
|
|
5462
5463
|
/** @internal */
|
|
5463
5464
|
const TableSchema = Symbol.for("drizzle:Schema");
|
|
5464
5465
|
/** @internal */
|
|
@@ -5524,7 +5525,7 @@ function getTableName(table) {
|
|
|
5524
5525
|
return table[TableName];
|
|
5525
5526
|
}
|
|
5526
5527
|
//#endregion
|
|
5527
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5528
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/subquery.js
|
|
5528
5529
|
var Subquery = class {
|
|
5529
5530
|
static [entityKind] = "Subquery";
|
|
5530
5531
|
constructor(sql, fields, alias, isWith = false, usedTables = []) {
|
|
@@ -5542,21 +5543,21 @@ var WithSubquery = class extends Subquery {
|
|
|
5542
5543
|
static [entityKind] = "WithSubquery";
|
|
5543
5544
|
};
|
|
5544
5545
|
//#endregion
|
|
5545
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5546
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/tracing-utils.js
|
|
5546
5547
|
function iife(fn, ...args) {
|
|
5547
5548
|
return fn(...args);
|
|
5548
5549
|
}
|
|
5549
5550
|
//#endregion
|
|
5550
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5551
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/tracing.js
|
|
5551
5552
|
/** @internal */
|
|
5552
5553
|
const tracer = { startActiveSpan(name, fn) {
|
|
5553
5554
|
return fn();
|
|
5554
5555
|
} };
|
|
5555
5556
|
//#endregion
|
|
5556
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5557
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/view-common.js
|
|
5557
5558
|
const ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
5558
5559
|
//#endregion
|
|
5559
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
5560
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sql/sql.js
|
|
5560
5561
|
function isSQLWrapper(value) {
|
|
5561
5562
|
return value !== null && value !== void 0 && typeof value.getSQL === "function";
|
|
5562
5563
|
}
|
|
@@ -6032,7 +6033,7 @@ Subquery.prototype.getSQL = function() {
|
|
|
6032
6033
|
return new SQL([this]);
|
|
6033
6034
|
};
|
|
6034
6035
|
//#endregion
|
|
6035
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
6036
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/codecs.js
|
|
6036
6037
|
const PG_ALIAS_TO_TYPE_MAP = {
|
|
6037
6038
|
int2: "smallint",
|
|
6038
6039
|
integer: "int",
|
|
@@ -6902,7 +6903,7 @@ const genericPgCodecs = {
|
|
|
6902
6903
|
};
|
|
6903
6904
|
const refineGenericPgCodecs = (extension) => refineCodecs(genericPgCodecs, extension);
|
|
6904
6905
|
//#endregion
|
|
6905
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
6906
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-postgres/codecs.js
|
|
6906
6907
|
const nodePgCodecs = refineGenericPgCodecs({
|
|
6907
6908
|
bigint: {
|
|
6908
6909
|
normalize: BigInt,
|
|
@@ -7012,7 +7013,7 @@ const nodePgCodecs = refineGenericPgCodecs({
|
|
|
7012
7013
|
}
|
|
7013
7014
|
});
|
|
7014
7015
|
//#endregion
|
|
7015
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7016
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/logger.js
|
|
7016
7017
|
var ConsoleLogWriter = class {
|
|
7017
7018
|
static [entityKind] = "ConsoleLogWriter";
|
|
7018
7019
|
write(message) {
|
|
@@ -7042,7 +7043,7 @@ var NoopLogger = class {
|
|
|
7042
7043
|
logQuery() {}
|
|
7043
7044
|
};
|
|
7044
7045
|
//#endregion
|
|
7045
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7046
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/cache/core/cache.js
|
|
7046
7047
|
var Cache = class {
|
|
7047
7048
|
static [entityKind] = "Cache";
|
|
7048
7049
|
};
|
|
@@ -7234,7 +7235,7 @@ async function hashQuery(sql, params) {
|
|
|
7234
7235
|
return toHex(subtle ? new Uint8Array(await subtle.digest("SHA-256", data)) : sha256(data));
|
|
7235
7236
|
}
|
|
7236
7237
|
//#endregion
|
|
7237
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7238
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/count.js
|
|
7238
7239
|
var PgCountBuilder = class PgCountBuilder extends SQL {
|
|
7239
7240
|
static [entityKind] = "PgCountBuilder";
|
|
7240
7241
|
dialect;
|
|
@@ -7261,7 +7262,7 @@ var PgCountBuilder = class PgCountBuilder extends SQL {
|
|
|
7261
7262
|
}
|
|
7262
7263
|
};
|
|
7263
7264
|
//#endregion
|
|
7264
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7265
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/utils.js
|
|
7265
7266
|
/** @internal */
|
|
7266
7267
|
function resolveNullableObjectPaths(columns, joinsNotNullableMap) {
|
|
7267
7268
|
if (!joinsNotNullableMap) return void 0;
|
|
@@ -7578,7 +7579,7 @@ function assertUnreachable(_x) {
|
|
|
7578
7579
|
throw new Error("Didn't expect to get here");
|
|
7579
7580
|
}
|
|
7580
7581
|
//#endregion
|
|
7581
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7582
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/query-promise.js
|
|
7582
7583
|
var QueryPromise = class {
|
|
7583
7584
|
static [entityKind] = "QueryPromise";
|
|
7584
7585
|
[Symbol.toStringTag] = "QueryPromise";
|
|
@@ -7599,7 +7600,7 @@ var QueryPromise = class {
|
|
|
7599
7600
|
}
|
|
7600
7601
|
};
|
|
7601
7602
|
//#endregion
|
|
7602
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7603
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/count.js
|
|
7603
7604
|
var PgAsyncCountBuilder = class extends PgCountBuilder {
|
|
7604
7605
|
static [entityKind] = "PgAsyncCountBuilder";
|
|
7605
7606
|
session;
|
|
@@ -7621,7 +7622,7 @@ var PgAsyncCountBuilder = class extends PgCountBuilder {
|
|
|
7621
7622
|
};
|
|
7622
7623
|
applyMixins(PgAsyncCountBuilder, [QueryPromise]);
|
|
7623
7624
|
//#endregion
|
|
7624
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7625
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/query.js
|
|
7625
7626
|
var RelationalQueryBuilder$1 = class {
|
|
7626
7627
|
static [entityKind] = "PgRelationalQueryBuilderV2";
|
|
7627
7628
|
constructor(schema, table, tableConfig, dialect, session, parseJson, builder = PgRelationalQuery) {
|
|
@@ -7676,7 +7677,7 @@ var PgRelationalQuery = class {
|
|
|
7676
7677
|
}
|
|
7677
7678
|
};
|
|
7678
7679
|
//#endregion
|
|
7679
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7680
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/foreign-keys.js
|
|
7680
7681
|
var ForeignKeyBuilder$1 = class {
|
|
7681
7682
|
static [entityKind] = "PgForeignKeyBuilder";
|
|
7682
7683
|
/** @internal */
|
|
@@ -7742,7 +7743,7 @@ var ForeignKey$1 = class {
|
|
|
7742
7743
|
}
|
|
7743
7744
|
};
|
|
7744
7745
|
//#endregion
|
|
7745
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
7746
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
7746
7747
|
var PgColumnBuilder = class {
|
|
7747
7748
|
static [entityKind] = "PgColumnBuilder";
|
|
7748
7749
|
foreignKeyConfigs = [];
|
|
@@ -8057,7 +8058,7 @@ var IndexedColumn = class {
|
|
|
8057
8058
|
indexConfig;
|
|
8058
8059
|
};
|
|
8059
8060
|
//#endregion
|
|
8060
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8061
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/int.common.js
|
|
8061
8062
|
var PgIntColumnBuilder = class extends PgColumnBuilder {
|
|
8062
8063
|
static [entityKind] = "PgIntColumnBaseBuilder";
|
|
8063
8064
|
/**
|
|
@@ -8096,7 +8097,7 @@ var PgIntColumnBuilder = class extends PgColumnBuilder {
|
|
|
8096
8097
|
}
|
|
8097
8098
|
};
|
|
8098
8099
|
//#endregion
|
|
8099
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8100
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/bigint.js
|
|
8100
8101
|
var PgBigInt53Builder = class extends PgIntColumnBuilder {
|
|
8101
8102
|
static [entityKind] = "PgBigInt53Builder";
|
|
8102
8103
|
constructor(name) {
|
|
@@ -8158,7 +8159,7 @@ function bigint(a, b) {
|
|
|
8158
8159
|
return new PgBigInt64Builder(name);
|
|
8159
8160
|
}
|
|
8160
8161
|
//#endregion
|
|
8161
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8162
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/bigserial.js
|
|
8162
8163
|
var PgBigSerial53Builder = class extends PgColumnBuilder {
|
|
8163
8164
|
static [entityKind] = "PgBigSerial53Builder";
|
|
8164
8165
|
constructor(name) {
|
|
@@ -8205,7 +8206,7 @@ function bigserial(a, b) {
|
|
|
8205
8206
|
return new PgBigSerial64Builder(name);
|
|
8206
8207
|
}
|
|
8207
8208
|
//#endregion
|
|
8208
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8209
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/boolean.js
|
|
8209
8210
|
var PgBooleanBuilder = class extends PgColumnBuilder {
|
|
8210
8211
|
static [entityKind] = "PgBooleanBuilder";
|
|
8211
8212
|
constructor(name) {
|
|
@@ -8228,7 +8229,7 @@ function boolean(name) {
|
|
|
8228
8229
|
return new PgBooleanBuilder(name ?? "");
|
|
8229
8230
|
}
|
|
8230
8231
|
//#endregion
|
|
8231
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8232
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/bytea.js
|
|
8232
8233
|
var PgByteaBuilder = class extends PgColumnBuilder {
|
|
8233
8234
|
static [entityKind] = "PgByteaBuilder";
|
|
8234
8235
|
constructor(name) {
|
|
@@ -8251,7 +8252,7 @@ function bytea(name) {
|
|
|
8251
8252
|
return new PgByteaBuilder(name ?? "");
|
|
8252
8253
|
}
|
|
8253
8254
|
//#endregion
|
|
8254
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8255
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/char.js
|
|
8255
8256
|
var PgCharBuilder = class extends PgColumnBuilder {
|
|
8256
8257
|
static [entityKind] = "PgCharBuilder";
|
|
8257
8258
|
constructor(name, config) {
|
|
@@ -8285,7 +8286,7 @@ function char(a, b = {}) {
|
|
|
8285
8286
|
return new PgCharBuilder(name, config);
|
|
8286
8287
|
}
|
|
8287
8288
|
//#endregion
|
|
8288
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8289
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/cidr.js
|
|
8289
8290
|
var PgCidrBuilder = class extends PgColumnBuilder {
|
|
8290
8291
|
static [entityKind] = "PgCidrBuilder";
|
|
8291
8292
|
constructor(name) {
|
|
@@ -8308,7 +8309,7 @@ function cidr(name) {
|
|
|
8308
8309
|
return new PgCidrBuilder(name ?? "");
|
|
8309
8310
|
}
|
|
8310
8311
|
//#endregion
|
|
8311
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8312
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/custom.js
|
|
8312
8313
|
var PgCustomColumnBuilder = class extends PgColumnBuilder {
|
|
8313
8314
|
static [entityKind] = "PgCustomColumnBuilder";
|
|
8314
8315
|
constructor(name, fieldConfig, customTypeParams) {
|
|
@@ -8362,7 +8363,7 @@ function customType$1(customTypeParams) {
|
|
|
8362
8363
|
};
|
|
8363
8364
|
}
|
|
8364
8365
|
//#endregion
|
|
8365
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8366
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/date.common.js
|
|
8366
8367
|
var PgDateColumnBuilder = class extends PgColumnBuilder {
|
|
8367
8368
|
static [entityKind] = "PgDateColumnBaseBuilder";
|
|
8368
8369
|
/**
|
|
@@ -8374,7 +8375,7 @@ var PgDateColumnBuilder = class extends PgColumnBuilder {
|
|
|
8374
8375
|
}
|
|
8375
8376
|
};
|
|
8376
8377
|
//#endregion
|
|
8377
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8378
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/date.js
|
|
8378
8379
|
var PgDateBuilder = class extends PgDateColumnBuilder {
|
|
8379
8380
|
static [entityKind] = "PgDateBuilder";
|
|
8380
8381
|
constructor(name) {
|
|
@@ -8425,7 +8426,7 @@ function date(a, b) {
|
|
|
8425
8426
|
return new PgDateStringBuilder(name);
|
|
8426
8427
|
}
|
|
8427
8428
|
//#endregion
|
|
8428
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8429
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/double-precision.js
|
|
8429
8430
|
var PgDoublePrecisionBuilder = class extends PgColumnBuilder {
|
|
8430
8431
|
static [entityKind] = "PgDoublePrecisionBuilder";
|
|
8431
8432
|
constructor(name) {
|
|
@@ -8448,7 +8449,7 @@ function doublePrecision(name) {
|
|
|
8448
8449
|
return new PgDoublePrecisionBuilder(name ?? "");
|
|
8449
8450
|
}
|
|
8450
8451
|
//#endregion
|
|
8451
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8452
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/inet.js
|
|
8452
8453
|
var PgInetBuilder = class extends PgColumnBuilder {
|
|
8453
8454
|
static [entityKind] = "PgInetBuilder";
|
|
8454
8455
|
constructor(name) {
|
|
@@ -8471,7 +8472,7 @@ function inet(name) {
|
|
|
8471
8472
|
return new PgInetBuilder(name ?? "");
|
|
8472
8473
|
}
|
|
8473
8474
|
//#endregion
|
|
8474
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8475
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/integer.js
|
|
8475
8476
|
var PgIntegerBuilder = class extends PgIntColumnBuilder {
|
|
8476
8477
|
static [entityKind] = "PgIntegerBuilder";
|
|
8477
8478
|
constructor(name) {
|
|
@@ -8494,7 +8495,7 @@ function integer$1(name) {
|
|
|
8494
8495
|
return new PgIntegerBuilder(name ?? "");
|
|
8495
8496
|
}
|
|
8496
8497
|
//#endregion
|
|
8497
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8498
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/interval.js
|
|
8498
8499
|
var PgIntervalBuilder = class extends PgColumnBuilder {
|
|
8499
8500
|
static [entityKind] = "PgIntervalBuilder";
|
|
8500
8501
|
constructor(name, intervalConfig) {
|
|
@@ -8526,7 +8527,7 @@ function interval(a, b = {}) {
|
|
|
8526
8527
|
return new PgIntervalBuilder(name, config);
|
|
8527
8528
|
}
|
|
8528
8529
|
//#endregion
|
|
8529
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8530
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/json.js
|
|
8530
8531
|
var PgJsonBuilder = class extends PgColumnBuilder {
|
|
8531
8532
|
static [entityKind] = "PgJsonBuilder";
|
|
8532
8533
|
constructor(name) {
|
|
@@ -8552,7 +8553,7 @@ function json(name) {
|
|
|
8552
8553
|
return new PgJsonBuilder(name ?? "");
|
|
8553
8554
|
}
|
|
8554
8555
|
//#endregion
|
|
8555
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8556
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/jsonb.js
|
|
8556
8557
|
var PgJsonbBuilder = class extends PgColumnBuilder {
|
|
8557
8558
|
static [entityKind] = "PgJsonbBuilder";
|
|
8558
8559
|
constructor(name) {
|
|
@@ -8578,7 +8579,7 @@ function jsonb(name) {
|
|
|
8578
8579
|
return new PgJsonbBuilder(name ?? "");
|
|
8579
8580
|
}
|
|
8580
8581
|
//#endregion
|
|
8581
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8582
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/line.js
|
|
8582
8583
|
var PgLineBuilder = class extends PgColumnBuilder {
|
|
8583
8584
|
static [entityKind] = "PgLineBuilder";
|
|
8584
8585
|
constructor(name) {
|
|
@@ -8629,7 +8630,7 @@ function line(a, b) {
|
|
|
8629
8630
|
return new PgLineABCBuilder(name);
|
|
8630
8631
|
}
|
|
8631
8632
|
//#endregion
|
|
8632
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8633
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/macaddr.js
|
|
8633
8634
|
var PgMacaddrBuilder = class extends PgColumnBuilder {
|
|
8634
8635
|
static [entityKind] = "PgMacaddrBuilder";
|
|
8635
8636
|
constructor(name) {
|
|
@@ -8652,7 +8653,7 @@ function macaddr(name) {
|
|
|
8652
8653
|
return new PgMacaddrBuilder(name ?? "");
|
|
8653
8654
|
}
|
|
8654
8655
|
//#endregion
|
|
8655
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8656
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/macaddr8.js
|
|
8656
8657
|
var PgMacaddr8Builder = class extends PgColumnBuilder {
|
|
8657
8658
|
static [entityKind] = "PgMacaddr8Builder";
|
|
8658
8659
|
constructor(name) {
|
|
@@ -8675,7 +8676,7 @@ function macaddr8(name) {
|
|
|
8675
8676
|
return new PgMacaddr8Builder(name ?? "");
|
|
8676
8677
|
}
|
|
8677
8678
|
//#endregion
|
|
8678
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8679
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/numeric.js
|
|
8679
8680
|
var PgNumericBuilder = class extends PgColumnBuilder {
|
|
8680
8681
|
static [entityKind] = "PgNumericBuilder";
|
|
8681
8682
|
constructor(name, precision, scale) {
|
|
@@ -8771,7 +8772,7 @@ function numeric$1(a, b) {
|
|
|
8771
8772
|
return mode === "number" ? new PgNumericNumberBuilder(name, config?.precision, config?.scale) : mode === "bigint" ? new PgNumericBigIntBuilder(name, config?.precision, config?.scale) : new PgNumericBuilder(name, config?.precision, config?.scale);
|
|
8772
8773
|
}
|
|
8773
8774
|
//#endregion
|
|
8774
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8775
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/point.js
|
|
8775
8776
|
var PgPointTupleBuilder = class extends PgColumnBuilder {
|
|
8776
8777
|
static [entityKind] = "PgPointTupleBuilder";
|
|
8777
8778
|
constructor(name) {
|
|
@@ -8822,7 +8823,7 @@ function point(a, b) {
|
|
|
8822
8823
|
return new PgPointObjectBuilder(name);
|
|
8823
8824
|
}
|
|
8824
8825
|
//#endregion
|
|
8825
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8826
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/postgis_extension/geometry.js
|
|
8826
8827
|
var PgGeometryBuilder = class extends PgColumnBuilder {
|
|
8827
8828
|
static [entityKind] = "PgGeometryBuilder";
|
|
8828
8829
|
constructor(name, srid) {
|
|
@@ -8877,7 +8878,7 @@ function geometry(a, b) {
|
|
|
8877
8878
|
return new PgGeometryObjectBuilder(name, config?.srid);
|
|
8878
8879
|
}
|
|
8879
8880
|
//#endregion
|
|
8880
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8881
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/real.js
|
|
8881
8882
|
var PgRealBuilder = class extends PgColumnBuilder {
|
|
8882
8883
|
static [entityKind] = "PgRealBuilder";
|
|
8883
8884
|
constructor(name, length) {
|
|
@@ -8904,7 +8905,7 @@ function real$1(name) {
|
|
|
8904
8905
|
return new PgRealBuilder(name ?? "");
|
|
8905
8906
|
}
|
|
8906
8907
|
//#endregion
|
|
8907
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8908
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/serial.js
|
|
8908
8909
|
var PgSerialBuilder = class extends PgColumnBuilder {
|
|
8909
8910
|
static [entityKind] = "PgSerialBuilder";
|
|
8910
8911
|
constructor(name) {
|
|
@@ -8929,7 +8930,7 @@ function serial(name) {
|
|
|
8929
8930
|
return new PgSerialBuilder(name ?? "");
|
|
8930
8931
|
}
|
|
8931
8932
|
//#endregion
|
|
8932
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8933
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/smallint.js
|
|
8933
8934
|
var PgSmallIntBuilder = class extends PgIntColumnBuilder {
|
|
8934
8935
|
static [entityKind] = "PgSmallIntBuilder";
|
|
8935
8936
|
constructor(name) {
|
|
@@ -8952,7 +8953,7 @@ function smallint(name) {
|
|
|
8952
8953
|
return new PgSmallIntBuilder(name ?? "");
|
|
8953
8954
|
}
|
|
8954
8955
|
//#endregion
|
|
8955
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8956
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/smallserial.js
|
|
8956
8957
|
var PgSmallSerialBuilder = class extends PgColumnBuilder {
|
|
8957
8958
|
static [entityKind] = "PgSmallSerialBuilder";
|
|
8958
8959
|
constructor(name) {
|
|
@@ -8977,7 +8978,7 @@ function smallserial(name) {
|
|
|
8977
8978
|
return new PgSmallSerialBuilder(name ?? "");
|
|
8978
8979
|
}
|
|
8979
8980
|
//#endregion
|
|
8980
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
8981
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/text.js
|
|
8981
8982
|
var PgTextBuilder = class extends PgColumnBuilder {
|
|
8982
8983
|
static [entityKind] = "PgTextBuilder";
|
|
8983
8984
|
constructor(name, config) {
|
|
@@ -9007,7 +9008,7 @@ function text$1(a, b = {}) {
|
|
|
9007
9008
|
return new PgTextBuilder(name, config);
|
|
9008
9009
|
}
|
|
9009
9010
|
//#endregion
|
|
9010
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9011
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/time.js
|
|
9011
9012
|
var PgTimeBuilder = class extends PgDateColumnBuilder {
|
|
9012
9013
|
static [entityKind] = "PgTimeBuilder";
|
|
9013
9014
|
constructor(name, withTimezone, precision) {
|
|
@@ -9042,7 +9043,7 @@ function time(a, b = {}) {
|
|
|
9042
9043
|
return new PgTimeBuilder(name, config.withTimezone ?? false, config.precision);
|
|
9043
9044
|
}
|
|
9044
9045
|
//#endregion
|
|
9045
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9046
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/timestamp.js
|
|
9046
9047
|
var PgTimestampBuilder = class extends PgDateColumnBuilder {
|
|
9047
9048
|
static [entityKind] = "PgTimestampBuilder";
|
|
9048
9049
|
constructor(name, withTimezone, precision) {
|
|
@@ -9113,7 +9114,7 @@ function timestamp(a, b = {}) {
|
|
|
9113
9114
|
return new PgTimestampBuilder(name, config?.withTimezone ?? false, config?.precision);
|
|
9114
9115
|
}
|
|
9115
9116
|
//#endregion
|
|
9116
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9117
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/uuid.js
|
|
9117
9118
|
var PgUUIDBuilder = class extends PgColumnBuilder {
|
|
9118
9119
|
static [entityKind] = "PgUUIDBuilder";
|
|
9119
9120
|
constructor(name) {
|
|
@@ -9142,7 +9143,7 @@ function uuid(name) {
|
|
|
9142
9143
|
return new PgUUIDBuilder(name ?? "");
|
|
9143
9144
|
}
|
|
9144
9145
|
//#endregion
|
|
9145
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9146
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/varchar.js
|
|
9146
9147
|
var PgVarcharBuilder = class extends PgColumnBuilder {
|
|
9147
9148
|
static [entityKind] = "PgVarcharBuilder";
|
|
9148
9149
|
constructor(name, config) {
|
|
@@ -9173,7 +9174,7 @@ function varchar(a, b = {}) {
|
|
|
9173
9174
|
return new PgVarcharBuilder(name, config);
|
|
9174
9175
|
}
|
|
9175
9176
|
//#endregion
|
|
9176
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9177
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/vector_extension/bit.js
|
|
9177
9178
|
var PgBinaryVectorBuilder = class extends PgColumnBuilder {
|
|
9178
9179
|
static [entityKind] = "PgBinaryVectorBuilder";
|
|
9179
9180
|
constructor(name, config) {
|
|
@@ -9199,7 +9200,7 @@ function bit(a, b) {
|
|
|
9199
9200
|
return new PgBinaryVectorBuilder(name, config);
|
|
9200
9201
|
}
|
|
9201
9202
|
//#endregion
|
|
9202
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9203
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/vector_extension/halfvec.js
|
|
9203
9204
|
var PgHalfVectorBuilder = class extends PgColumnBuilder {
|
|
9204
9205
|
static [entityKind] = "PgHalfVectorBuilder";
|
|
9205
9206
|
constructor(name, config) {
|
|
@@ -9228,7 +9229,7 @@ function halfvec(a, b) {
|
|
|
9228
9229
|
return new PgHalfVectorBuilder(name, config);
|
|
9229
9230
|
}
|
|
9230
9231
|
//#endregion
|
|
9231
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9232
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/vector_extension/sparsevec.js
|
|
9232
9233
|
var PgSparseVectorBuilder = class extends PgColumnBuilder {
|
|
9233
9234
|
static [entityKind] = "PgSparseVectorBuilder";
|
|
9234
9235
|
constructor(name, config) {
|
|
@@ -9254,7 +9255,7 @@ function sparsevec(a, b) {
|
|
|
9254
9255
|
return new PgSparseVectorBuilder(name, config);
|
|
9255
9256
|
}
|
|
9256
9257
|
//#endregion
|
|
9257
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9258
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/vector_extension/vector.js
|
|
9258
9259
|
var PgVectorBuilder = class extends PgColumnBuilder {
|
|
9259
9260
|
static [entityKind] = "PgVectorBuilder";
|
|
9260
9261
|
constructor(name, config) {
|
|
@@ -9283,7 +9284,7 @@ function vector(a, b) {
|
|
|
9283
9284
|
return new PgVectorBuilder(name, config);
|
|
9284
9285
|
}
|
|
9285
9286
|
//#endregion
|
|
9286
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9287
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/all.js
|
|
9287
9288
|
function getPgColumnBuilders() {
|
|
9288
9289
|
return {
|
|
9289
9290
|
bigint,
|
|
@@ -9322,7 +9323,7 @@ function getPgColumnBuilders() {
|
|
|
9322
9323
|
};
|
|
9323
9324
|
}
|
|
9324
9325
|
//#endregion
|
|
9325
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9326
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/casing.js
|
|
9326
9327
|
function toSnakeCase(input) {
|
|
9327
9328
|
return (input.replace(/['\u2019]/g, "").match(/[\da-z]+|[A-Z]+(?![a-z])|[A-Z][\da-z]+/g) ?? []).map((word) => word.toLowerCase()).join("_");
|
|
9328
9329
|
}
|
|
@@ -9337,7 +9338,7 @@ function getCasingFn(casing) {
|
|
|
9337
9338
|
return (name) => name;
|
|
9338
9339
|
}
|
|
9339
9340
|
//#endregion
|
|
9340
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9341
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/table.js
|
|
9341
9342
|
/** @internal */
|
|
9342
9343
|
const InlineForeignKeys$1 = Symbol.for("drizzle:PgInlineForeignKeys");
|
|
9343
9344
|
/** @internal */
|
|
@@ -9398,7 +9399,7 @@ function pgTableWithCasing(casing) {
|
|
|
9398
9399
|
}
|
|
9399
9400
|
const pgTable = pgTableWithCasing(void 0);
|
|
9400
9401
|
//#endregion
|
|
9401
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9402
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
9402
9403
|
function unique$2(name) {
|
|
9403
9404
|
return new UniqueOnConstraintBuilder$1(name);
|
|
9404
9405
|
}
|
|
@@ -9453,7 +9454,7 @@ var UniqueConstraint$1 = class {
|
|
|
9453
9454
|
}
|
|
9454
9455
|
};
|
|
9455
9456
|
//#endregion
|
|
9456
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9457
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/checks.js
|
|
9457
9458
|
var CheckBuilder$1 = class {
|
|
9458
9459
|
static [entityKind] = "PgCheckBuilder";
|
|
9459
9460
|
brand;
|
|
@@ -9480,7 +9481,7 @@ function check$1(name, value) {
|
|
|
9480
9481
|
return new CheckBuilder$1(name, value);
|
|
9481
9482
|
}
|
|
9482
9483
|
//#endregion
|
|
9483
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9484
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/indexes.js
|
|
9484
9485
|
var IndexBuilderOn$1 = class {
|
|
9485
9486
|
static [entityKind] = "PgIndexBuilderOn";
|
|
9486
9487
|
constructor(unique, name) {
|
|
@@ -9581,11 +9582,11 @@ function index$1(name) {
|
|
|
9581
9582
|
return new IndexBuilderOn$1(false, name);
|
|
9582
9583
|
}
|
|
9583
9584
|
//#endregion
|
|
9584
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9585
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/view-common.js
|
|
9585
9586
|
const PgViewConfig = Symbol.for("drizzle:PgViewConfig");
|
|
9586
9587
|
const PgMaterializedViewConfig = Symbol.for("drizzle:PgMaterializedViewConfig");
|
|
9587
9588
|
//#endregion
|
|
9588
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9589
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/utils.js
|
|
9589
9590
|
function extractUsedTable$1(table) {
|
|
9590
9591
|
if (is(table, PgTable)) return [table[TableSchema] ? `${table[TableSchema]}.${table[Table.Symbol.BaseName]}` : table[Table.Symbol.BaseName]];
|
|
9591
9592
|
if (is(table, Subquery)) return table._.usedTables ?? [];
|
|
@@ -9593,7 +9594,7 @@ function extractUsedTable$1(table) {
|
|
|
9593
9594
|
return [];
|
|
9594
9595
|
}
|
|
9595
9596
|
//#endregion
|
|
9596
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9597
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/alias.js
|
|
9597
9598
|
var ColumnTableAliasProxyHandler = class {
|
|
9598
9599
|
static [entityKind] = "ColumnTableAliasProxyHandler";
|
|
9599
9600
|
constructor(table, ignoreColumnAlias) {
|
|
@@ -9679,7 +9680,7 @@ function getOriginalColumnFromAlias(column) {
|
|
|
9679
9680
|
return column[OriginalColumn]();
|
|
9680
9681
|
}
|
|
9681
9682
|
//#endregion
|
|
9682
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9683
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/selection-proxy.js
|
|
9683
9684
|
var SelectionProxyHandler = class SelectionProxyHandler {
|
|
9684
9685
|
static [entityKind] = "SelectionProxyHandler";
|
|
9685
9686
|
config;
|
|
@@ -9717,7 +9718,7 @@ var SelectionProxyHandler = class SelectionProxyHandler {
|
|
|
9717
9718
|
}
|
|
9718
9719
|
};
|
|
9719
9720
|
//#endregion
|
|
9720
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9721
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/delete.js
|
|
9721
9722
|
var PgDeleteBase = class {
|
|
9722
9723
|
static [entityKind] = "PgDelete";
|
|
9723
9724
|
config;
|
|
@@ -9798,7 +9799,7 @@ var PgDeleteBase = class {
|
|
|
9798
9799
|
}
|
|
9799
9800
|
};
|
|
9800
9801
|
//#endregion
|
|
9801
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9802
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/delete.js
|
|
9802
9803
|
var PgAsyncDeleteBase = class extends PgDeleteBase {
|
|
9803
9804
|
static [entityKind] = "PgAsyncDelete";
|
|
9804
9805
|
/** @internal */
|
|
@@ -9829,7 +9830,7 @@ var PgAsyncDeleteBase = class extends PgDeleteBase {
|
|
|
9829
9830
|
};
|
|
9830
9831
|
applyMixins(PgAsyncDeleteBase, [QueryPromise]);
|
|
9831
9832
|
//#endregion
|
|
9832
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9833
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/query-builders/query-builder.js
|
|
9833
9834
|
var TypedQueryBuilder = class {
|
|
9834
9835
|
static [entityKind] = "TypedQueryBuilder";
|
|
9835
9836
|
/** @internal */
|
|
@@ -9842,12 +9843,12 @@ var TypedQueryBuilder = class {
|
|
|
9842
9843
|
}
|
|
9843
9844
|
};
|
|
9844
9845
|
//#endregion
|
|
9845
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9846
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/view-base.js
|
|
9846
9847
|
var PgViewBase = class extends View {
|
|
9847
9848
|
static [entityKind] = "PgViewBase";
|
|
9848
9849
|
};
|
|
9849
9850
|
//#endregion
|
|
9850
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
9851
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/select.js
|
|
9851
9852
|
var PgSelectBuilder = class {
|
|
9852
9853
|
static [entityKind] = "PgSelectBuilder";
|
|
9853
9854
|
fields;
|
|
@@ -10800,7 +10801,7 @@ const except$1 = createSetOperator$1("except", false);
|
|
|
10800
10801
|
*/
|
|
10801
10802
|
const exceptAll = createSetOperator$1("except", true);
|
|
10802
10803
|
//#endregion
|
|
10803
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
10804
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/errors.js
|
|
10804
10805
|
var DrizzleError = class extends Error {
|
|
10805
10806
|
static [entityKind] = "DrizzleError";
|
|
10806
10807
|
constructor({ message, cause }) {
|
|
@@ -10829,7 +10830,7 @@ var TransactionRollbackError = class extends DrizzleError {
|
|
|
10829
10830
|
}
|
|
10830
10831
|
};
|
|
10831
10832
|
//#endregion
|
|
10832
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
10833
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
10833
10834
|
function bindIfParam(value, column) {
|
|
10834
10835
|
if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) return new Param(value, column);
|
|
10835
10836
|
return value;
|
|
@@ -11194,7 +11195,7 @@ function arrayOverlaps(column, values) {
|
|
|
11194
11195
|
return sql`${column} && ${bindIfParam(values, column)}`;
|
|
11195
11196
|
}
|
|
11196
11197
|
//#endregion
|
|
11197
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
11198
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sql/expressions/select.js
|
|
11198
11199
|
/**
|
|
11199
11200
|
* Used in sorting, this specifies that the given
|
|
11200
11201
|
* column or expression should be sorted in ascending
|
|
@@ -11236,7 +11237,7 @@ function desc(column) {
|
|
|
11236
11237
|
return sql`${column} desc`;
|
|
11237
11238
|
}
|
|
11238
11239
|
//#endregion
|
|
11239
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
11240
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/relations.js
|
|
11240
11241
|
const operators = {
|
|
11241
11242
|
and,
|
|
11242
11243
|
between,
|
|
@@ -11705,7 +11706,7 @@ function getTableAsAliasSQL(table) {
|
|
|
11705
11706
|
}
|
|
11706
11707
|
const EmptyFilter = Symbol.for("drizzle:EmptyFilter");
|
|
11707
11708
|
//#endregion
|
|
11708
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
11709
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
11709
11710
|
var PgEnumObjectColumnBuilder = class extends PgColumnBuilder {
|
|
11710
11711
|
static [entityKind] = "PgEnumObjectColumnBuilder";
|
|
11711
11712
|
constructor(name, enumInstance) {
|
|
@@ -11780,7 +11781,7 @@ function pgEnumObjectWithSchema(enumName, values, schema) {
|
|
|
11780
11781
|
return enumInstance;
|
|
11781
11782
|
}
|
|
11782
11783
|
//#endregion
|
|
11783
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
11784
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/dialect.js
|
|
11784
11785
|
var PgDialect = class {
|
|
11785
11786
|
static [entityKind] = "PgDialect";
|
|
11786
11787
|
codecs;
|
|
@@ -12298,7 +12299,7 @@ var PgDialect = class {
|
|
|
12298
12299
|
}
|
|
12299
12300
|
};
|
|
12300
12301
|
//#endregion
|
|
12301
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12302
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/query-builder.js
|
|
12302
12303
|
var QueryBuilder$1 = class {
|
|
12303
12304
|
static [entityKind] = "PgQueryBuilder";
|
|
12304
12305
|
dialect;
|
|
@@ -12381,7 +12382,7 @@ var QueryBuilder$1 = class {
|
|
|
12381
12382
|
}
|
|
12382
12383
|
};
|
|
12383
12384
|
//#endregion
|
|
12384
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12385
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/insert.js
|
|
12385
12386
|
var PgInsertBuilder = class {
|
|
12386
12387
|
static [entityKind] = "PgInsertBuilder";
|
|
12387
12388
|
constructor(table, session, dialect, withList, overridingSystemValue_, columnList, builder = PgInsertBase) {
|
|
@@ -12536,7 +12537,7 @@ var PgInsertBase = class {
|
|
|
12536
12537
|
}
|
|
12537
12538
|
};
|
|
12538
12539
|
//#endregion
|
|
12539
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12540
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/insert.js
|
|
12540
12541
|
var PgAsyncInsertBase = class extends PgInsertBase {
|
|
12541
12542
|
static [entityKind] = "PgAsyncInsert";
|
|
12542
12543
|
/** @internal */
|
|
@@ -12567,7 +12568,7 @@ var PgAsyncInsertBase = class extends PgInsertBase {
|
|
|
12567
12568
|
};
|
|
12568
12569
|
applyMixins(PgAsyncInsertBase, [QueryPromise]);
|
|
12569
12570
|
//#endregion
|
|
12570
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12571
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/query.js
|
|
12571
12572
|
var PgAsyncRelationalQuery = class extends PgRelationalQuery {
|
|
12572
12573
|
static [entityKind] = "PgAsyncRelationalQueryV2";
|
|
12573
12574
|
/** @internal */
|
|
@@ -12602,7 +12603,7 @@ var PgAsyncRelationalQuery = class extends PgRelationalQuery {
|
|
|
12602
12603
|
};
|
|
12603
12604
|
applyMixins(PgAsyncRelationalQuery, [QueryPromise]);
|
|
12604
12605
|
//#endregion
|
|
12605
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12606
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/raw.js
|
|
12606
12607
|
var PgRaw = class {
|
|
12607
12608
|
static [entityKind] = "PgRaw";
|
|
12608
12609
|
constructor(prepared, sql, query) {
|
|
@@ -12621,7 +12622,7 @@ var PgRaw = class {
|
|
|
12621
12622
|
}
|
|
12622
12623
|
};
|
|
12623
12624
|
//#endregion
|
|
12624
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12625
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/raw.js
|
|
12625
12626
|
var PgAsyncRaw = class extends PgRaw {
|
|
12626
12627
|
static [entityKind] = "PgAsyncRaw";
|
|
12627
12628
|
constructor(prepared, sql, query) {
|
|
@@ -12636,7 +12637,7 @@ var PgAsyncRaw = class extends PgRaw {
|
|
|
12636
12637
|
};
|
|
12637
12638
|
applyMixins(PgAsyncRaw, [QueryPromise]);
|
|
12638
12639
|
//#endregion
|
|
12639
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12640
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/refresh-materialized-view.js
|
|
12640
12641
|
var PgRefreshMaterializedView = class {
|
|
12641
12642
|
static [entityKind] = "PgRefreshMaterializedView";
|
|
12642
12643
|
config;
|
|
@@ -12663,7 +12664,7 @@ var PgRefreshMaterializedView = class {
|
|
|
12663
12664
|
}
|
|
12664
12665
|
};
|
|
12665
12666
|
//#endregion
|
|
12666
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12667
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/refresh-materialized-view.js
|
|
12667
12668
|
var PgAsyncRefreshMaterializedView = class extends PgRefreshMaterializedView {
|
|
12668
12669
|
static [entityKind] = "PgAsyncRefreshMaterializedView";
|
|
12669
12670
|
/** @internal */
|
|
@@ -12684,7 +12685,7 @@ var PgAsyncRefreshMaterializedView = class extends PgRefreshMaterializedView {
|
|
|
12684
12685
|
};
|
|
12685
12686
|
applyMixins(PgAsyncRefreshMaterializedView, [QueryPromise]);
|
|
12686
12687
|
//#endregion
|
|
12687
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12688
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/select.js
|
|
12688
12689
|
var PgAsyncSelectBase = class extends PgSelectBase {
|
|
12689
12690
|
static [entityKind] = "PgAsyncSelectQueryBuilder";
|
|
12690
12691
|
/** @internal */
|
|
@@ -12723,7 +12724,7 @@ var PgAsyncSelectBase = class extends PgSelectBase {
|
|
|
12723
12724
|
};
|
|
12724
12725
|
applyMixins(PgAsyncSelectBase, [QueryPromise]);
|
|
12725
12726
|
//#endregion
|
|
12726
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12727
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/query-builders/update.js
|
|
12727
12728
|
var PgUpdateBuilder = class {
|
|
12728
12729
|
static [entityKind] = "PgUpdateBuilder";
|
|
12729
12730
|
constructor(table, session, dialect, withList, builder = PgUpdateBase) {
|
|
@@ -12898,7 +12899,7 @@ var PgUpdateBase = class {
|
|
|
12898
12899
|
}
|
|
12899
12900
|
};
|
|
12900
12901
|
//#endregion
|
|
12901
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12902
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/update.js
|
|
12902
12903
|
var PgAsyncUpdateBase = class extends PgUpdateBase {
|
|
12903
12904
|
static [entityKind] = "PgAsyncUpdate";
|
|
12904
12905
|
/** @internal */
|
|
@@ -12929,7 +12930,7 @@ var PgAsyncUpdateBase = class extends PgUpdateBase {
|
|
|
12929
12930
|
};
|
|
12930
12931
|
applyMixins(PgAsyncUpdateBase, [QueryPromise]);
|
|
12931
12932
|
//#endregion
|
|
12932
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
12933
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/db.js
|
|
12933
12934
|
var PgAsyncDatabase = class {
|
|
12934
12935
|
static [entityKind] = "PgAsyncDatabase";
|
|
12935
12936
|
query;
|
|
@@ -13216,7 +13217,7 @@ var PgAsyncDatabase = class {
|
|
|
13216
13217
|
}
|
|
13217
13218
|
};
|
|
13218
13219
|
//#endregion
|
|
13219
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13220
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/session.js
|
|
13220
13221
|
var PgBasePreparedQuery = class {
|
|
13221
13222
|
static [entityKind] = "PgBasePreparedQuery";
|
|
13222
13223
|
constructor(query) {
|
|
@@ -13233,7 +13234,7 @@ var PgSession = class {
|
|
|
13233
13234
|
}
|
|
13234
13235
|
};
|
|
13235
13236
|
//#endregion
|
|
13236
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13237
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/migrator.utils.js
|
|
13237
13238
|
function formatToMillis(dateStr) {
|
|
13238
13239
|
const year = parseInt(dateStr.slice(0, 4), 10);
|
|
13239
13240
|
const month = parseInt(dateStr.slice(4, 6), 10) - 1;
|
|
@@ -13249,7 +13250,7 @@ function getMigrationsToRun(params) {
|
|
|
13249
13250
|
return localMigrations.filter((lm) => !lm.name || !dbNamesSet.has(lm.name));
|
|
13250
13251
|
}
|
|
13251
13252
|
//#endregion
|
|
13252
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13253
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/up-migrations/utils.js
|
|
13253
13254
|
const MIGRATIONS_TABLE_VERSIONS = {
|
|
13254
13255
|
sqlite: 1,
|
|
13255
13256
|
pg: 1,
|
|
@@ -13290,7 +13291,7 @@ const GET_VERSION_FOR = {
|
|
|
13290
13291
|
}
|
|
13291
13292
|
};
|
|
13292
13293
|
//#endregion
|
|
13293
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13294
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/up-migrations/pg.js
|
|
13294
13295
|
/**
|
|
13295
13296
|
* Map of upgrade functions. Each key is the version being upgraded FROM,
|
|
13296
13297
|
* and the function upgrades the table to the next version.
|
|
@@ -13368,7 +13369,7 @@ async function upgradeIfNeeded(migrationsSchema, migrationsTable, db, localMigra
|
|
|
13368
13369
|
return { newDb: false };
|
|
13369
13370
|
}
|
|
13370
13371
|
//#endregion
|
|
13371
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13372
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/async/session.js
|
|
13372
13373
|
var PgAsyncPreparedQuery = class extends PgBasePreparedQuery {
|
|
13373
13374
|
static [entityKind] = "PgAsyncPreparedQuery";
|
|
13374
13375
|
/** @internal */
|
|
@@ -13540,7 +13541,7 @@ async function migrate$2(migrations, db, config) {
|
|
|
13540
13541
|
});
|
|
13541
13542
|
}
|
|
13542
13543
|
//#endregion
|
|
13543
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13544
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/query-name-generator.js
|
|
13544
13545
|
function isBinary(value) {
|
|
13545
13546
|
if (typeof Buffer !== "undefined" && typeof Buffer.isBuffer === "function" && Buffer.isBuffer(value)) return true;
|
|
13546
13547
|
if (value instanceof ArrayBuffer) return true;
|
|
@@ -13645,7 +13646,7 @@ function preparedStatementName(sql, params = []) {
|
|
|
13645
13646
|
return encodeLeadLane(h1) + encodeLane(h2) + encodeLane(h3);
|
|
13646
13647
|
}
|
|
13647
13648
|
//#endregion
|
|
13648
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13649
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-postgres/session.js
|
|
13649
13650
|
const { Pool: Pool$1, types } = esm_default;
|
|
13650
13651
|
const noop = (val) => val;
|
|
13651
13652
|
const typeConfig = { getTypeParser: ((typeId, format) => {
|
|
@@ -13726,7 +13727,7 @@ var NodePgTransaction = class NodePgTransaction extends PgAsyncTransaction {
|
|
|
13726
13727
|
}
|
|
13727
13728
|
};
|
|
13728
13729
|
//#endregion
|
|
13729
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
13730
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-postgres/driver.js
|
|
13730
13731
|
var NodePgDatabase = class extends PgAsyncDatabase {
|
|
13731
13732
|
static [entityKind] = "NodePgDatabase";
|
|
13732
13733
|
};
|
|
@@ -14130,7 +14131,7 @@ var CompiledSessionFormatChain = class {
|
|
|
14130
14131
|
}
|
|
14131
14132
|
createStream(sourceHeader, sourceCut, output) {
|
|
14132
14133
|
let header = sourceHeader;
|
|
14133
|
-
const validatedSourceCut = sessionFormatCount(sourceCut, "Session inherited event count");
|
|
14134
|
+
const validatedSourceCut = sourceCut === void 0 ? void 0 : sessionFormatCount(sourceCut, "Session inherited event count");
|
|
14134
14135
|
let inheritedEventCount = validatedSourceCut;
|
|
14135
14136
|
const stages = [];
|
|
14136
14137
|
const plan = this.plan(header.version);
|
|
@@ -14152,11 +14153,7 @@ var CompiledSessionFormatChain = class {
|
|
|
14152
14153
|
migration,
|
|
14153
14154
|
stage
|
|
14154
14155
|
});
|
|
14155
|
-
|
|
14156
|
-
const targetCut = stage.headerInheritedEventCount;
|
|
14157
|
-
if (targetCut === void 0) throw new SessionFormatError(`${migration.name} must expose its inherited cut before the next migration`);
|
|
14158
|
-
inheritedEventCount = targetCut;
|
|
14159
|
-
}
|
|
14156
|
+
inheritedEventCount = stage.headerInheritedEventCount;
|
|
14160
14157
|
}
|
|
14161
14158
|
return new CompiledSessionFormatMigrationStream(header, validatedSourceCut, stages, output);
|
|
14162
14159
|
}
|
|
@@ -14243,7 +14240,7 @@ var CompiledSessionFormatMigrationStream = class {
|
|
|
14243
14240
|
finish() {
|
|
14244
14241
|
let inheritedEventCount = this.sourceInheritedEventCount;
|
|
14245
14242
|
for (const stage of this.stages) inheritedEventCount = stage.finish();
|
|
14246
|
-
return inheritedEventCount;
|
|
14243
|
+
return sessionFormatCount(inheritedEventCount, "finished Session inherited event count");
|
|
14247
14244
|
}
|
|
14248
14245
|
};
|
|
14249
14246
|
function throwUnsupportedRefusal(migration, error, subject = "Session") {
|
|
@@ -14348,7 +14345,7 @@ function createSessionFormatCatalog(options) {
|
|
|
14348
14345
|
const sourceCut = decoder.headerInheritedEventCount;
|
|
14349
14346
|
if (storedVersion === chain.currentVersion) return new CurrentSessionFormatRestore(decoder, sourceCut, restoreOptions.validation === "current" ? options.restoreCurrent : identityArtifact, chain.currentVersion);
|
|
14350
14347
|
const collector = new SessionFormatEventCollector();
|
|
14351
|
-
return new MigratingSessionFormatRestore(decoder, sourceCut, chain.createStream(decoder.header,
|
|
14348
|
+
return new MigratingSessionFormatRestore(decoder, sourceCut, chain.createStream(decoder.header, sourceCut, collector), collector, restoreOptions.validation === "current" ? options.restoreCurrent : options.restoreTransformedCurrent, restoreOptions.validation, storedVersion, chain.currentVersion);
|
|
14352
14349
|
}
|
|
14353
14350
|
return Object.freeze({
|
|
14354
14351
|
currentVersion: chain.currentVersion,
|
|
@@ -14444,10 +14441,6 @@ function restoreCurrentVersion(artifact, currentVersion) {
|
|
|
14444
14441
|
function identityArtifact(artifact) {
|
|
14445
14442
|
return artifact;
|
|
14446
14443
|
}
|
|
14447
|
-
function requiredHistoricalCut(version, cut) {
|
|
14448
|
-
if (cut === void 0) throw new SessionFormatError(`format v${version} decoder must expose its inherited cut before migration`);
|
|
14449
|
-
return cut;
|
|
14450
|
-
}
|
|
14451
14444
|
function malformed(targetVersion, error, storedVersion) {
|
|
14452
14445
|
return Object.freeze({
|
|
14453
14446
|
status: "malformed",
|
|
@@ -15918,6 +15911,39 @@ function assertReleasedV1Header(header) {
|
|
|
15918
15911
|
assertReleasedSessionFormatHeader(header, 1);
|
|
15919
15912
|
}
|
|
15920
15913
|
/**
|
|
15914
|
+
* Validate shared-layout surface references for one released generation.
|
|
15915
|
+
* @param record - exact event envelope.
|
|
15916
|
+
* @param seq - event position used for earlier-reference checks.
|
|
15917
|
+
* @param type - surface event type used in diagnostics.
|
|
15918
|
+
* @param assistantSources - whether this generation admits empty Assistant chunk provenance.
|
|
15919
|
+
*/
|
|
15920
|
+
function assertReleasedSurfaceMetadata(record, seq, type, assistantSources) {
|
|
15921
|
+
const sources = record["sourceEventSeqs"];
|
|
15922
|
+
if (type === "assistant/message" && sources !== void 0 && assistantSources === "forbid-assistant") throw new SessionFormatError(`assistant/message ${seq} retains obsolete chunk provenance`);
|
|
15923
|
+
if (sources !== void 0) {
|
|
15924
|
+
if (!Array.isArray(sources)) throw new SessionFormatError(`${type} ${seq} sourceEventSeqs must be an array`);
|
|
15925
|
+
const seen = /* @__PURE__ */ new Set();
|
|
15926
|
+
for (const source of sources) {
|
|
15927
|
+
const current = sessionFormatCount(source, `${type} ${seq} sourceEventSeqs member`);
|
|
15928
|
+
if (current >= seq || seen.has(current)) throw new SessionFormatError(`${type} ${seq} sourceEventSeqs must be unique earlier seqs`);
|
|
15929
|
+
seen.add(current);
|
|
15930
|
+
}
|
|
15931
|
+
if (sources.length === 0 && type !== "assistant/message") throw new SessionFormatError(`${type} ${seq} sourceEventSeqs must be non-empty`);
|
|
15932
|
+
}
|
|
15933
|
+
const operation = record["surfaceOp"];
|
|
15934
|
+
if (operation === void 0 || operation === "append") return;
|
|
15935
|
+
const replacement = releasedV0Record(operation, `${type} ${seq} surfaceOp`);
|
|
15936
|
+
assertReleasedV0Keys(replacement, [
|
|
15937
|
+
"op",
|
|
15938
|
+
"start",
|
|
15939
|
+
"end"
|
|
15940
|
+
], [], `${type} ${seq} surfaceOp`);
|
|
15941
|
+
if (replacement["op"] !== "replace") throw new SessionFormatError(`${type} ${seq} surfaceOp must replace`);
|
|
15942
|
+
const start = sessionFormatCount(replacement["start"], `${type} ${seq} surface start`);
|
|
15943
|
+
const end = sessionFormatCount(replacement["end"], `${type} ${seq} surface end`);
|
|
15944
|
+
if (start >= seq || end >= seq) throw new SessionFormatError(`${type} ${seq} has an invalid surface replacement`);
|
|
15945
|
+
}
|
|
15946
|
+
/**
|
|
15921
15947
|
* Validate one exact known payload after legacy normalization.
|
|
15922
15948
|
* @param event - known event to validate.
|
|
15923
15949
|
* @param version - payload generation controlling versioned members.
|
|
@@ -16232,7 +16258,7 @@ var ReleasedV0ToV1Stage = class {
|
|
|
16232
16258
|
constructor(input) {
|
|
16233
16259
|
this.input = input;
|
|
16234
16260
|
assertHeaderVersion(input.sourceHeader, 0);
|
|
16235
|
-
this.headerInheritedEventCount = input.sourceInheritedEventCount;
|
|
16261
|
+
this.headerInheritedEventCount = sessionFormatCount(input.sourceInheritedEventCount, "format v0 inherited event count");
|
|
16236
16262
|
}
|
|
16237
16263
|
transformEvent(event, context) {
|
|
16238
16264
|
const normalized = normalizeReleasedV0Event(event, this.input.sourceHeader.id, this.state);
|
|
@@ -16247,7 +16273,7 @@ var ReleasedV0ToV1Stage = class {
|
|
|
16247
16273
|
for (const event of run.expand()) this.transformEvent(event, context);
|
|
16248
16274
|
}
|
|
16249
16275
|
finish(_context) {
|
|
16250
|
-
return this.
|
|
16276
|
+
return this.headerInheritedEventCount;
|
|
16251
16277
|
}
|
|
16252
16278
|
};
|
|
16253
16279
|
function assertHeaderVersion(header, version) {
|
|
@@ -16287,7 +16313,7 @@ function assertSourceDeliveryMarker$1(event, input) {
|
|
|
16287
16313
|
if (event.type !== "session-log-deepseek/delivery-accepted") return;
|
|
16288
16314
|
const data = releasedV0Record(event.data, `${event.type} ${event.seq} data`);
|
|
16289
16315
|
const acceptedVersion = data["sessionFormatVersion"] ?? 0;
|
|
16290
|
-
const inherited = input.sourceHeader.parentSession !== void 0 && event.seq < input.sourceInheritedEventCount;
|
|
16316
|
+
const inherited = input.sourceHeader.parentSession !== void 0 && event.seq < sessionFormatCount(input.sourceInheritedEventCount, "format v0 inherited event count");
|
|
16291
16317
|
if (acceptedVersion === 0 && !inherited && data["sessionId"] !== input.sourceHeader.id) throw new SessionFormatError("current-generation delivery marker names the wrong Session");
|
|
16292
16318
|
}
|
|
16293
16319
|
function normalizeLegacyRetry(event, sessionId, retryIds) {
|
|
@@ -16597,7 +16623,7 @@ function legacyMessageId(sessionId, seq) {
|
|
|
16597
16623
|
function malformedLegacy(sessionId, type, seq) {
|
|
16598
16624
|
return new SessionFormatError(`session ${JSON.stringify(sessionId)} contains malformed pre-react-loop ${type} at seq ${seq}`);
|
|
16599
16625
|
}
|
|
16600
|
-
const SURFACE_TYPES$
|
|
16626
|
+
const SURFACE_TYPES$2 = /* @__PURE__ */ new Set([
|
|
16601
16627
|
"user/message",
|
|
16602
16628
|
"assistant/message",
|
|
16603
16629
|
"tool/result"
|
|
@@ -16626,7 +16652,7 @@ function assertReleasedArtifactRelationships(artifact, extensions = {}) {
|
|
|
16626
16652
|
const extensionStepEvent = extensions.stepEvents?.has(event.type) === true;
|
|
16627
16653
|
if (RELEASED_V0_EVENT_DISPOSITIONS[event.type] === void 0 && !extensionStepEvent) continue;
|
|
16628
16654
|
const data = releasedV0Record(event.data, `${event.type} ${event.seq} data`);
|
|
16629
|
-
if (SURFACE_TYPES$
|
|
16655
|
+
if (SURFACE_TYPES$2.has(event.type)) surface = applySurface(surface, event);
|
|
16630
16656
|
if ((event.type === "turn/start" || event.type === "turn/end") && openCompaction !== void 0 && !staleCompactionStarts.has(openCompaction.startSeq)) throw new SessionFormatError(`${event.type} crosses an open compaction`);
|
|
16631
16657
|
if (extensionStepEvent) {
|
|
16632
16658
|
requireOpenStep(event, data, openTurn, openStep);
|
|
@@ -16959,7 +16985,7 @@ const EVENT_REQUIRED$1 = [
|
|
|
16959
16985
|
"time",
|
|
16960
16986
|
"data"
|
|
16961
16987
|
];
|
|
16962
|
-
const SURFACE_TYPES = /* @__PURE__ */ new Set([
|
|
16988
|
+
const SURFACE_TYPES$1 = /* @__PURE__ */ new Set([
|
|
16963
16989
|
"user/message",
|
|
16964
16990
|
"assistant/message",
|
|
16965
16991
|
"tool/result"
|
|
@@ -16991,7 +17017,7 @@ function assertReleasedV2Header(header) {
|
|
|
16991
17017
|
for (const key of ["parentSession", "agentPreset"]) if (record[key] !== void 0 && typeof record[key] !== "string") throw new SessionFormatError(`format v2 header ${key} must be a string`);
|
|
16992
17018
|
if (record["origin"] !== void 0 && record["origin"] !== "subagent") throw new SessionFormatError("format v2 header origin must be \"subagent\"");
|
|
16993
17019
|
}
|
|
16994
|
-
function validateReleasedV2Artifact(artifact, mode, knownEventTypes) {
|
|
17020
|
+
function validateReleasedV2Artifact(artifact, mode, knownEventTypes, relationshipHeaderVersion = artifact.header.version) {
|
|
16995
17021
|
assertReleasedV2Header(artifact.header);
|
|
16996
17022
|
const cut = sessionFormatCount(artifact.inheritedEventCount, "format v2 inherited event count");
|
|
16997
17023
|
if (cut > artifact.events.length) throw new SessionFormatError("format v2 inherited event count exceeds its events");
|
|
@@ -17005,7 +17031,7 @@ function validateReleasedV2Artifact(artifact, mode, knownEventTypes) {
|
|
|
17005
17031
|
const installed = knownEventTypes?.has(type) === true;
|
|
17006
17032
|
const ignorableUnknown = disposition === void 0 && record["ignorable"] === true;
|
|
17007
17033
|
if (mode === "current" && disposition === void 0 && !installed && !ignorableUnknown) throw new SessionFormatUnsupportedMigrationError(`format v2 contains unknown event type ${JSON.stringify(type)} at seq ${index}`);
|
|
17008
|
-
const surface = disposition !== void 0 && SURFACE_TYPES.has(type);
|
|
17034
|
+
const surface = disposition !== void 0 && SURFACE_TYPES$1.has(type);
|
|
17009
17035
|
assertReleasedV2Keys(record, EVENT_REQUIRED$1, mode === "physical" || disposition === void 0 ? SURFACE_OPTIONAL : surface ? SURFACE_OPTIONAL : LOG_OPTIONAL, `format v2 event ${index}`);
|
|
17010
17036
|
if (record["seq"] !== index) throw new SessionFormatError(`format v2 event ${index} is not dense`);
|
|
17011
17037
|
sessionFormatSafeInteger(record["time"], `format v2 event ${index} time`);
|
|
@@ -17016,7 +17042,13 @@ function validateReleasedV2Artifact(artifact, mode, knownEventTypes) {
|
|
|
17016
17042
|
}
|
|
17017
17043
|
if (artifact.header.isSeeded && lastInheritedMarker !== cut) throw new SessionFormatError("format v2 seeded header disagrees with its last inherited end-seed marker");
|
|
17018
17044
|
if (!artifact.header.isSeeded && lastInheritedMarker !== void 0) throw new SessionFormatError("format v2 unseeded Session contains an inherited end-seed marker");
|
|
17019
|
-
if (mode === "current") assertReleasedArtifactRelationships(
|
|
17045
|
+
if (mode === "current") assertReleasedArtifactRelationships({
|
|
17046
|
+
...artifact,
|
|
17047
|
+
header: {
|
|
17048
|
+
...artifact.header,
|
|
17049
|
+
version: relationshipHeaderVersion
|
|
17050
|
+
}
|
|
17051
|
+
}, RELEASED_V2_RELATIONSHIP_EXTENSIONS);
|
|
17020
17052
|
}
|
|
17021
17053
|
/**
|
|
17022
17054
|
* Require one released-v2 value to be a JSON object.
|
|
@@ -17046,10 +17078,11 @@ function assertReleasedV2Keys(value, required, optional, label) {
|
|
|
17046
17078
|
* Restore and validate one decoded released-v2 artifact.
|
|
17047
17079
|
* @param artifact - detached vocabulary-restored artifact.
|
|
17048
17080
|
* @param knownEventTypes - event types understood by the installed current Session package.
|
|
17081
|
+
* @param relationshipHeaderVersion - logical generation whose version-sensitive relationships are checked.
|
|
17049
17082
|
* @returns the same validated artifact.
|
|
17050
17083
|
*/
|
|
17051
|
-
function restoreReleasedV2Artifact(artifact, knownEventTypes) {
|
|
17052
|
-
validateReleasedV2Artifact(artifact, "current", knownEventTypes);
|
|
17084
|
+
function restoreReleasedV2Artifact(artifact, knownEventTypes, relationshipHeaderVersion = artifact.header.version) {
|
|
17085
|
+
validateReleasedV2Artifact(artifact, "current", knownEventTypes, relationshipHeaderVersion);
|
|
17053
17086
|
return artifact;
|
|
17054
17087
|
}
|
|
17055
17088
|
const HEADER_REQUIRED = [
|
|
@@ -17292,7 +17325,7 @@ var TransformedReleasedV1ToV2Stage = class {
|
|
|
17292
17325
|
assertReleasedV1Header(input.sourceHeader);
|
|
17293
17326
|
this.state = {
|
|
17294
17327
|
sourceHeader: input.sourceHeader,
|
|
17295
|
-
sourceCut: input.sourceInheritedEventCount,
|
|
17328
|
+
sourceCut: sessionFormatCount(input.sourceInheritedEventCount, "format v1 inherited event count"),
|
|
17296
17329
|
mapping: /* @__PURE__ */ new Map(),
|
|
17297
17330
|
legacyTurns: legacyTurnState(),
|
|
17298
17331
|
pending: void 0,
|
|
@@ -17321,7 +17354,7 @@ function transformReleasedEvent(state, event, context) {
|
|
|
17321
17354
|
if (event.type === "assistant/chunk") assertChunkEnvelope(event);
|
|
17322
17355
|
if (RELEASED_V0_EVENT_DISPOSITIONS[event.type] === void 0) throw refusal(`format v1 contains unknown event type ${JSON.stringify(event.type)} at seq ${event.seq}`);
|
|
17323
17356
|
const interrupted = legacyInterruptedTurn(state.legacyTurns, event);
|
|
17324
|
-
if (event.type === "turn/start" && state.legacyTurns.openTurn !== null && interrupted === void 0) throw refusal(`turn/start ${JSON.stringify(record(event.data)["turn"])} does not close the prior turn`);
|
|
17357
|
+
if (event.type === "turn/start" && state.legacyTurns.openTurn !== null && interrupted === void 0) throw refusal(`turn/start ${JSON.stringify(record$1(event.data)["turn"])} does not close the prior turn`);
|
|
17325
17358
|
assertSourceDeliveryMarker(state, event);
|
|
17326
17359
|
observeLegacyTurn(state.legacyTurns, event);
|
|
17327
17360
|
state.lastTime = event.time;
|
|
@@ -17363,7 +17396,7 @@ function assertChunkEnvelope(event) {
|
|
|
17363
17396
|
}
|
|
17364
17397
|
function assertSourceDeliveryMarker(state, event) {
|
|
17365
17398
|
if (event.type !== "session-log-deepseek/delivery-accepted") return;
|
|
17366
|
-
const data = record(event.data);
|
|
17399
|
+
const data = record$1(event.data);
|
|
17367
17400
|
const inherited = state.sourceHeader.parentSession !== void 0 && event.seq < state.sourceCut;
|
|
17368
17401
|
if (data["sessionFormatVersion"] === 1 && !inherited && data["sessionId"] !== state.sourceHeader.id) throw refusal("current-generation delivery marker names the wrong Session");
|
|
17369
17402
|
}
|
|
@@ -17400,10 +17433,10 @@ function finishMigration(state, context) {
|
|
|
17400
17433
|
return state.targetCut;
|
|
17401
17434
|
}
|
|
17402
17435
|
function transformChunk(state, event, context) {
|
|
17403
|
-
const data = record(event.data);
|
|
17436
|
+
const data = record$1(event.data);
|
|
17404
17437
|
const turn = coordinate(data["turn"]);
|
|
17405
17438
|
const step = coordinate(data["step"]);
|
|
17406
|
-
const chunk = record(data["chunk"]);
|
|
17439
|
+
const chunk = record$1(data["chunk"]);
|
|
17407
17440
|
if (state.pending !== void 0 && (state.pending.group.terminal || state.pending.group.turn !== turn || state.pending.group.step !== step)) finishAttempt(state, context);
|
|
17408
17441
|
else if (state.pending !== void 0) flushBuffered(state, state.pending, context);
|
|
17409
17442
|
state.pending ??= {
|
|
@@ -17420,7 +17453,7 @@ function transformChunk(state, event, context) {
|
|
|
17420
17453
|
if (chunk["type"] === "finish") state.pending.group.terminal = true;
|
|
17421
17454
|
}
|
|
17422
17455
|
function transformMessage(state, event, context) {
|
|
17423
|
-
const data = record(event.data);
|
|
17456
|
+
const data = record$1(event.data);
|
|
17424
17457
|
const turn = coordinate(data["turn"]);
|
|
17425
17458
|
const step = coordinate(data["step"]);
|
|
17426
17459
|
const sources = event.sourceEventSeqs;
|
|
@@ -17500,8 +17533,8 @@ function legacyTurnState() {
|
|
|
17500
17533
|
};
|
|
17501
17534
|
}
|
|
17502
17535
|
function legacyInterruptedTurn(state, event) {
|
|
17503
|
-
if (event.type !== "turn/start" || state.openTurn === null || state.openStep !== null || coordinate(record(event.data)["turn"]) !== state.openTurn + 1 || state.previous?.type !== "agent/inbox/spliced") return void 0;
|
|
17504
|
-
const splice = record(state.previous.data);
|
|
17536
|
+
if (event.type !== "turn/start" || state.openTurn === null || state.openStep !== null || coordinate(record$1(event.data)["turn"]) !== state.openTurn + 1 || state.previous?.type !== "agent/inbox/spliced") return void 0;
|
|
17537
|
+
const splice = record$1(state.previous.data);
|
|
17505
17538
|
if (splice["target"] !== "next-turn" || !Array.isArray(splice["inserted"]) || splice["inserted"].length === 0) return;
|
|
17506
17539
|
return {
|
|
17507
17540
|
type: "turn/end",
|
|
@@ -17514,7 +17547,7 @@ function legacyInterruptedTurn(state, event) {
|
|
|
17514
17547
|
};
|
|
17515
17548
|
}
|
|
17516
17549
|
function observeLegacyTurn(state, event) {
|
|
17517
|
-
const data = record(event.data);
|
|
17550
|
+
const data = record$1(event.data);
|
|
17518
17551
|
if (event.type === "turn/start") {
|
|
17519
17552
|
state.openTurn = coordinate(data["turn"]);
|
|
17520
17553
|
state.openStep = null;
|
|
@@ -17527,8 +17560,8 @@ function observeLegacyTurn(state, event) {
|
|
|
17527
17560
|
}
|
|
17528
17561
|
function splitLegacyGoalChange(event) {
|
|
17529
17562
|
if (event.type !== "user/message") return void 0;
|
|
17530
|
-
const data = record(event.data);
|
|
17531
|
-
const source = record(data["source"]);
|
|
17563
|
+
const data = record$1(event.data);
|
|
17564
|
+
const source = record$1(data["source"]);
|
|
17532
17565
|
if (source["kind"] !== "goal" || source["change"] === void 0) return void 0;
|
|
17533
17566
|
return {
|
|
17534
17567
|
change: {
|
|
@@ -17647,7 +17680,7 @@ function streamOf(group) {
|
|
|
17647
17680
|
return group.stream.map(({ record }) => record);
|
|
17648
17681
|
}
|
|
17649
17682
|
function messageEvent(source, group) {
|
|
17650
|
-
const data = record(source.data);
|
|
17683
|
+
const data = record$1(source.data);
|
|
17651
17684
|
const { sourceEventSeqs: _sourceEventSeqs, ...event } = source;
|
|
17652
17685
|
return {
|
|
17653
17686
|
...event,
|
|
@@ -17674,7 +17707,7 @@ function remapReferences(source, targetSeq, mapping) {
|
|
|
17674
17707
|
const sources = sourceEventSeqs === void 0 ? {} : { sourceEventSeqs: mapList(numberArray(sourceEventSeqs), mapping, `${source.type} ${source.seq} sources`) };
|
|
17675
17708
|
let operation = surfaceOp;
|
|
17676
17709
|
if (surfaceOp !== void 0 && surfaceOp !== "append") {
|
|
17677
|
-
const replacement = record(surfaceOp);
|
|
17710
|
+
const replacement = record$1(surfaceOp);
|
|
17678
17711
|
operation = {
|
|
17679
17712
|
op: "replace",
|
|
17680
17713
|
start: mapOne(coordinate(replacement["start"]), mapping, `${source.type} ${source.seq} surface start`),
|
|
@@ -17690,7 +17723,7 @@ function remapReferences(source, targetSeq, mapping) {
|
|
|
17690
17723
|
};
|
|
17691
17724
|
}
|
|
17692
17725
|
function remapPayloadReferences(event, mapping) {
|
|
17693
|
-
const data = record(event.data);
|
|
17726
|
+
const data = record$1(event.data);
|
|
17694
17727
|
switch (event.type) {
|
|
17695
17728
|
case "command/done": return data["sourceEventSeq"] === void 0 ? data : {
|
|
17696
17729
|
...data,
|
|
@@ -17698,7 +17731,7 @@ function remapPayloadReferences(event, mapping) {
|
|
|
17698
17731
|
};
|
|
17699
17732
|
case "compaction/prune":
|
|
17700
17733
|
case "compaction/summary": {
|
|
17701
|
-
const range = record(data["shadowedRange"]);
|
|
17734
|
+
const range = record$1(data["shadowedRange"]);
|
|
17702
17735
|
return {
|
|
17703
17736
|
...data,
|
|
17704
17737
|
shadowedRange: {
|
|
@@ -17724,7 +17757,7 @@ function mapOne(value, mapping, label) {
|
|
|
17724
17757
|
if (mapped === void 0) throw refusal(`${label} targets consumed assistant/chunk ${value}`);
|
|
17725
17758
|
return mapped;
|
|
17726
17759
|
}
|
|
17727
|
-
function record(value) {
|
|
17760
|
+
function record$1(value) {
|
|
17728
17761
|
return value;
|
|
17729
17762
|
}
|
|
17730
17763
|
function numberArray(value) {
|
|
@@ -17737,6 +17770,860 @@ function refusal(message) {
|
|
|
17737
17770
|
return new SessionFormatUnsupportedMigrationError(message);
|
|
17738
17771
|
}
|
|
17739
17772
|
//#endregion
|
|
17773
|
+
//#region ../../vendor/deepseek-harness/packages/session/session-format-v2-to-v3/lib/index.js
|
|
17774
|
+
/** Audited V2 migration admission and V3 payload validation, independent of installed core Session types. */
|
|
17775
|
+
/** Audited surface event names; all other admitted events are log-only. */
|
|
17776
|
+
const SURFACE_TYPES = /* @__PURE__ */ new Set([
|
|
17777
|
+
"system/message",
|
|
17778
|
+
"user/message",
|
|
17779
|
+
"assistant/message",
|
|
17780
|
+
"tool/result"
|
|
17781
|
+
]);
|
|
17782
|
+
const SOURCE_KINDS = /* @__PURE__ */ new Set([
|
|
17783
|
+
"user",
|
|
17784
|
+
"plugin",
|
|
17785
|
+
"model",
|
|
17786
|
+
"tool",
|
|
17787
|
+
"agent-instructions",
|
|
17788
|
+
"session-reference",
|
|
17789
|
+
"team-message",
|
|
17790
|
+
"goal",
|
|
17791
|
+
"skill-invocation",
|
|
17792
|
+
"skill-catalog",
|
|
17793
|
+
"coordinator",
|
|
17794
|
+
"subagent-report",
|
|
17795
|
+
"subagent-settled",
|
|
17796
|
+
"webhook",
|
|
17797
|
+
"agent-message"
|
|
17798
|
+
]);
|
|
17799
|
+
/**
|
|
17800
|
+
* Require a JSON object at the durable input boundary.
|
|
17801
|
+
* @param value - decoded value.
|
|
17802
|
+
* @param label - diagnostic subject.
|
|
17803
|
+
* @returns the narrowed object.
|
|
17804
|
+
*/
|
|
17805
|
+
function record(value, label) {
|
|
17806
|
+
if (!isSessionFormatJsonObject(value)) throw new SessionFormatError(label + " must be an object");
|
|
17807
|
+
return value;
|
|
17808
|
+
}
|
|
17809
|
+
/**
|
|
17810
|
+
* Reject missing and unaudited members rather than guessing whether they contain coordinates.
|
|
17811
|
+
* @param value - decoded record.
|
|
17812
|
+
* @param required - required member names.
|
|
17813
|
+
* @param optional - additional admitted names.
|
|
17814
|
+
* @param label - diagnostic subject.
|
|
17815
|
+
*/
|
|
17816
|
+
function keys(value, required, optional, label) {
|
|
17817
|
+
const missing = required.find((key) => !Object.hasOwn(value, key));
|
|
17818
|
+
const unexpected = Object.keys(value).find((key) => !required.includes(key) && !optional.includes(key));
|
|
17819
|
+
if (missing !== void 0) throw new SessionFormatError(label + " lacks required field " + missing);
|
|
17820
|
+
if (unexpected !== void 0) throw new SessionFormatError(label + " has unexpected field " + unexpected);
|
|
17821
|
+
}
|
|
17822
|
+
/**
|
|
17823
|
+
* Validate classified payloads before migration, or native V3 system/header payloads.
|
|
17824
|
+
* @param event - decoded logical event.
|
|
17825
|
+
* @param version - source or target generation.
|
|
17826
|
+
*/
|
|
17827
|
+
function assertEvent(event, version) {
|
|
17828
|
+
if (version === 3) {
|
|
17829
|
+
assertV3Event(event);
|
|
17830
|
+
return;
|
|
17831
|
+
}
|
|
17832
|
+
const disposition = RELEASED_V2_EVENT_DISPOSITIONS[event.type];
|
|
17833
|
+
const feedback = event.type === "feedback/message-put" || event.type === "feedback/message-delete";
|
|
17834
|
+
if (disposition === void 0 && !feedback) throw new SessionFormatUnsupportedMigrationError("format v2 to v3 cannot safely transform unclassified event " + event.type);
|
|
17835
|
+
const surface = SURFACE_TYPES.has(event.type);
|
|
17836
|
+
keys(event, [
|
|
17837
|
+
"type",
|
|
17838
|
+
"seq",
|
|
17839
|
+
"time",
|
|
17840
|
+
"data"
|
|
17841
|
+
], surface ? [
|
|
17842
|
+
"ignorable",
|
|
17843
|
+
"sourceEventSeqs",
|
|
17844
|
+
"surfaceOp"
|
|
17845
|
+
] : ["ignorable"], event.type);
|
|
17846
|
+
sessionFormatCount(event.seq, "event seq");
|
|
17847
|
+
sessionFormatSafeInteger(event.time, "event time");
|
|
17848
|
+
if (event["ignorable"] !== void 0 && event["ignorable"] !== true) throw new SessionFormatError("ignorable must be true");
|
|
17849
|
+
if (surface) {
|
|
17850
|
+
assertReleasedSurfaceMetadata(event, event.seq, event.type, "forbid-assistant");
|
|
17851
|
+
if (event["surfaceOp"] === void 0) throw new SessionFormatError(event.type + " requires surfaceOp");
|
|
17852
|
+
}
|
|
17853
|
+
const data = record(event.data, event.type + " data");
|
|
17854
|
+
if (feedback) {
|
|
17855
|
+
assertFeedback(event.type, data);
|
|
17856
|
+
return;
|
|
17857
|
+
}
|
|
17858
|
+
const admitted = disposition;
|
|
17859
|
+
keys(data, admitted.required, admitted.optional, event.type + " data");
|
|
17860
|
+
assertOwnedContent(event, data);
|
|
17861
|
+
if (event.type !== "assistant/attempt") assertReleasedPayloadSemantics(event, version);
|
|
17862
|
+
if (event.type === "assistant/message" || event.type === "assistant/attempt") {
|
|
17863
|
+
for (const coordinate of ["turn", "step"]) if (sessionFormatCount(data[coordinate], coordinate) === 0) throw new SessionFormatError(coordinate + " must be positive");
|
|
17864
|
+
}
|
|
17865
|
+
if (event.type === "session/end-seed" && data["inherited"] !== void 0 && data["inherited"] !== true) throw new SessionFormatError("session/end-seed inherited must be true");
|
|
17866
|
+
if (event.type === "user/message") assertSource(data);
|
|
17867
|
+
if (event.type === "assistant/message" || event.type === "tool/result") assertSource(record(data["message"], "message"));
|
|
17868
|
+
if (event.type === "tool/result" && isSessionFormatJsonObject(data["error"]) && data["error"]["code"] === "TOOL_NOT_STARTED") {
|
|
17869
|
+
const message = record(data["message"], "tool result message");
|
|
17870
|
+
const source = record(message["source"], "tool result source");
|
|
17871
|
+
if (!isRepairIdentity(message["id"], source["callId"])) throw new SessionFormatError("TOOL_NOT_STARTED repair requires its canonical historical message id");
|
|
17872
|
+
}
|
|
17873
|
+
if (event.type === "agent/inbox/spliced" || event.type === "session/title-llm-request") {
|
|
17874
|
+
const messages = data[event.type === "agent/inbox/spliced" ? "inserted" : "messages"];
|
|
17875
|
+
for (const message of messages) assertSource(message);
|
|
17876
|
+
}
|
|
17877
|
+
}
|
|
17878
|
+
/**
|
|
17879
|
+
* Recognize stable generated repair IDs without interpreting their historical suffix as a current coordinate.
|
|
17880
|
+
* @param id - durable message identity.
|
|
17881
|
+
* @param callId - advertised tool identity.
|
|
17882
|
+
* @returns whether the identity has the canonical historical repair form.
|
|
17883
|
+
*/
|
|
17884
|
+
function isRepairIdentity(id, callId) {
|
|
17885
|
+
if (typeof callId !== "string") return false;
|
|
17886
|
+
const prefix = "interrupted-tool-result-" + callId + "-";
|
|
17887
|
+
if (typeof id !== "string" || !id.startsWith(prefix)) return false;
|
|
17888
|
+
const suffix = id.slice(prefix.length);
|
|
17889
|
+
return /^(0|[1-9]\d*)$/.test(suffix) && Number.isSafeInteger(Number(suffix));
|
|
17890
|
+
}
|
|
17891
|
+
function assertSource(message) {
|
|
17892
|
+
const source = record(message["source"], "message source");
|
|
17893
|
+
if (typeof source["kind"] !== "string" || !SOURCE_KINDS.has(source["kind"])) throw new SessionFormatUnsupportedMigrationError("cannot safely transform unclassified message source");
|
|
17894
|
+
if (source["kind"] === "agent-message") {
|
|
17895
|
+
keys(source, [
|
|
17896
|
+
"kind",
|
|
17897
|
+
"form",
|
|
17898
|
+
"senderSessionId"
|
|
17899
|
+
], [], "agent-message source");
|
|
17900
|
+
if (source["form"] !== "relay" || typeof source["senderSessionId"] !== "string" || source["senderSessionId"].length === 0) throw new SessionFormatError("agent-message source requires relay form and senderSessionId");
|
|
17901
|
+
}
|
|
17902
|
+
}
|
|
17903
|
+
const CONTENT_KINDS = /* @__PURE__ */ new Set([
|
|
17904
|
+
"text",
|
|
17905
|
+
"reasoning",
|
|
17906
|
+
"image",
|
|
17907
|
+
"file",
|
|
17908
|
+
"tool-call",
|
|
17909
|
+
"tool-result"
|
|
17910
|
+
]);
|
|
17911
|
+
function contentArray(value, label) {
|
|
17912
|
+
if (!Array.isArray(value)) throw new SessionFormatError(label + ": content must be an array");
|
|
17913
|
+
return value;
|
|
17914
|
+
}
|
|
17915
|
+
function assertOwnedContent(event, data) {
|
|
17916
|
+
const label = "format v2 " + event.type + " at seq " + String(event.seq) + " data";
|
|
17917
|
+
switch (event.type) {
|
|
17918
|
+
case "user/message":
|
|
17919
|
+
case "tool/code-dispatch":
|
|
17920
|
+
assertContentKinds(data["content"], label + ".content");
|
|
17921
|
+
break;
|
|
17922
|
+
case "assistant/message":
|
|
17923
|
+
case "tool/result":
|
|
17924
|
+
case "team/message/queued":
|
|
17925
|
+
assertContentKinds(record(data["message"], label + ".message")["content"], label + ".message.content");
|
|
17926
|
+
break;
|
|
17927
|
+
case "agent/inbox/spliced":
|
|
17928
|
+
case "session/title-llm-request": {
|
|
17929
|
+
const field = event.type === "agent/inbox/spliced" ? "inserted" : "messages";
|
|
17930
|
+
for (const [index, value] of contentArray(data[field], label + "." + field).entries()) {
|
|
17931
|
+
const path = label + "." + field + "[" + String(index) + "]";
|
|
17932
|
+
assertContentKinds(record(value, path)["content"], path + ".content");
|
|
17933
|
+
}
|
|
17934
|
+
break;
|
|
17935
|
+
}
|
|
17936
|
+
case "compaction/summary":
|
|
17937
|
+
assertContentKinds(data["summary"], label + ".summary");
|
|
17938
|
+
if (data["rawOutput"] !== void 0) assertContentKinds(data["rawOutput"], label + ".rawOutput");
|
|
17939
|
+
}
|
|
17940
|
+
if (event.type === "assistant/message" || event.type === "assistant/attempt") for (const [index, value] of contentArray(data["stream"], label + ".stream").entries()) {
|
|
17941
|
+
const path = label + ".stream[" + String(index) + "]";
|
|
17942
|
+
const entry = record(value, path);
|
|
17943
|
+
if (entry["type"] !== "chunk") continue;
|
|
17944
|
+
const chunk = record(entry["chunk"], path + ".chunk");
|
|
17945
|
+
if (chunk["type"] === "block-end") assertContentBlock(chunk["block"], path + ".chunk.block");
|
|
17946
|
+
if (chunk["type"] === "block-start") assertContentKind(chunk["blockType"], path + ".chunk.blockType");
|
|
17947
|
+
}
|
|
17948
|
+
}
|
|
17949
|
+
function assertContentKind(kind, label) {
|
|
17950
|
+
if (typeof kind !== "string" || !CONTENT_KINDS.has(kind)) throw new SessionFormatUnsupportedMigrationError(label + ": cannot safely transform unclassified message content kind " + JSON.stringify(kind));
|
|
17951
|
+
}
|
|
17952
|
+
function assertContentKinds(content, label) {
|
|
17953
|
+
for (const [index, value] of contentArray(content, label).entries()) assertContentBlock(value, label + "[" + String(index) + "]");
|
|
17954
|
+
}
|
|
17955
|
+
function assertContentBlock(value, label) {
|
|
17956
|
+
const block = record(value, label);
|
|
17957
|
+
assertContentKind(block["type"], label);
|
|
17958
|
+
if (block["type"] === "tool-result") {
|
|
17959
|
+
if (!Array.isArray(block["content"])) throw new SessionFormatError(label + ".content: invalid message content kind \"tool-result\": content must be an array");
|
|
17960
|
+
assertContentKinds(block["content"], label + ".content");
|
|
17961
|
+
}
|
|
17962
|
+
if (block["type"] === "file") {
|
|
17963
|
+
keys(block, ["type", "attachment"], [], label + " kind \"file\"");
|
|
17964
|
+
const attachment = record(block["attachment"], label + " kind \"file\" attachment");
|
|
17965
|
+
keys(attachment, [
|
|
17966
|
+
"attachmentId",
|
|
17967
|
+
"name",
|
|
17968
|
+
"bytes"
|
|
17969
|
+
], [], label + " kind \"file\" attachment");
|
|
17970
|
+
if (typeof attachment["attachmentId"] !== "string" || attachment["attachmentId"].length === 0 || typeof attachment["name"] !== "string") throw new SessionFormatError(label + " kind \"file\": file attachment requires attachmentId and name");
|
|
17971
|
+
sessionFormatCount(attachment["bytes"], label + " kind \"file\" attachment bytes");
|
|
17972
|
+
return;
|
|
17973
|
+
}
|
|
17974
|
+
const probe = {
|
|
17975
|
+
type: "user/message",
|
|
17976
|
+
seq: 0,
|
|
17977
|
+
time: 0,
|
|
17978
|
+
data: {
|
|
17979
|
+
id: "content-admission",
|
|
17980
|
+
role: "user",
|
|
17981
|
+
source: { kind: "user" },
|
|
17982
|
+
content: [block["type"] === "tool-result" ? {
|
|
17983
|
+
...block,
|
|
17984
|
+
content: []
|
|
17985
|
+
} : block]
|
|
17986
|
+
}
|
|
17987
|
+
};
|
|
17988
|
+
try {
|
|
17989
|
+
assertReleasedPayloadSemantics(probe, 2);
|
|
17990
|
+
} catch (error) {
|
|
17991
|
+
throw new SessionFormatError(label + ": invalid message content kind " + JSON.stringify(block["type"]) + ": " + String(error));
|
|
17992
|
+
}
|
|
17993
|
+
}
|
|
17994
|
+
/**
|
|
17995
|
+
* Reject V3 structural payload violations even beyond a recoverable physical-row failure.
|
|
17996
|
+
* @param value - raw physical row; ordinary rows retain the frozen decoder's recovery policy.
|
|
17997
|
+
*/
|
|
17998
|
+
function assertV3StructuralRow(value) {
|
|
17999
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return;
|
|
18000
|
+
const row = value;
|
|
18001
|
+
if (row["type"] === "request/header") {
|
|
18002
|
+
const data = record(row["data"], "request/header data");
|
|
18003
|
+
if (Object.hasOwn(record(data["header"], "request header"), "system")) throw new SessionFormatUnsupportedMigrationError("format v3 request/header rejects retired header.system");
|
|
18004
|
+
} else if (row["type"] === "system/message") {
|
|
18005
|
+
const data = record(row["data"], "system/message data");
|
|
18006
|
+
assertSystem({
|
|
18007
|
+
type: "system/message",
|
|
18008
|
+
seq: 0,
|
|
18009
|
+
time: 0,
|
|
18010
|
+
data
|
|
18011
|
+
}, data);
|
|
18012
|
+
}
|
|
18013
|
+
}
|
|
18014
|
+
function assertSystem(event, data) {
|
|
18015
|
+
keys(data, [
|
|
18016
|
+
"turn",
|
|
18017
|
+
"step",
|
|
18018
|
+
"message"
|
|
18019
|
+
], [], "system/message data");
|
|
18020
|
+
for (const coordinate of ["turn", "step"]) if (sessionFormatCount(data[coordinate], coordinate) === 0) throw new SessionFormatError(coordinate + " must be positive");
|
|
18021
|
+
const message = record(data["message"], "system message");
|
|
18022
|
+
keys(message, [
|
|
18023
|
+
"id",
|
|
18024
|
+
"role",
|
|
18025
|
+
"source",
|
|
18026
|
+
"content"
|
|
18027
|
+
], [], "system message");
|
|
18028
|
+
if (typeof message["id"] !== "string" || message["id"].length === 0 || message["role"] !== "system") throw new SessionFormatError("system message requires an id and system role");
|
|
18029
|
+
const source = record(message["source"], "system source");
|
|
18030
|
+
if (source["kind"] !== "plugin" || typeof source["plugin"] !== "string" || source["plugin"].length === 0) throw new SessionFormatError("system message requires plugin source");
|
|
18031
|
+
assertReleasedPayloadSemantics({
|
|
18032
|
+
...event,
|
|
18033
|
+
type: "user/message",
|
|
18034
|
+
data: {
|
|
18035
|
+
...message,
|
|
18036
|
+
role: "user"
|
|
18037
|
+
}
|
|
18038
|
+
}, 3);
|
|
18039
|
+
}
|
|
18040
|
+
function assertFeedback(type, data) {
|
|
18041
|
+
keys(data, type === "feedback/message-put" ? ["sessionId", "item"] : ["sessionId", "messageId"], [], type);
|
|
18042
|
+
if (typeof data["sessionId"] !== "string") throw new SessionFormatError("feedback sessionId must be a string");
|
|
18043
|
+
if (type === "feedback/message-delete") {
|
|
18044
|
+
if (typeof data["messageId"] !== "string") throw new SessionFormatError("feedback messageId must be a string");
|
|
18045
|
+
return;
|
|
18046
|
+
}
|
|
18047
|
+
const item = record(data["item"], "feedback item");
|
|
18048
|
+
keys(item, [
|
|
18049
|
+
"messageId",
|
|
18050
|
+
"rating",
|
|
18051
|
+
"version",
|
|
18052
|
+
"createdAt",
|
|
18053
|
+
"updatedAt"
|
|
18054
|
+
], ["note"], "feedback item");
|
|
18055
|
+
for (const key of ["messageId", "version"]) if (typeof item[key] !== "string") throw new SessionFormatError("feedback " + key + " must be a string");
|
|
18056
|
+
if (item["rating"] !== "positive" && item["rating"] !== "negative") throw new SessionFormatError("invalid feedback rating");
|
|
18057
|
+
if (item["note"] !== void 0 && typeof item["note"] !== "string") throw new SessionFormatError("feedback note must be a string");
|
|
18058
|
+
sessionFormatCount(item["createdAt"], "feedback createdAt");
|
|
18059
|
+
sessionFormatCount(item["updatedAt"], "feedback updatedAt");
|
|
18060
|
+
}
|
|
18061
|
+
/**
|
|
18062
|
+
* Validate one canonical V3 event without interpreting plugin-owned payloads or log relationships.
|
|
18063
|
+
* Unclassified metadata is deferred to vocabulary-aware restoration; unknown required types must not become recoverable corruption.
|
|
18064
|
+
* @param event - decoded logical event.
|
|
18065
|
+
* @param knownEventTypes - additional installed event types whose envelopes are interpreted.
|
|
18066
|
+
*/
|
|
18067
|
+
function assertV3Event(event, knownEventTypes) {
|
|
18068
|
+
const value = record(event, "format v3 event");
|
|
18069
|
+
const subject = `format v3 ${event.type} at seq ${event.seq}`;
|
|
18070
|
+
const opaque = !(!(event.type === "tool/code-dispatch-start" || event.type === "tool/code-dispatch") && (SURFACE_TYPES.has(event.type) || RELEASED_V2_EVENT_DISPOSITIONS[event.type] !== void 0 || event.type === "tool/ptc-dispatch-start" || event.type === "tool/ptc-dispatch" || event.type === "feedback/message-put" || event.type === "feedback/message-delete" || knownEventTypes?.has(event.type) === true));
|
|
18071
|
+
keys(value, [
|
|
18072
|
+
"type",
|
|
18073
|
+
"seq",
|
|
18074
|
+
"time",
|
|
18075
|
+
"data"
|
|
18076
|
+
], SURFACE_TYPES.has(event.type) || opaque ? [
|
|
18077
|
+
"ignorable",
|
|
18078
|
+
"surfaceOp",
|
|
18079
|
+
"sourceEventSeqs"
|
|
18080
|
+
] : ["ignorable"], subject);
|
|
18081
|
+
if (typeof event.type !== "string") throw new SessionFormatError(`${subject} type must be a string`);
|
|
18082
|
+
sessionFormatCount(event.seq, `${subject} seq`);
|
|
18083
|
+
sessionFormatSafeInteger(event.time, `${subject} time`);
|
|
18084
|
+
if (Object.hasOwn(value, "ignorable") && value["ignorable"] !== true) throw new SessionFormatError(`${subject} ignorable must be true when present`);
|
|
18085
|
+
if (SURFACE_TYPES.has(event.type)) {
|
|
18086
|
+
const operation = value["surfaceOp"];
|
|
18087
|
+
if (operation === void 0) throw new SessionFormatError(`${subject} requires a surfaceOp marker`);
|
|
18088
|
+
if (operation !== "append") {
|
|
18089
|
+
const replace = record(operation, `${subject} surfaceOp`);
|
|
18090
|
+
if (Object.keys(replace).length !== 3 || replace["op"] !== "replace" || !Object.hasOwn(replace, "startSeq") || !Object.hasOwn(replace, "endSeq")) throw new SessionFormatError(`${subject} requires exact replace fields op/startSeq/endSeq`);
|
|
18091
|
+
for (const key of ["startSeq", "endSeq"]) if (sessionFormatCount(replace[key], `${subject} surfaceOp ${key}`) >= event.seq) throw new SessionFormatError(`${subject} replacement endpoints must reference earlier events`);
|
|
18092
|
+
}
|
|
18093
|
+
const sources = value["sourceEventSeqs"];
|
|
18094
|
+
if (event.type === "assistant/message" && sources !== void 0) throw new SessionFormatError(`${subject} embeds its stream and cannot carry sourceEventSeqs`);
|
|
18095
|
+
if (sources !== void 0) {
|
|
18096
|
+
if (!Array.isArray(sources) || sources.length === 0) throw new SessionFormatError(`${subject} sourceEventSeqs must be a non-empty array`);
|
|
18097
|
+
const seen = /* @__PURE__ */ new Set();
|
|
18098
|
+
for (const source of sources) {
|
|
18099
|
+
const seq = sessionFormatCount(source, `${subject} sourceEventSeqs member`);
|
|
18100
|
+
if (seq >= event.seq || seen.has(seq)) throw new SessionFormatError(`${subject} sourceEventSeqs must be unique earlier seqs`);
|
|
18101
|
+
seen.add(seq);
|
|
18102
|
+
}
|
|
18103
|
+
}
|
|
18104
|
+
}
|
|
18105
|
+
assertV3StructuralRow(event);
|
|
18106
|
+
assertCanonicalPayload(event);
|
|
18107
|
+
}
|
|
18108
|
+
function assertCanonicalPayload(event) {
|
|
18109
|
+
const subject = `format v3 ${event.type} at seq ${event.seq}`;
|
|
18110
|
+
if (event.type === "request/header") {
|
|
18111
|
+
const header = record(record(event.data, `${subject} data`)["header"], `${subject} header`);
|
|
18112
|
+
if (Array.isArray(header["tools"]) && header["tools"].length === 0 || isSessionFormatJsonObject(header["adapterDefaults"]) && Object.keys(header["adapterDefaults"]).length === 0) throw new SessionFormatError(`${subject} empty optional header fields must be omitted`);
|
|
18113
|
+
}
|
|
18114
|
+
if (event.type !== "tool/result") return;
|
|
18115
|
+
const data = record(event.data, `${subject} data`);
|
|
18116
|
+
if (data["error"] === void 0) return;
|
|
18117
|
+
const content = record(data["message"], `${subject} message`)["content"];
|
|
18118
|
+
if (!Array.isArray(content) || content.length !== 1 || !isSessionFormatJsonObject(content[0]) || content[0]["type"] !== "tool-result" || content[0]["isError"] !== true) throw new SessionFormatError(`${subject} carries error metadata for a non-error tool result`);
|
|
18119
|
+
}
|
|
18120
|
+
/**
|
|
18121
|
+
* Canonicalize structurally transformed events without changing their target coordinates.
|
|
18122
|
+
* @param event - transformed event using released replacement names and target coordinates.
|
|
18123
|
+
* @returns a V3 event sharing all unchanged payloads and reference values.
|
|
18124
|
+
*/
|
|
18125
|
+
function canonicalizeTransformedEvent(event) {
|
|
18126
|
+
let target = event;
|
|
18127
|
+
const operation = event["surfaceOp"];
|
|
18128
|
+
if (operation !== void 0 && operation !== "append") {
|
|
18129
|
+
const replace = record(operation, `format v2 ${event.type} at seq ${event.seq} surfaceOp`);
|
|
18130
|
+
if (Object.keys(replace).length !== 3 || replace["op"] !== "replace" || !Object.hasOwn(replace, "start") || !Object.hasOwn(replace, "end")) throw new SessionFormatError(`format v2 ${event.type} at seq ${event.seq} requires exact replace fields op/start/end`);
|
|
18131
|
+
target = {
|
|
18132
|
+
...event,
|
|
18133
|
+
surfaceOp: {
|
|
18134
|
+
op: "replace",
|
|
18135
|
+
startSeq: sessionFormatCount(replace["start"], `format v2 ${event.type} at seq ${event.seq} replace start`),
|
|
18136
|
+
endSeq: sessionFormatCount(replace["end"], `format v2 ${event.type} at seq ${event.seq} replace end`)
|
|
18137
|
+
}
|
|
18138
|
+
};
|
|
18139
|
+
}
|
|
18140
|
+
if (event.type === "request/header") {
|
|
18141
|
+
const data = record(event.data, `format v2 request/header at seq ${event.seq} data`);
|
|
18142
|
+
const header = record(data["header"], `format v2 request/header at seq ${event.seq} header`);
|
|
18143
|
+
const empty = Object.keys(header).filter((key) => key === "tools" && Array.isArray(header[key]) && header[key].length === 0 || key === "adapterDefaults" && isSessionFormatJsonObject(header[key]) && Object.keys(header[key]).length === 0);
|
|
18144
|
+
if (empty.length > 0) {
|
|
18145
|
+
const canonical = Object.fromEntries(Object.entries(header).filter(([key]) => !empty.includes(key)));
|
|
18146
|
+
target = {
|
|
18147
|
+
...target,
|
|
18148
|
+
data: {
|
|
18149
|
+
...data,
|
|
18150
|
+
header: canonical
|
|
18151
|
+
}
|
|
18152
|
+
};
|
|
18153
|
+
}
|
|
18154
|
+
}
|
|
18155
|
+
assertV3Event(target);
|
|
18156
|
+
return target;
|
|
18157
|
+
}
|
|
18158
|
+
/** Native V3 system-head validation with a private view for frozen non-system relationships. */
|
|
18159
|
+
/**
|
|
18160
|
+
* Validate v3 logical metadata with the released-v2 fields.
|
|
18161
|
+
* @param header - decoded v3 Session header.
|
|
18162
|
+
*/
|
|
18163
|
+
function assertReleasedV3Header(header) {
|
|
18164
|
+
if (header.version !== 3) throw new SessionFormatError("expected format v3 header");
|
|
18165
|
+
assertReleasedV2Header({
|
|
18166
|
+
...header,
|
|
18167
|
+
version: 2
|
|
18168
|
+
});
|
|
18169
|
+
}
|
|
18170
|
+
/**
|
|
18171
|
+
* Validate system ownership, protected-head operations, ordinary relationships, and inherited cut.
|
|
18172
|
+
* The private relationship view never escapes; the returned artifact and its messages are unchanged.
|
|
18173
|
+
* @param artifact - detached v3 artifact.
|
|
18174
|
+
* @param knownEventTypes - event types understood by the installed Session package.
|
|
18175
|
+
* @returns the same validated artifact.
|
|
18176
|
+
*/
|
|
18177
|
+
function restoreReleasedV3Artifact(artifact, knownEventTypes) {
|
|
18178
|
+
assertReleasedV3Header(artifact.header);
|
|
18179
|
+
let step;
|
|
18180
|
+
let head;
|
|
18181
|
+
let hasSurface = false;
|
|
18182
|
+
const events = artifact.events.map((event) => {
|
|
18183
|
+
assertV3EventAdmission(event);
|
|
18184
|
+
assertV3Event(event, knownEventTypes);
|
|
18185
|
+
const system = event.type === "system/message";
|
|
18186
|
+
if (event.type === "step/start") {
|
|
18187
|
+
const data = record(event.data, event.type);
|
|
18188
|
+
step = {
|
|
18189
|
+
turn: data["turn"],
|
|
18190
|
+
step: data["step"]
|
|
18191
|
+
};
|
|
18192
|
+
} else if (event.type === "step/end" || event.type === "turn/end") step = void 0;
|
|
18193
|
+
if (system) {
|
|
18194
|
+
const data = record(event.data, "system/message");
|
|
18195
|
+
if (step === void 0 || step.turn !== data["turn"] || step.step !== data["step"]) throw new SessionFormatError("system/message does not match an open step");
|
|
18196
|
+
const operation = event["surfaceOp"];
|
|
18197
|
+
if (hasSurface && head === void 0) throw new SessionFormatError("system/message requires a protected first surface head");
|
|
18198
|
+
if (operation === "append") {
|
|
18199
|
+
if (!hasSurface) head = event.seq;
|
|
18200
|
+
} else {
|
|
18201
|
+
const replace = record(operation, "system replacement");
|
|
18202
|
+
if (replace["startSeq"] === head || replace["endSeq"] === head) {
|
|
18203
|
+
if (replace["startSeq"] !== head || replace["endSeq"] !== head) throw new SessionFormatError("system/message must replace exactly the current system head");
|
|
18204
|
+
head = event.seq;
|
|
18205
|
+
}
|
|
18206
|
+
}
|
|
18207
|
+
} else if (SURFACE_TYPES.has(event.type) && event["surfaceOp"] !== "append") {
|
|
18208
|
+
const replace = record(event["surfaceOp"], "surface replacement");
|
|
18209
|
+
if (replace["startSeq"] === head || replace["endSeq"] === head) throw new SessionFormatError("surface replacement cannot shadow the protected system head");
|
|
18210
|
+
}
|
|
18211
|
+
if (event.type === "compaction/prune" || event.type === "compaction/summary") {
|
|
18212
|
+
const seqs = record(event.data, event.type)["shadowedSeqs"];
|
|
18213
|
+
if (Array.isArray(seqs) && seqs.some((seq) => seq === head)) throw new SessionFormatError("compaction cannot shadow the protected system head");
|
|
18214
|
+
}
|
|
18215
|
+
if (SURFACE_TYPES.has(event.type)) hasSurface = true;
|
|
18216
|
+
const projected = relationshipEvent(event);
|
|
18217
|
+
if (!SURFACE_TYPES.has(event.type) || event["surfaceOp"] === "append") return projected;
|
|
18218
|
+
const replacement = event["surfaceOp"];
|
|
18219
|
+
return {
|
|
18220
|
+
...projected,
|
|
18221
|
+
surfaceOp: {
|
|
18222
|
+
op: "replace",
|
|
18223
|
+
start: replacement.startSeq,
|
|
18224
|
+
end: replacement.endSeq
|
|
18225
|
+
}
|
|
18226
|
+
};
|
|
18227
|
+
});
|
|
18228
|
+
restoreReleasedV2Artifact({
|
|
18229
|
+
...artifact,
|
|
18230
|
+
header: {
|
|
18231
|
+
...artifact.header,
|
|
18232
|
+
version: 2
|
|
18233
|
+
},
|
|
18234
|
+
events
|
|
18235
|
+
}, knownEventTypes, 3);
|
|
18236
|
+
return artifact;
|
|
18237
|
+
}
|
|
18238
|
+
/**
|
|
18239
|
+
* Refuse required predecessor PTC tags without interpreting native extension payloads.
|
|
18240
|
+
* @param event - event envelope whose type and ignorable admission markers are available.
|
|
18241
|
+
*/
|
|
18242
|
+
function assertV3EventAdmission(event) {
|
|
18243
|
+
if ((event.type === "tool/code-dispatch-start" || event.type === "tool/code-dispatch") && event["ignorable"] !== true) throw new SessionFormatUnsupportedMigrationError("format v3 contains unknown event type " + JSON.stringify(event.type) + " at seq " + String(event.seq));
|
|
18244
|
+
}
|
|
18245
|
+
function relationshipEvent(event) {
|
|
18246
|
+
switch (event.type) {
|
|
18247
|
+
case "tool/ptc-dispatch-start": return {
|
|
18248
|
+
...event,
|
|
18249
|
+
type: "tool/code-dispatch-start"
|
|
18250
|
+
};
|
|
18251
|
+
case "tool/ptc-dispatch": return {
|
|
18252
|
+
...event,
|
|
18253
|
+
type: "tool/code-dispatch"
|
|
18254
|
+
};
|
|
18255
|
+
case "tool/code-dispatch-start":
|
|
18256
|
+
case "tool/code-dispatch":
|
|
18257
|
+
assertV3EventAdmission(event);
|
|
18258
|
+
return {
|
|
18259
|
+
...event,
|
|
18260
|
+
type: "v3/opaque-released-event"
|
|
18261
|
+
};
|
|
18262
|
+
}
|
|
18263
|
+
if (event.type === "system/message") {
|
|
18264
|
+
const message = record(record(event.data, "system data")["message"], "system message");
|
|
18265
|
+
return {
|
|
18266
|
+
...event,
|
|
18267
|
+
type: "user/message",
|
|
18268
|
+
data: {
|
|
18269
|
+
...message,
|
|
18270
|
+
role: "user"
|
|
18271
|
+
}
|
|
18272
|
+
};
|
|
18273
|
+
}
|
|
18274
|
+
if (event.type !== "tool/result") return event;
|
|
18275
|
+
const data = record(event.data, "tool result");
|
|
18276
|
+
if (data["error"] === void 0) return event;
|
|
18277
|
+
if (record(data["error"], "tool error")["code"] !== "TOOL_NOT_STARTED") return event;
|
|
18278
|
+
const message = record(data["message"], "tool message");
|
|
18279
|
+
const callId = record(message["source"], "tool source")["callId"];
|
|
18280
|
+
const id = message["id"];
|
|
18281
|
+
if (!isRepairIdentity(id, callId)) return event;
|
|
18282
|
+
const prefix = "interrupted-tool-result-" + callId + "-";
|
|
18283
|
+
return {
|
|
18284
|
+
...event,
|
|
18285
|
+
data: {
|
|
18286
|
+
...data,
|
|
18287
|
+
message: {
|
|
18288
|
+
...message,
|
|
18289
|
+
id: `${prefix}${event.seq}`
|
|
18290
|
+
}
|
|
18291
|
+
}
|
|
18292
|
+
};
|
|
18293
|
+
}
|
|
18294
|
+
/** V3 framing with hard structural admission and recoverable canonical event validation. */
|
|
18295
|
+
/** V3 codec validates structural rows before recovery and logical envelopes after provenance decoding. */
|
|
18296
|
+
const releasedV3SessionFormatCodec = Object.freeze({
|
|
18297
|
+
version: 3,
|
|
18298
|
+
decodeHeader(value) {
|
|
18299
|
+
return {
|
|
18300
|
+
...releasedV2SessionFormatCodec.decodeHeader(v2PhysicalHeader(value)),
|
|
18301
|
+
version: 3
|
|
18302
|
+
};
|
|
18303
|
+
},
|
|
18304
|
+
createDecoder(value, recovery) {
|
|
18305
|
+
const decoder = releasedV2SessionFormatCodec.createDecoder(v2PhysicalHeader(value), recovery);
|
|
18306
|
+
let issue;
|
|
18307
|
+
let acceptedInheritedCut;
|
|
18308
|
+
return {
|
|
18309
|
+
header: {
|
|
18310
|
+
...decoder.header,
|
|
18311
|
+
version: 3
|
|
18312
|
+
},
|
|
18313
|
+
decodeRow(row, context) {
|
|
18314
|
+
assertV3RowAdmission(row);
|
|
18315
|
+
decoder.decodeRow(row, {
|
|
18316
|
+
emitRun: context.emitRun.bind(context),
|
|
18317
|
+
emitEvent(event) {
|
|
18318
|
+
assertV3EventAdmission(event);
|
|
18319
|
+
if (issue === void 0) try {
|
|
18320
|
+
assertV3Event(event);
|
|
18321
|
+
} catch (error) {
|
|
18322
|
+
const invalid = error;
|
|
18323
|
+
if (recovery === "strict") throw invalid;
|
|
18324
|
+
issue = invalid;
|
|
18325
|
+
}
|
|
18326
|
+
if (issue !== void 0) {
|
|
18327
|
+
if (event.type === "turn/end") throw issue;
|
|
18328
|
+
return;
|
|
18329
|
+
}
|
|
18330
|
+
if (event.type === "session/end-seed" && isSessionFormatJsonObject(event.data) && event.data["inherited"] === true) acceptedInheritedCut = event.seq;
|
|
18331
|
+
context.emitEvent(event);
|
|
18332
|
+
}
|
|
18333
|
+
});
|
|
18334
|
+
},
|
|
18335
|
+
finish(context) {
|
|
18336
|
+
if (issue === void 0) return decoder.finish(context);
|
|
18337
|
+
if (decoder.header.isSeeded && acceptedInheritedCut === void 0) throw new SessionFormatError("format v3 seeded Session lacks an accepted inherited end-seed marker");
|
|
18338
|
+
if (!decoder.header.isSeeded && acceptedInheritedCut !== void 0) throw new SessionFormatError("format v3 unseeded Session contains an inherited end-seed marker");
|
|
18339
|
+
return acceptedInheritedCut ?? 0;
|
|
18340
|
+
}
|
|
18341
|
+
};
|
|
18342
|
+
},
|
|
18343
|
+
encodeHeader(header, inheritedEventCount) {
|
|
18344
|
+
assertReleasedV3Header(header);
|
|
18345
|
+
return {
|
|
18346
|
+
...releasedV2SessionFormatCodec.encodeHeader({
|
|
18347
|
+
...header,
|
|
18348
|
+
version: 2
|
|
18349
|
+
}, inheritedEventCount),
|
|
18350
|
+
version: 3
|
|
18351
|
+
};
|
|
18352
|
+
},
|
|
18353
|
+
encodeEvent(event) {
|
|
18354
|
+
assertV3EventAdmission(event);
|
|
18355
|
+
assertV3Event(event);
|
|
18356
|
+
return releasedV2SessionFormatCodec.encodeEvent(event);
|
|
18357
|
+
}
|
|
18358
|
+
});
|
|
18359
|
+
/**
|
|
18360
|
+
* Validate owned V3 admission rules before a scanner or codec can discard a recoverable tail.
|
|
18361
|
+
* This checks only identified structural payloads; physical provenance still belongs to decoding.
|
|
18362
|
+
* @param row - parsed physical row, before envelope or compressed-range decoding.
|
|
18363
|
+
*/
|
|
18364
|
+
function assertV3RowAdmission(row) {
|
|
18365
|
+
assertV3StructuralRow(row);
|
|
18366
|
+
if (typeof row === "object" && row !== null && !Array.isArray(row)) assertV3EventAdmission(row);
|
|
18367
|
+
}
|
|
18368
|
+
function v2PhysicalHeader(value) {
|
|
18369
|
+
const header = snapshotSessionFormatJson(value, "format v3 physical header");
|
|
18370
|
+
if (!isSessionFormatJsonObject(header) || header["version"] !== 3) throw new SessionFormatError("expected format v3 physical Session header");
|
|
18371
|
+
return {
|
|
18372
|
+
...header,
|
|
18373
|
+
version: 2
|
|
18374
|
+
};
|
|
18375
|
+
}
|
|
18376
|
+
/** Explicit local-coordinate remapping; captured generations and owner-local counters remain opaque. */
|
|
18377
|
+
/**
|
|
18378
|
+
* Remap only audited same-artifact references, preserving IDs and embedded model input.
|
|
18379
|
+
* @param event - validated source event.
|
|
18380
|
+
* @param seq - output event position.
|
|
18381
|
+
* @param mapping - earlier source positions mapped to output positions.
|
|
18382
|
+
* @returns the event in target coordinates.
|
|
18383
|
+
*/
|
|
18384
|
+
function remapEvent(event, seq, mapping) {
|
|
18385
|
+
const one = (value) => {
|
|
18386
|
+
const source = sessionFormatCount(value, "source event reference");
|
|
18387
|
+
const target = mapping[source];
|
|
18388
|
+
if (source >= event.seq || target === void 0) throw new SessionFormatError("reference must name an earlier source event");
|
|
18389
|
+
return target;
|
|
18390
|
+
};
|
|
18391
|
+
const list = (value) => {
|
|
18392
|
+
if (!Array.isArray(value)) throw new SessionFormatError("sequence references must be an array");
|
|
18393
|
+
return value.map(one);
|
|
18394
|
+
};
|
|
18395
|
+
const range = (value) => {
|
|
18396
|
+
const source = record(value, "sequence range");
|
|
18397
|
+
return {
|
|
18398
|
+
...source,
|
|
18399
|
+
start: one(source["start"]),
|
|
18400
|
+
end: one(source["end"])
|
|
18401
|
+
};
|
|
18402
|
+
};
|
|
18403
|
+
let data = record(event.data, event.type);
|
|
18404
|
+
switch (event.type) {
|
|
18405
|
+
case "command/done":
|
|
18406
|
+
if (data["sourceEventSeq"] !== void 0) data = {
|
|
18407
|
+
...data,
|
|
18408
|
+
sourceEventSeq: one(data["sourceEventSeq"])
|
|
18409
|
+
};
|
|
18410
|
+
break;
|
|
18411
|
+
case "compaction/summary":
|
|
18412
|
+
case "compaction/prune":
|
|
18413
|
+
data = {
|
|
18414
|
+
...data,
|
|
18415
|
+
shadowedRange: range(data["shadowedRange"]),
|
|
18416
|
+
shadowedSeqs: list(data["shadowedSeqs"])
|
|
18417
|
+
};
|
|
18418
|
+
break;
|
|
18419
|
+
case "session/title":
|
|
18420
|
+
case "session/title-llm-request": data = {
|
|
18421
|
+
...data,
|
|
18422
|
+
messageSeqs: list(data["messageSeqs"])
|
|
18423
|
+
};
|
|
18424
|
+
}
|
|
18425
|
+
return {
|
|
18426
|
+
...event,
|
|
18427
|
+
seq,
|
|
18428
|
+
data,
|
|
18429
|
+
...event["sourceEventSeqs"] === void 0 ? {} : { sourceEventSeqs: list(event["sourceEventSeqs"]) },
|
|
18430
|
+
...event["surfaceOp"] === void 0 || event["surfaceOp"] === "append" ? {} : { surfaceOp: range(event["surfaceOp"]) }
|
|
18431
|
+
};
|
|
18432
|
+
}
|
|
18433
|
+
/** Streaming system-prompt promotion followed by canonical V3 envelope conversion. */
|
|
18434
|
+
/** Promote system prompts, remap audited references, and canonicalize envelopes and PTC vocabulary. */
|
|
18435
|
+
const sessionFormatV2ToV3 = defineSessionFormatMigration({
|
|
18436
|
+
name: "@deepseek-ai/dsh-session-format-v2-to-v3",
|
|
18437
|
+
fromVersion: 2,
|
|
18438
|
+
toVersion: 3,
|
|
18439
|
+
migrateHeader(header) {
|
|
18440
|
+
assertReleasedV2Header(header);
|
|
18441
|
+
return {
|
|
18442
|
+
...header,
|
|
18443
|
+
version: 3,
|
|
18444
|
+
...header.agentPreset === "code" ? { agentPreset: "ptc" } : {}
|
|
18445
|
+
};
|
|
18446
|
+
},
|
|
18447
|
+
createStage(input) {
|
|
18448
|
+
return new ReleasedV2ToV3Stage(input);
|
|
18449
|
+
},
|
|
18450
|
+
validateTargetHeader: assertReleasedV3Header
|
|
18451
|
+
});
|
|
18452
|
+
var ReleasedV2ToV3Stage = class {
|
|
18453
|
+
input;
|
|
18454
|
+
headerInheritedEventCount;
|
|
18455
|
+
mapping = [];
|
|
18456
|
+
originalIds = /* @__PURE__ */ new Set();
|
|
18457
|
+
generatedIds = /* @__PURE__ */ new Set();
|
|
18458
|
+
targetSeq = 0;
|
|
18459
|
+
sourceCut;
|
|
18460
|
+
targetCut;
|
|
18461
|
+
lastForeignDeliverySeq;
|
|
18462
|
+
step;
|
|
18463
|
+
head;
|
|
18464
|
+
prompt = "";
|
|
18465
|
+
constructor(input) {
|
|
18466
|
+
this.input = input;
|
|
18467
|
+
assertReleasedV2Header(input.sourceHeader);
|
|
18468
|
+
this.sourceCut = input.sourceHeader.isSeeded ? void 0 : 0;
|
|
18469
|
+
this.targetCut = input.sourceHeader.isSeeded ? void 0 : 0;
|
|
18470
|
+
if (!input.sourceHeader.isSeeded) this.headerInheritedEventCount = 0;
|
|
18471
|
+
}
|
|
18472
|
+
transformEvent(event, context) {
|
|
18473
|
+
if (event.seq !== this.mapping.length) throw new SessionFormatError("format v2 source events must be dense");
|
|
18474
|
+
assertEvent(event, 2);
|
|
18475
|
+
this.observeMessageIds(event);
|
|
18476
|
+
let source = event;
|
|
18477
|
+
const data = record(event.data, event.type);
|
|
18478
|
+
if (event.type === "request/header") {
|
|
18479
|
+
const { system, ...header } = record(data["header"], "request header");
|
|
18480
|
+
const prompt = typeof system === "string" ? system : "";
|
|
18481
|
+
if (prompt !== this.prompt) this.emitSystem(prompt, event, context);
|
|
18482
|
+
source = {
|
|
18483
|
+
...event,
|
|
18484
|
+
data: {
|
|
18485
|
+
...data,
|
|
18486
|
+
header
|
|
18487
|
+
}
|
|
18488
|
+
};
|
|
18489
|
+
}
|
|
18490
|
+
if (SURFACE_TYPES.has(event.type) && this.head === void 0) throw new SessionFormatUnsupportedMigrationError("format v2 surface before first step cannot acquire a system head without changing chronology");
|
|
18491
|
+
if (event.type === "session/end-seed" && data["inherited"] === true) {
|
|
18492
|
+
if (!this.input.sourceHeader.isSeeded) throw new SessionFormatError("format v2 unseeded Session contains an inherited end-seed marker");
|
|
18493
|
+
this.sourceCut = event.seq;
|
|
18494
|
+
this.targetCut = this.targetSeq;
|
|
18495
|
+
}
|
|
18496
|
+
if (event.type === "session-log-deepseek/delivery-accepted") {
|
|
18497
|
+
if (data["sessionFormatVersion"] === 3) throw new SessionFormatError("format v2 delivery marker claims target format v3");
|
|
18498
|
+
if (data["sessionFormatVersion"] === 2 && data["sessionId"] !== this.input.sourceHeader.id) this.lastForeignDeliverySeq = event.seq;
|
|
18499
|
+
}
|
|
18500
|
+
const target = remapEvent(source, this.targetSeq, this.mapping);
|
|
18501
|
+
this.mapping.push(this.targetSeq++);
|
|
18502
|
+
context.emitEvent(canonicalizeTransformedEvent(renamePtcEvent(target)));
|
|
18503
|
+
if (event.type === "step/start") {
|
|
18504
|
+
this.step = {
|
|
18505
|
+
turn: data["turn"],
|
|
18506
|
+
step: data["step"]
|
|
18507
|
+
};
|
|
18508
|
+
if (this.head === void 0) this.emitSystem("", event, context);
|
|
18509
|
+
} else if (event.type === "step/end" || event.type === "turn/end") this.step = void 0;
|
|
18510
|
+
}
|
|
18511
|
+
transformRun(run, context) {
|
|
18512
|
+
for (const event of run.expand()) this.transformEvent(event, context);
|
|
18513
|
+
}
|
|
18514
|
+
finish(_context) {
|
|
18515
|
+
const cut = sessionFormatCount(this.sourceCut, "format v2 inherited end-seed marker");
|
|
18516
|
+
if (this.input.sourceInheritedEventCount !== void 0 && this.input.sourceInheritedEventCount !== cut) throw new SessionFormatError("format v2 inherited end-seed marker disagrees with its source cut");
|
|
18517
|
+
if (this.lastForeignDeliverySeq !== void 0 && (this.input.sourceHeader.parentSession === void 0 || this.lastForeignDeliverySeq >= cut)) throw new SessionFormatError("current-generation delivery marker names the wrong Session");
|
|
18518
|
+
return sessionFormatCount(this.targetCut, "format v3 inherited event count");
|
|
18519
|
+
}
|
|
18520
|
+
observeMessageIds(event) {
|
|
18521
|
+
const data = record(event.data, event.type);
|
|
18522
|
+
const messages = event.type === "user/message" ? [data] : event.type === "assistant/message" || event.type === "tool/result" ? [record(data["message"], "message")] : event.type === "agent/inbox/spliced" ? data["inserted"] : event.type === "session/title-llm-request" ? data["messages"] : [];
|
|
18523
|
+
for (const message of messages) {
|
|
18524
|
+
const id = message["id"];
|
|
18525
|
+
if (this.generatedIds.has(id)) throw new SessionFormatUnsupportedMigrationError("source message id collides with a generated system message id");
|
|
18526
|
+
this.originalIds.add(id);
|
|
18527
|
+
}
|
|
18528
|
+
}
|
|
18529
|
+
emitSystem(prompt, anchor, context) {
|
|
18530
|
+
if (this.step === void 0) throw new SessionFormatUnsupportedMigrationError("format v2 changed request prompt outside an open step cannot retain source chronology");
|
|
18531
|
+
const identity = JSON.stringify([
|
|
18532
|
+
"session-format-v2-to-v3",
|
|
18533
|
+
this.input.sourceHeader.id,
|
|
18534
|
+
anchor.seq,
|
|
18535
|
+
anchor.type
|
|
18536
|
+
]);
|
|
18537
|
+
const id = "v2-to-v3-system-" + createHash("sha256").update(identity).digest("hex");
|
|
18538
|
+
if (this.originalIds.has(id) || this.generatedIds.has(id)) throw new SessionFormatUnsupportedMigrationError("generated system message id collides with an existing message id");
|
|
18539
|
+
this.generatedIds.add(id);
|
|
18540
|
+
const seq = this.targetSeq++;
|
|
18541
|
+
context.emitEvent(canonicalizeTransformedEvent({
|
|
18542
|
+
type: "system/message",
|
|
18543
|
+
seq,
|
|
18544
|
+
time: anchor.time,
|
|
18545
|
+
data: {
|
|
18546
|
+
...this.step,
|
|
18547
|
+
message: {
|
|
18548
|
+
id,
|
|
18549
|
+
role: "system",
|
|
18550
|
+
source: {
|
|
18551
|
+
kind: "plugin",
|
|
18552
|
+
plugin: "@deepseek-ai/dsh-system-prompt"
|
|
18553
|
+
},
|
|
18554
|
+
content: prompt === "" ? [] : [{
|
|
18555
|
+
type: "text",
|
|
18556
|
+
text: prompt
|
|
18557
|
+
}]
|
|
18558
|
+
}
|
|
18559
|
+
},
|
|
18560
|
+
...this.head === void 0 ? { surfaceOp: "append" } : {
|
|
18561
|
+
surfaceOp: {
|
|
18562
|
+
op: "replace",
|
|
18563
|
+
start: this.head,
|
|
18564
|
+
end: this.head
|
|
18565
|
+
},
|
|
18566
|
+
sourceEventSeqs: [this.head]
|
|
18567
|
+
}
|
|
18568
|
+
}));
|
|
18569
|
+
this.head = seq;
|
|
18570
|
+
this.prompt = prompt;
|
|
18571
|
+
}
|
|
18572
|
+
};
|
|
18573
|
+
/** Source admission precedes renaming, so these payloads have exact audited fields. */
|
|
18574
|
+
function renamePtcEvent(event) {
|
|
18575
|
+
switch (event.type) {
|
|
18576
|
+
case "agent-preset/selected": return event.data["agentPreset"] === "code" ? {
|
|
18577
|
+
...event,
|
|
18578
|
+
data: {
|
|
18579
|
+
...event.data,
|
|
18580
|
+
agentPreset: "ptc"
|
|
18581
|
+
}
|
|
18582
|
+
} : event;
|
|
18583
|
+
case "tool/code-dispatch-start": return {
|
|
18584
|
+
...event,
|
|
18585
|
+
type: "tool/ptc-dispatch-start"
|
|
18586
|
+
};
|
|
18587
|
+
case "tool/code-dispatch": return {
|
|
18588
|
+
...event,
|
|
18589
|
+
type: "tool/ptc-dispatch"
|
|
18590
|
+
};
|
|
18591
|
+
case "user/message": {
|
|
18592
|
+
const data = renameMessageSource(event.data);
|
|
18593
|
+
return data === event.data ? event : {
|
|
18594
|
+
...event,
|
|
18595
|
+
data
|
|
18596
|
+
};
|
|
18597
|
+
}
|
|
18598
|
+
case "agent/inbox/spliced":
|
|
18599
|
+
case "session/title-llm-request": {
|
|
18600
|
+
const data = event.data;
|
|
18601
|
+
const key = event.type === "agent/inbox/spliced" ? "inserted" : "messages";
|
|
18602
|
+
const messages = data[key];
|
|
18603
|
+
const renamed = messages.map(renameMessageSource);
|
|
18604
|
+
return renamed.every((message, index) => message === messages[index]) ? event : {
|
|
18605
|
+
...event,
|
|
18606
|
+
data: {
|
|
18607
|
+
...data,
|
|
18608
|
+
[key]: renamed
|
|
18609
|
+
}
|
|
18610
|
+
};
|
|
18611
|
+
}
|
|
18612
|
+
default: return event;
|
|
18613
|
+
}
|
|
18614
|
+
}
|
|
18615
|
+
function renameMessageSource(message) {
|
|
18616
|
+
const source = message["source"];
|
|
18617
|
+
if (source["kind"] !== "plugin" || source["plugin"] !== "tools-code-mode") return message;
|
|
18618
|
+
return {
|
|
18619
|
+
...message,
|
|
18620
|
+
source: {
|
|
18621
|
+
...source,
|
|
18622
|
+
plugin: "tools-ptc"
|
|
18623
|
+
}
|
|
18624
|
+
};
|
|
18625
|
+
}
|
|
18626
|
+
//#endregion
|
|
17740
18627
|
//#region ../../vendor/deepseek-harness/packages/session/session-format-catalog/lib/index.js
|
|
17741
18628
|
/** Current installed Session validation used after vocabulary-aware format restoration. */
|
|
17742
18629
|
/**
|
|
@@ -17763,30 +18650,56 @@ function validateInstalledCurrentSessionArtifact(artifact) {
|
|
|
17763
18650
|
*/
|
|
17764
18651
|
/** Physical codec dispatch and complete adjacent chain, independent of mounted plugins. */
|
|
17765
18652
|
const sessionFormatCatalog = createSessionFormatCatalog({
|
|
17766
|
-
currentVersion:
|
|
18653
|
+
currentVersion: 3,
|
|
17767
18654
|
codecs: [
|
|
17768
18655
|
releasedV0SessionFormatCodec,
|
|
17769
18656
|
releasedV1SessionFormatCodec,
|
|
17770
|
-
releasedV2SessionFormatCodec
|
|
18657
|
+
releasedV2SessionFormatCodec,
|
|
18658
|
+
releasedV3SessionFormatCodec
|
|
18659
|
+
],
|
|
18660
|
+
currentEncoder: releasedV3SessionFormatCodec,
|
|
18661
|
+
migrations: [
|
|
18662
|
+
sessionFormatV0ToV1,
|
|
18663
|
+
sessionFormatV1ToV2,
|
|
18664
|
+
sessionFormatV2ToV3
|
|
17771
18665
|
],
|
|
17772
|
-
currentEncoder: releasedV2SessionFormatCodec,
|
|
17773
|
-
migrations: [sessionFormatV0ToV1, sessionFormatV1ToV2],
|
|
17774
18666
|
restoreCurrent(artifact) {
|
|
17775
|
-
const restored =
|
|
18667
|
+
const restored = restoreReleasedV3Artifact(artifact, KNOWN_SESSION_EVENT_TYPES);
|
|
17776
18668
|
validateInstalledCurrentSessionArtifact(restored);
|
|
17777
18669
|
return restored;
|
|
17778
18670
|
},
|
|
17779
18671
|
restoreTransformedCurrent(artifact) {
|
|
17780
|
-
return
|
|
18672
|
+
return restoreReleasedV3Artifact(artifact, KNOWN_SESSION_EVENT_TYPES);
|
|
17781
18673
|
},
|
|
17782
18674
|
restoreCurrentHeader(header) {
|
|
17783
|
-
|
|
18675
|
+
assertReleasedV3Header(header);
|
|
17784
18676
|
validateInstalledCurrentSessionHeader(header);
|
|
17785
18677
|
return header;
|
|
17786
18678
|
}
|
|
17787
18679
|
});
|
|
17788
18680
|
//#endregion
|
|
17789
18681
|
//#region ../session-rdb/src/log.ts
|
|
18682
|
+
/**
|
|
18683
|
+
* 把桥接行列里的 replace surfaceOp 归一到当前字段名。
|
|
18684
|
+
*
|
|
18685
|
+
* v2 时代落库的 JSON 用 `start`/`end`,当前格式用 `startSeq`/`endSeq`;
|
|
18686
|
+
* 混合世代回退路径直接采用存储行,必须在此归一,否则上游 v3 surface 校验
|
|
18687
|
+
* 以「invalid replace surfaceOp」拒绝整个会话。非 replace 形状原样返回,
|
|
18688
|
+
* 由读取视图修复决定降级。
|
|
18689
|
+
*/
|
|
18690
|
+
function normalizeSurfaceOp(value) {
|
|
18691
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) return value;
|
|
18692
|
+
const record = value;
|
|
18693
|
+
if (record["op"] !== "replace") return value;
|
|
18694
|
+
const startSeq = record["startSeq"] ?? record["start"];
|
|
18695
|
+
const endSeq = record["endSeq"] ?? record["end"];
|
|
18696
|
+
if (typeof startSeq !== "number" || typeof endSeq !== "number") return value;
|
|
18697
|
+
return {
|
|
18698
|
+
op: "replace",
|
|
18699
|
+
startSeq: SessionSeq$1(startSeq),
|
|
18700
|
+
endSeq: SessionSeq$1(endSeq)
|
|
18701
|
+
};
|
|
18702
|
+
}
|
|
17790
18703
|
function rowToMeta(row) {
|
|
17791
18704
|
if (!Number.isSafeInteger(row.fCreatedAt) || row.fCreatedAt < 0) throw new Error("stored session createdAt must be a non-negative safe integer");
|
|
17792
18705
|
return {
|
|
@@ -17830,7 +18743,7 @@ function sessionConflictRow(storage) {
|
|
|
17830
18743
|
};
|
|
17831
18744
|
}
|
|
17832
18745
|
function rowToEvent(row) {
|
|
17833
|
-
const surfaceOp = row.fSurfaceOp !== null ? JSON.parse(row.fSurfaceOp) : void 0;
|
|
18746
|
+
const surfaceOp = row.fSurfaceOp !== null ? normalizeSurfaceOp(JSON.parse(row.fSurfaceOp)) : void 0;
|
|
17834
18747
|
const record = JSON.parse(row.fData);
|
|
17835
18748
|
if (typeof record === "object" && record !== null && !Array.isArray(record) && typeof record["type"] === "string" && typeof record["seq"] === "number" && typeof record["time"] === "number" && "data" in record) return {
|
|
17836
18749
|
...record,
|
|
@@ -17847,6 +18760,7 @@ function rowToEvent(row) {
|
|
|
17847
18760
|
};
|
|
17848
18761
|
}
|
|
17849
18762
|
const SURFACE_EVENT_TYPES = /* @__PURE__ */ new Set([
|
|
18763
|
+
"system/message",
|
|
17850
18764
|
"user/message",
|
|
17851
18765
|
"assistant/message",
|
|
17852
18766
|
"tool/result"
|
|
@@ -17869,7 +18783,7 @@ function recomputeReplaceProvenance(events) {
|
|
|
17869
18783
|
const raw = events[i];
|
|
17870
18784
|
const op = raw.surfaceOp;
|
|
17871
18785
|
if (typeof op !== "object" || op === null || op.op !== "replace") continue;
|
|
17872
|
-
const {
|
|
18786
|
+
const { startSeq, endSeq } = op;
|
|
17873
18787
|
const metering = i > 0 ? events[i - 1] : void 0;
|
|
17874
18788
|
const meteringData = metering !== void 0 && METERING_EVENT_TYPES.has(metering.type) ? metering.data : void 0;
|
|
17875
18789
|
if (meteringData?.shadowedSeqs !== void 0) {
|
|
@@ -17877,7 +18791,7 @@ function recomputeReplaceProvenance(events) {
|
|
|
17877
18791
|
continue;
|
|
17878
18792
|
}
|
|
17879
18793
|
const refs = [];
|
|
17880
|
-
for (const candidate of events) if (candidate.seq >=
|
|
18794
|
+
for (const candidate of events) if (candidate.seq >= startSeq && candidate.seq <= endSeq && SURFACE_EVENT_TYPES.has(candidate.type)) refs.push(candidate.seq);
|
|
17881
18795
|
raw.sourceEventSeqs = refs;
|
|
17882
18796
|
}
|
|
17883
18797
|
}
|
|
@@ -17950,8 +18864,8 @@ function findSurfaceRepairs(events) {
|
|
|
17950
18864
|
continue;
|
|
17951
18865
|
}
|
|
17952
18866
|
const replace = typeof op === "object" && op !== null && !Array.isArray(op) ? op : void 0;
|
|
17953
|
-
const start = replace?.["
|
|
17954
|
-
const end = replace?.["
|
|
18867
|
+
const start = replace?.["startSeq"];
|
|
18868
|
+
const end = replace?.["endSeq"];
|
|
17955
18869
|
const shapeOk = replace !== void 0 && replace["op"] === "replace" && isEventSeqLike(start) && isEventSeqLike(end);
|
|
17956
18870
|
const startIdx = shapeOk ? nodes.indexOf(start) : -1;
|
|
17957
18871
|
let endIdx = shapeOk ? nodes.indexOf(end) : -1;
|
|
@@ -17961,6 +18875,7 @@ function findSurfaceRepairs(events) {
|
|
|
17961
18875
|
if (clamped !== void 0) endIdx = nodes.indexOf(clamped);
|
|
17962
18876
|
}
|
|
17963
18877
|
const rangeOk = shapeOk && startIdx !== -1 && endIdx !== -1 && startIdx <= endIdx;
|
|
18878
|
+
const provenanceOk = event.type !== "assistant/message";
|
|
17964
18879
|
let rewriteOk = true;
|
|
17965
18880
|
if (rangeOk && event.type === "tool/result") {
|
|
17966
18881
|
const shadowed = nodes.slice(startIdx, endIdx + 1);
|
|
@@ -17970,7 +18885,7 @@ function findSurfaceRepairs(events) {
|
|
|
17970
18885
|
rewriteOk = original?.type === "tool/result" && toolResultRewriteContentOnly(original, event);
|
|
17971
18886
|
}
|
|
17972
18887
|
}
|
|
17973
|
-
if (!rangeOk || !rewriteOk) {
|
|
18888
|
+
if (!rangeOk || !rewriteOk || !provenanceOk) {
|
|
17974
18889
|
degradeToAppend.add(event.seq);
|
|
17975
18890
|
nodes.push(event.seq);
|
|
17976
18891
|
continue;
|
|
@@ -18007,12 +18922,14 @@ function repairSurfaceOps(events) {
|
|
|
18007
18922
|
const raw = event;
|
|
18008
18923
|
const clamped = repairs.clampEnd.get(event.seq);
|
|
18009
18924
|
if (repairs.degradeToAppend.has(event.seq)) raw.surfaceOp = "append";
|
|
18010
|
-
else if (clamped !== void 0)
|
|
18011
|
-
op
|
|
18012
|
-
|
|
18013
|
-
|
|
18014
|
-
|
|
18015
|
-
|
|
18925
|
+
else if (clamped !== void 0) {
|
|
18926
|
+
const op = raw.surfaceOp;
|
|
18927
|
+
raw.surfaceOp = {
|
|
18928
|
+
op: "replace",
|
|
18929
|
+
startSeq: SessionSeq$1(op.startSeq),
|
|
18930
|
+
endSeq: SessionSeq$1(clamped)
|
|
18931
|
+
};
|
|
18932
|
+
} else if (repairs.addAppendMarker.has(event.seq)) raw.surfaceOp = "append";
|
|
18016
18933
|
else if (repairs.clearSurfaceOp.has(event.seq)) delete raw.surfaceOp;
|
|
18017
18934
|
}
|
|
18018
18935
|
}
|
|
@@ -18029,6 +18946,25 @@ function repairAssistantSettlement(events) {
|
|
|
18029
18946
|
}
|
|
18030
18947
|
}
|
|
18031
18948
|
/**
|
|
18949
|
+
* 读取时把旧格式 `request/header` 归一为当前格式:v3 起 system prompt 由
|
|
18950
|
+
* surface 上的 `system/message` 承载,header 必须省略 `system`,空 `tools` /
|
|
18951
|
+
* `adapterDefaults` 也必须省略(上游 v3 事件校验 fail loud)。混合世代回退
|
|
18952
|
+
* 视图直接采用存储行,不归一会让整个会话加载失败。system prompt 因此不再
|
|
18953
|
+
* 进入模型请求;会话下次运行由 v3 的 system/message 机制重建。
|
|
18954
|
+
*/
|
|
18955
|
+
function repairRequestHeaders(events) {
|
|
18956
|
+
for (const event of events) {
|
|
18957
|
+
if (event.type !== "request/header") continue;
|
|
18958
|
+
const header = event.data["header"];
|
|
18959
|
+
if (typeof header !== "object" || header === null || Array.isArray(header)) continue;
|
|
18960
|
+
const record = header;
|
|
18961
|
+
delete record["system"];
|
|
18962
|
+
if (Array.isArray(record["tools"]) && record["tools"].length === 0) delete record["tools"];
|
|
18963
|
+
const defaults = record["adapterDefaults"];
|
|
18964
|
+
if (typeof defaults === "object" && defaults !== null && !Array.isArray(defaults) && Object.keys(defaults).length === 0) delete record["adapterDefaults"];
|
|
18965
|
+
}
|
|
18966
|
+
}
|
|
18967
|
+
/**
|
|
18032
18968
|
* 把紧邻 replace 的 metering 事件的 `shadowedRange` / `shadowedSeqs` 对齐到
|
|
18033
18969
|
* replace 最终的稠密 range。
|
|
18034
18970
|
*
|
|
@@ -18045,22 +18981,100 @@ function syncMeteringRanges(events) {
|
|
|
18045
18981
|
if (!METERING_EVENT_TYPES.has(metering.type)) continue;
|
|
18046
18982
|
const op = events[i].surfaceOp;
|
|
18047
18983
|
if (typeof op !== "object" || op === null || op.op !== "replace") continue;
|
|
18048
|
-
const {
|
|
18984
|
+
const { startSeq, endSeq } = op;
|
|
18049
18985
|
const data = metering.data;
|
|
18050
|
-
if (data.shadowedRange?.start ===
|
|
18986
|
+
if (data.shadowedRange?.start === startSeq && data.shadowedRange.end === endSeq) continue;
|
|
18051
18987
|
data.shadowedRange = {
|
|
18052
|
-
start,
|
|
18053
|
-
end
|
|
18988
|
+
start: startSeq,
|
|
18989
|
+
end: endSeq
|
|
18054
18990
|
};
|
|
18055
|
-
data.shadowedSeqs = events.filter((candidate) => candidate.seq >=
|
|
18991
|
+
data.shadowedSeqs = events.filter((candidate) => candidate.seq >= startSeq && candidate.seq <= endSeq && SURFACE_EVENT_TYPES.has(candidate.type)).map((candidate) => candidate.seq);
|
|
18992
|
+
}
|
|
18993
|
+
}
|
|
18994
|
+
const PTC_EVENT_RENAMES = {
|
|
18995
|
+
"tool/code-dispatch-start": "tool/ptc-dispatch-start",
|
|
18996
|
+
"tool/code-dispatch": "tool/ptc-dispatch"
|
|
18997
|
+
};
|
|
18998
|
+
/** 把消息的 `tools-code-mode` 插件来源改写为 `tools-ptc`(非该来源原样返回)。 */
|
|
18999
|
+
function renamePtcMessageSource(message) {
|
|
19000
|
+
if (typeof message !== "object" || message === null || Array.isArray(message)) return message;
|
|
19001
|
+
const record = message;
|
|
19002
|
+
const source = record["source"];
|
|
19003
|
+
if (typeof source !== "object" || source === null || Array.isArray(source)) return message;
|
|
19004
|
+
const sourceRecord = source;
|
|
19005
|
+
if (sourceRecord["kind"] !== "plugin" || sourceRecord["plugin"] !== "tools-code-mode") return message;
|
|
19006
|
+
return {
|
|
19007
|
+
...record,
|
|
19008
|
+
source: {
|
|
19009
|
+
...sourceRecord,
|
|
19010
|
+
plugin: "tools-ptc"
|
|
19011
|
+
}
|
|
19012
|
+
};
|
|
19013
|
+
}
|
|
19014
|
+
/**
|
|
19015
|
+
* 读取时把 v2 时代的 PTC 词汇归一为当前词汇。
|
|
19016
|
+
*
|
|
19017
|
+
* 上游 v2→v3 迁移把 `tool/code-dispatch(-start)` 改名为
|
|
19018
|
+
* `tool/ptc-dispatch(-start)`、把 `tools-code-mode` 插件来源改名为 `tools-ptc`、
|
|
19019
|
+
* 把 agent preset 值 `code` 改名为 `ptc`。混合世代回退视图直接采用存储行,
|
|
19020
|
+
* 不重命名会被上游 v3 校验以「unknown event type」拒绝整个会话。词汇改写
|
|
19021
|
+
* 与上游迁移链的 renamePtcEvent 对齐。
|
|
19022
|
+
*/
|
|
19023
|
+
function renameLegacyPtcEvents(events) {
|
|
19024
|
+
for (let index = 0; index < events.length; index++) {
|
|
19025
|
+
const event = events[index];
|
|
19026
|
+
const renamedType = PTC_EVENT_RENAMES[event.type];
|
|
19027
|
+
if (renamedType !== void 0) {
|
|
19028
|
+
events[index] = {
|
|
19029
|
+
...event,
|
|
19030
|
+
type: renamedType
|
|
19031
|
+
};
|
|
19032
|
+
continue;
|
|
19033
|
+
}
|
|
19034
|
+
if (event.type === "agent-preset/selected") {
|
|
19035
|
+
const data = event.data;
|
|
19036
|
+
if (data["agentPreset"] === "code") events[index] = {
|
|
19037
|
+
...event,
|
|
19038
|
+
data: {
|
|
19039
|
+
...data,
|
|
19040
|
+
agentPreset: "ptc"
|
|
19041
|
+
}
|
|
19042
|
+
};
|
|
19043
|
+
continue;
|
|
19044
|
+
}
|
|
19045
|
+
if (event.type === "user/message") {
|
|
19046
|
+
const renamed = renamePtcMessageSource(event.data);
|
|
19047
|
+
if (renamed !== event.data) events[index] = {
|
|
19048
|
+
...event,
|
|
19049
|
+
data: renamed
|
|
19050
|
+
};
|
|
19051
|
+
continue;
|
|
19052
|
+
}
|
|
19053
|
+
if (event.type === "agent/inbox/spliced" || event.type === "session/title-llm-request") {
|
|
19054
|
+
const data = event.data;
|
|
19055
|
+
const key = event.type === "agent/inbox/spliced" ? "inserted" : "messages";
|
|
19056
|
+
const list = data[key];
|
|
19057
|
+
if (!Array.isArray(list)) continue;
|
|
19058
|
+
const renamed = list.map(renamePtcMessageSource);
|
|
19059
|
+
if (renamed.some((message, position) => message !== list[position])) events[index] = {
|
|
19060
|
+
...event,
|
|
19061
|
+
data: {
|
|
19062
|
+
...data,
|
|
19063
|
+
[key]: renamed
|
|
19064
|
+
}
|
|
19065
|
+
};
|
|
19066
|
+
}
|
|
18056
19067
|
}
|
|
18057
19068
|
}
|
|
18058
19069
|
/**
|
|
18059
|
-
*
|
|
18060
|
-
* provenance 重算 → 孤儿 inbox splice
|
|
19070
|
+
* 读取视图修复总入口:形状补全(结算字段 / request header)→ PTC 词汇归一
|
|
19071
|
+
* → surface 语义修复 → metering 对齐 → provenance 重算 → 孤儿 inbox splice
|
|
19072
|
+
* 改写。全部只作用于内存视图,不落库。
|
|
18061
19073
|
*/
|
|
18062
19074
|
function repairReadView(events) {
|
|
18063
19075
|
repairAssistantSettlement(events);
|
|
19076
|
+
repairRequestHeaders(events);
|
|
19077
|
+
renameLegacyPtcEvents(events);
|
|
18064
19078
|
repairSurfaceOps(events);
|
|
18065
19079
|
syncMeteringRanges(events);
|
|
18066
19080
|
recomputeReplaceProvenance(events);
|
|
@@ -18178,7 +19192,7 @@ function toJsonlArtifact(meta, inheritedEventCount, events) {
|
|
|
18178
19192
|
return lines.join("\n");
|
|
18179
19193
|
}
|
|
18180
19194
|
//#endregion
|
|
18181
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19195
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/column-builder.js
|
|
18182
19196
|
var ColumnBuilder = class {
|
|
18183
19197
|
static [entityKind] = "ColumnBuilder";
|
|
18184
19198
|
/** @internal */
|
|
@@ -18286,7 +19300,7 @@ var ColumnBuilder = class {
|
|
|
18286
19300
|
}
|
|
18287
19301
|
};
|
|
18288
19302
|
//#endregion
|
|
18289
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19303
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/unique-constraint.js
|
|
18290
19304
|
function uniqueKeyName(table, columns) {
|
|
18291
19305
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
18292
19306
|
}
|
|
@@ -18333,7 +19347,7 @@ var UniqueConstraint = class {
|
|
|
18333
19347
|
}
|
|
18334
19348
|
};
|
|
18335
19349
|
//#endregion
|
|
18336
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19350
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/checks.js
|
|
18337
19351
|
var CheckBuilder = class {
|
|
18338
19352
|
static [entityKind] = "SQLiteCheckBuilder";
|
|
18339
19353
|
brand;
|
|
@@ -18359,7 +19373,7 @@ function check(name, value) {
|
|
|
18359
19373
|
return new CheckBuilder(name, value);
|
|
18360
19374
|
}
|
|
18361
19375
|
//#endregion
|
|
18362
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19376
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
18363
19377
|
var ForeignKeyBuilder = class {
|
|
18364
19378
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
18365
19379
|
/** @internal */
|
|
@@ -18424,7 +19438,7 @@ var ForeignKey = class {
|
|
|
18424
19438
|
}
|
|
18425
19439
|
};
|
|
18426
19440
|
//#endregion
|
|
18427
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19441
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
18428
19442
|
var IndexBuilderOn = class {
|
|
18429
19443
|
static [entityKind] = "SQLiteIndexBuilderOn";
|
|
18430
19444
|
constructor(name, unique) {
|
|
@@ -18475,7 +19489,7 @@ function index(name) {
|
|
|
18475
19489
|
return new IndexBuilderOn(name, false);
|
|
18476
19490
|
}
|
|
18477
19491
|
//#endregion
|
|
18478
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19492
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
18479
19493
|
var SQLiteColumnBuilder = class extends ColumnBuilder {
|
|
18480
19494
|
static [entityKind] = "SQLiteColumnBuilder";
|
|
18481
19495
|
foreignKeyConfigs = [];
|
|
@@ -18527,7 +19541,7 @@ var SQLiteColumn = class extends Column {
|
|
|
18527
19541
|
}
|
|
18528
19542
|
};
|
|
18529
19543
|
//#endregion
|
|
18530
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19544
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/blob.js
|
|
18531
19545
|
function hexToText(hexString) {
|
|
18532
19546
|
let result = "";
|
|
18533
19547
|
for (let i = 0; i < hexString.length; i += 2) {
|
|
@@ -18619,7 +19633,7 @@ function blob(a, b) {
|
|
|
18619
19633
|
return new SQLiteBlobJsonBuilder(name);
|
|
18620
19634
|
}
|
|
18621
19635
|
//#endregion
|
|
18622
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19636
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/custom.js
|
|
18623
19637
|
var SQLiteCustomColumnBuilder = class extends SQLiteColumnBuilder {
|
|
18624
19638
|
static [entityKind] = "SQLiteCustomColumnBuilder";
|
|
18625
19639
|
constructor(name, fieldConfig, customTypeParams) {
|
|
@@ -18682,7 +19696,7 @@ function customType(customTypeParams) {
|
|
|
18682
19696
|
};
|
|
18683
19697
|
}
|
|
18684
19698
|
//#endregion
|
|
18685
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19699
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/integer.js
|
|
18686
19700
|
var SQLiteBaseIntegerBuilder = class extends SQLiteColumnBuilder {
|
|
18687
19701
|
static [entityKind] = "SQLiteBaseIntegerBuilder";
|
|
18688
19702
|
constructor(name, dataType, columnType) {
|
|
@@ -18774,7 +19788,7 @@ function integer(a, b) {
|
|
|
18774
19788
|
return new SQLiteIntegerBuilder(name);
|
|
18775
19789
|
}
|
|
18776
19790
|
//#endregion
|
|
18777
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19791
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
18778
19792
|
var SQLiteNumericBuilder = class extends SQLiteColumnBuilder {
|
|
18779
19793
|
static [entityKind] = "SQLiteNumericBuilder";
|
|
18780
19794
|
constructor(name) {
|
|
@@ -18840,7 +19854,7 @@ function numeric(a, b) {
|
|
|
18840
19854
|
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
18841
19855
|
}
|
|
18842
19856
|
//#endregion
|
|
18843
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19857
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/real.js
|
|
18844
19858
|
var SQLiteRealBuilder = class extends SQLiteColumnBuilder {
|
|
18845
19859
|
static [entityKind] = "SQLiteRealBuilder";
|
|
18846
19860
|
constructor(name) {
|
|
@@ -18861,7 +19875,7 @@ function real(name) {
|
|
|
18861
19875
|
return new SQLiteRealBuilder(name ?? "");
|
|
18862
19876
|
}
|
|
18863
19877
|
//#endregion
|
|
18864
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19878
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/text.js
|
|
18865
19879
|
var SQLiteTextBuilder = class extends SQLiteColumnBuilder {
|
|
18866
19880
|
static [entityKind] = "SQLiteTextBuilder";
|
|
18867
19881
|
constructor(name, config) {
|
|
@@ -18912,7 +19926,7 @@ function text(a, b = {}) {
|
|
|
18912
19926
|
return new SQLiteTextBuilder(name, config);
|
|
18913
19927
|
}
|
|
18914
19928
|
//#endregion
|
|
18915
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19929
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/columns/all.js
|
|
18916
19930
|
function getSQLiteColumnBuilders() {
|
|
18917
19931
|
return {
|
|
18918
19932
|
blob,
|
|
@@ -18924,7 +19938,7 @@ function getSQLiteColumnBuilders() {
|
|
|
18924
19938
|
};
|
|
18925
19939
|
}
|
|
18926
19940
|
//#endregion
|
|
18927
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19941
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/table.js
|
|
18928
19942
|
/** @internal */
|
|
18929
19943
|
const InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
18930
19944
|
var SQLiteTable = class extends Table {
|
|
@@ -18962,7 +19976,7 @@ function sqliteTableWithCasing(casing) {
|
|
|
18962
19976
|
}
|
|
18963
19977
|
const sqliteTable = sqliteTableWithCasing(void 0);
|
|
18964
19978
|
//#endregion
|
|
18965
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19979
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/utils.js
|
|
18966
19980
|
function extractUsedTable(table) {
|
|
18967
19981
|
if (is(table, SQLiteTable)) return [`${table[Table.Symbol.BaseName]}`];
|
|
18968
19982
|
if (is(table, Subquery)) return table._.usedTables ?? [];
|
|
@@ -18970,12 +19984,12 @@ function extractUsedTable(table) {
|
|
|
18970
19984
|
return [];
|
|
18971
19985
|
}
|
|
18972
19986
|
//#endregion
|
|
18973
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19987
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/view-base.js
|
|
18974
19988
|
var SQLiteViewBase = class extends View {
|
|
18975
19989
|
static [entityKind] = "SQLiteViewBase";
|
|
18976
19990
|
};
|
|
18977
19991
|
//#endregion
|
|
18978
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
19992
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/select.js
|
|
18979
19993
|
var SQLiteSelectBuilder = class {
|
|
18980
19994
|
static [entityKind] = "SQLiteSelectBuilder";
|
|
18981
19995
|
fields;
|
|
@@ -19651,7 +20665,7 @@ const intersect = createSetOperator("intersect", false);
|
|
|
19651
20665
|
*/
|
|
19652
20666
|
const except = createSetOperator("except", false);
|
|
19653
20667
|
//#endregion
|
|
19654
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
20668
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/dialect.js
|
|
19655
20669
|
var SQLiteDialect = class {
|
|
19656
20670
|
static [entityKind] = "SQLiteDialect";
|
|
19657
20671
|
mapperGenerators;
|
|
@@ -20115,7 +21129,7 @@ var SQLiteDialect = class {
|
|
|
20115
21129
|
}
|
|
20116
21130
|
};
|
|
20117
21131
|
//#endregion
|
|
20118
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21132
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/query-builder.js
|
|
20119
21133
|
var QueryBuilder = class {
|
|
20120
21134
|
static [entityKind] = "SQLiteQueryBuilder";
|
|
20121
21135
|
dialect;
|
|
@@ -20181,7 +21195,7 @@ var QueryBuilder = class {
|
|
|
20181
21195
|
}
|
|
20182
21196
|
};
|
|
20183
21197
|
//#endregion
|
|
20184
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21198
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/count.js
|
|
20185
21199
|
var SQLiteCountBuilder = class SQLiteCountBuilder extends SQL {
|
|
20186
21200
|
static [entityKind] = "SQLiteCountBuilder";
|
|
20187
21201
|
dialect;
|
|
@@ -20210,7 +21224,7 @@ var SQLiteCountBuilder = class SQLiteCountBuilder extends SQL {
|
|
|
20210
21224
|
}
|
|
20211
21225
|
};
|
|
20212
21226
|
//#endregion
|
|
20213
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21227
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/count.js
|
|
20214
21228
|
var SQLiteAsyncCountBuilder = class extends SQLiteCountBuilder {
|
|
20215
21229
|
static [entityKind] = "SQLiteAsyncCountBuilder";
|
|
20216
21230
|
constructor(countConfig) {
|
|
@@ -20236,7 +21250,7 @@ var SQLiteSyncCountBuilder = class extends SQLiteAsyncCountBuilder {
|
|
|
20236
21250
|
}
|
|
20237
21251
|
};
|
|
20238
21252
|
//#endregion
|
|
20239
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21253
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/query.js
|
|
20240
21254
|
var RelationalQueryBuilder = class {
|
|
20241
21255
|
static [entityKind] = "SQLiteRelationalQueryBuilderV2";
|
|
20242
21256
|
constructor(mode, schema, table, tableConfig, dialect, session, forbidJsonb, builder = SQLiteRelationalQuery) {
|
|
@@ -20301,7 +21315,7 @@ var SQLiteRelationalQuery = class {
|
|
|
20301
21315
|
}
|
|
20302
21316
|
};
|
|
20303
21317
|
//#endregion
|
|
20304
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21318
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/query.js
|
|
20305
21319
|
var SQLiteAsyncRelationalQuery = class extends SQLiteRelationalQuery {
|
|
20306
21320
|
static [entityKind] = "SQLiteAsyncRelationalQueryV2";
|
|
20307
21321
|
/** @internal */
|
|
@@ -20332,7 +21346,7 @@ var SQLiteSyncRelationalQuery = class extends SQLiteAsyncRelationalQuery {
|
|
|
20332
21346
|
};
|
|
20333
21347
|
applyMixins(SQLiteAsyncRelationalQuery, [QueryPromise]);
|
|
20334
21348
|
//#endregion
|
|
20335
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21349
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/delete.js
|
|
20336
21350
|
var SQLiteDeleteBase = class {
|
|
20337
21351
|
static [entityKind] = "SQLiteDelete";
|
|
20338
21352
|
/** @internal */
|
|
@@ -20412,7 +21426,7 @@ var SQLiteDeleteBase = class {
|
|
|
20412
21426
|
}
|
|
20413
21427
|
};
|
|
20414
21428
|
//#endregion
|
|
20415
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21429
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/delete.js
|
|
20416
21430
|
var SQLiteAsyncDeleteBase = class extends SQLiteDeleteBase {
|
|
20417
21431
|
static [entityKind] = "SQLiteAsyncDelete";
|
|
20418
21432
|
/** @internal */
|
|
@@ -20443,7 +21457,7 @@ var SQLiteAsyncDeleteBase = class extends SQLiteDeleteBase {
|
|
|
20443
21457
|
};
|
|
20444
21458
|
applyMixins(SQLiteAsyncDeleteBase, [QueryPromise]);
|
|
20445
21459
|
//#endregion
|
|
20446
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21460
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/insert.js
|
|
20447
21461
|
var SQLiteInsertBuilder = class {
|
|
20448
21462
|
static [entityKind] = "SQLiteInsertBuilder";
|
|
20449
21463
|
constructor(table, session, dialect, withList, columnList, builder = SQLiteInsertBase) {
|
|
@@ -20571,7 +21585,7 @@ var SQLiteInsertBase = class {
|
|
|
20571
21585
|
}
|
|
20572
21586
|
};
|
|
20573
21587
|
//#endregion
|
|
20574
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21588
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/insert.js
|
|
20575
21589
|
var SQLiteAsyncInsertBase = class extends SQLiteInsertBase {
|
|
20576
21590
|
static [entityKind] = "SQLiteAsyncInsert";
|
|
20577
21591
|
/** @internal */
|
|
@@ -20602,7 +21616,7 @@ var SQLiteAsyncInsertBase = class extends SQLiteInsertBase {
|
|
|
20602
21616
|
};
|
|
20603
21617
|
applyMixins(SQLiteAsyncInsertBase, [QueryPromise]);
|
|
20604
21618
|
//#endregion
|
|
20605
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21619
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/raw.js
|
|
20606
21620
|
var SQLiteRaw = class {
|
|
20607
21621
|
static [entityKind] = "SQLiteRaw";
|
|
20608
21622
|
constructor(prepared, sql, query) {
|
|
@@ -20621,7 +21635,7 @@ var SQLiteRaw = class {
|
|
|
20621
21635
|
}
|
|
20622
21636
|
};
|
|
20623
21637
|
//#endregion
|
|
20624
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21638
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/raw.js
|
|
20625
21639
|
var SQLiteAsyncRaw = class extends SQLiteRaw {
|
|
20626
21640
|
static [entityKind] = "SQLiteAsyncRaw";
|
|
20627
21641
|
constructor(prepared, sql, query) {
|
|
@@ -20633,7 +21647,7 @@ var SQLiteAsyncRaw = class extends SQLiteRaw {
|
|
|
20633
21647
|
};
|
|
20634
21648
|
applyMixins(SQLiteAsyncRaw, [QueryPromise]);
|
|
20635
21649
|
//#endregion
|
|
20636
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21650
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/select.js
|
|
20637
21651
|
var SQLiteAsyncSelectBase = class extends SQLiteSelectBase {
|
|
20638
21652
|
static [entityKind] = "SQLiteAsyncSelect";
|
|
20639
21653
|
/** @internal */
|
|
@@ -20667,7 +21681,7 @@ var SQLiteAsyncSelectBase = class extends SQLiteSelectBase {
|
|
|
20667
21681
|
};
|
|
20668
21682
|
applyMixins(SQLiteAsyncSelectBase, [QueryPromise]);
|
|
20669
21683
|
//#endregion
|
|
20670
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21684
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/query-builders/update.js
|
|
20671
21685
|
var SQLiteUpdateBuilder = class {
|
|
20672
21686
|
static [entityKind] = "SQLiteUpdateBuilder";
|
|
20673
21687
|
constructor(table, session, dialect, withList, builder = SQLiteUpdateBase) {
|
|
@@ -20796,7 +21810,7 @@ var SQLiteUpdateBase = class {
|
|
|
20796
21810
|
}
|
|
20797
21811
|
};
|
|
20798
21812
|
//#endregion
|
|
20799
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21813
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/update.js
|
|
20800
21814
|
var SQLiteAsyncUpdateBase = class extends SQLiteUpdateBase {
|
|
20801
21815
|
static [entityKind] = "SQLiteAsyncUpdate";
|
|
20802
21816
|
/** @internal */
|
|
@@ -20827,7 +21841,7 @@ var SQLiteAsyncUpdateBase = class extends SQLiteUpdateBase {
|
|
|
20827
21841
|
};
|
|
20828
21842
|
applyMixins(SQLiteAsyncUpdateBase, [QueryPromise]);
|
|
20829
21843
|
//#endregion
|
|
20830
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
21844
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/db.js
|
|
20831
21845
|
var SQLiteAsyncDatabase = class {
|
|
20832
21846
|
static [entityKind] = "BaseSQLiteDatabase";
|
|
20833
21847
|
query;
|
|
@@ -21117,7 +22131,7 @@ var SQLiteAsyncDatabase = class {
|
|
|
21117
22131
|
}
|
|
21118
22132
|
};
|
|
21119
22133
|
//#endregion
|
|
21120
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22134
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/up-migrations/sqlite.js
|
|
21121
22135
|
/**
|
|
21122
22136
|
* Detects the current version of the migrations table schema and upgrades it if needed.
|
|
21123
22137
|
*
|
|
@@ -21187,7 +22201,7 @@ const upgradeSyncFunctions = { 0: (migrationsTable, session, localMigrations) =>
|
|
|
21187
22201
|
});
|
|
21188
22202
|
} };
|
|
21189
22203
|
//#endregion
|
|
21190
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22204
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/session.js
|
|
21191
22205
|
var SQLitePreparedQuery = class {
|
|
21192
22206
|
static [entityKind] = "SQLiteBasePreparedQuery";
|
|
21193
22207
|
/** @internal */
|
|
@@ -21211,7 +22225,7 @@ var SQLiteSession = class {
|
|
|
21211
22225
|
}
|
|
21212
22226
|
};
|
|
21213
22227
|
//#endregion
|
|
21214
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22228
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/sqlite-core/async/session.js
|
|
21215
22229
|
var ExecuteResultSync = class extends QueryPromise {
|
|
21216
22230
|
static [entityKind] = "ExecuteResultSync";
|
|
21217
22231
|
constructor(resultCb) {
|
|
@@ -21464,7 +22478,7 @@ function toSqliteSchema(defs) {
|
|
|
21464
22478
|
return tables;
|
|
21465
22479
|
}
|
|
21466
22480
|
//#endregion
|
|
21467
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22481
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/view.js
|
|
21468
22482
|
var DefaultViewBuilderCore = class {
|
|
21469
22483
|
static [entityKind] = "PgDefaultViewBuilderCore";
|
|
21470
22484
|
constructor(name, schema) {
|
|
@@ -21672,7 +22686,7 @@ function pgMaterializedViewWithSchema(name, selection, schema, casing) {
|
|
|
21672
22686
|
return new MaterializedViewBuilder(name, schema);
|
|
21673
22687
|
}
|
|
21674
22688
|
//#endregion
|
|
21675
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22689
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/sequence.js
|
|
21676
22690
|
var PgSequence = class {
|
|
21677
22691
|
static [entityKind] = "PgSequence";
|
|
21678
22692
|
constructor(seqName, seqOptions, schema) {
|
|
@@ -21686,7 +22700,7 @@ function pgSequenceWithSchema(name, options, schema) {
|
|
|
21686
22700
|
return new PgSequence(name, options, schema);
|
|
21687
22701
|
}
|
|
21688
22702
|
//#endregion
|
|
21689
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
22703
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/pg-core/schema.js
|
|
21690
22704
|
var PgSchema = class {
|
|
21691
22705
|
static [entityKind] = "PgSchema";
|
|
21692
22706
|
isExisting = false;
|
|
@@ -22137,7 +23151,7 @@ function eventDimensions(event) {
|
|
|
22137
23151
|
}
|
|
22138
23152
|
}
|
|
22139
23153
|
//#endregion
|
|
22140
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
23154
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-sqlite/session.js
|
|
22141
23155
|
var NodeSQLiteSession = class extends SQLiteAsyncSession {
|
|
22142
23156
|
static [entityKind] = "SQLJsSession";
|
|
22143
23157
|
logger;
|
|
@@ -22209,7 +23223,7 @@ var NodeSQLiteTransaction = class NodeSQLiteTransaction extends SQLiteAsyncTrans
|
|
|
22209
23223
|
}
|
|
22210
23224
|
};
|
|
22211
23225
|
//#endregion
|
|
22212
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
23226
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-sqlite/driver.js
|
|
22213
23227
|
var NodeSQLiteDatabase = class extends SQLiteAsyncDatabase {
|
|
22214
23228
|
static [entityKind] = "NodeSQLiteDatabase";
|
|
22215
23229
|
};
|
|
@@ -22240,7 +23254,7 @@ function drizzle(...params) {
|
|
|
22240
23254
|
_drizzle.mock = mock;
|
|
22241
23255
|
})(drizzle || (drizzle = {}));
|
|
22242
23256
|
//#endregion
|
|
22243
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
23257
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/migrator.js
|
|
22244
23258
|
function readMigrationFiles(config) {
|
|
22245
23259
|
if (fs.existsSync(`${config.migrationsFolder}/meta/_journal.json`)) throw Error("We detected that you have old drizzle-kit migration folders. You must upgrade drizzle-kit and run \"drizzle-kit up\"");
|
|
22246
23260
|
const migrationFolderTo = config.migrationsFolder;
|
|
@@ -22269,14 +23283,14 @@ function readMigrationFiles(config) {
|
|
|
22269
23283
|
return migrationQueries;
|
|
22270
23284
|
}
|
|
22271
23285
|
//#endregion
|
|
22272
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
23286
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-sqlite/migrator.js
|
|
22273
23287
|
function migrate$1(db, config) {
|
|
22274
23288
|
return migrateSync(readMigrationFiles(config), db.session, config);
|
|
22275
23289
|
}
|
|
22276
23290
|
//#endregion
|
|
22277
23291
|
//#region ../session-rdb/src/sqlite.ts
|
|
22278
23292
|
/** drizzle-kit 生成的迁移目录(随包根 drizzle/ 发布;src/dist 形态经相对 URL 统一解析)。 */
|
|
22279
|
-
const sqliteMigrationsDir = new URL("../drizzle/sqlite/", import.meta.url)
|
|
23293
|
+
const sqliteMigrationsDir = fileURLToPath(new URL("../drizzle/sqlite/", import.meta.url));
|
|
22280
23294
|
const sqliteTxQueues = /* @__PURE__ */ new Map();
|
|
22281
23295
|
function enqueueSqliteTx(path, fn) {
|
|
22282
23296
|
const run = (sqliteTxQueues.get(path) ?? Promise.resolve()).then(fn);
|
|
@@ -22489,14 +23503,14 @@ var SqliteBackend = class SqliteBackend {
|
|
|
22489
23503
|
}
|
|
22490
23504
|
};
|
|
22491
23505
|
//#endregion
|
|
22492
|
-
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.
|
|
23506
|
+
//#region ../../node_modules/.pnpm/drizzle-orm@1.0.0-rc.5-ab785fc_@opentelemetry+api@1.9.1_@types+pg@8.23.1_pg@8.23.0_typebox@1.3.7_zod@4.6.1/node_modules/drizzle-orm/node-postgres/migrator.js
|
|
22493
23507
|
async function migrate(db, config) {
|
|
22494
23508
|
return await migrate$2(readMigrationFiles(config), db, config);
|
|
22495
23509
|
}
|
|
22496
23510
|
//#endregion
|
|
22497
23511
|
//#region ../session-rdb/src/postgres.ts
|
|
22498
23512
|
/** drizzle-kit 生成的迁移目录(随包根 drizzle/ 发布;src/dist 形态经相对 URL 统一解析)。 */
|
|
22499
|
-
const postgresMigrationsDir = new URL("../drizzle/postgres/", import.meta.url)
|
|
23513
|
+
const postgresMigrationsDir = fileURLToPath(new URL("../drizzle/postgres/", import.meta.url));
|
|
22500
23514
|
var PostgresBackend = class PostgresBackend {
|
|
22501
23515
|
db;
|
|
22502
23516
|
options;
|
|
@@ -22781,7 +23795,8 @@ var SessionBranchRdbProvider = class {
|
|
|
22781
23795
|
if (!Number.isSafeInteger(toBoundary) || toBoundary < -1) throw new SessionBranchError(`rewind boundary must be a non-negative safe integer, got ${toBoundary}`, "INVALID_BOUNDARY");
|
|
22782
23796
|
const live = this.live.getSession(id);
|
|
22783
23797
|
if (live !== void 0) await this.live.flush(live);
|
|
22784
|
-
const raw = live === void 0 ? await this.
|
|
23798
|
+
const raw = live === void 0 ? await this.persistence.readLog(id, {}, signal) : void 0;
|
|
23799
|
+
if (live === void 0 && raw === void 0) throw new SessionBranchError(`session "${id}" not found`, "SESSION_NOT_FOUND");
|
|
22785
23800
|
const inspection = live === void 0 ? void 0 : await this.persistence.internals().inspect(id, signal);
|
|
22786
23801
|
const events = live === void 0 ? raw.events : inspection.events;
|
|
22787
23802
|
const meta = live === void 0 ? raw.meta : inspection.meta;
|
|
@@ -22789,7 +23804,8 @@ var SessionBranchRdbProvider = class {
|
|
|
22789
23804
|
if (toBoundary === -1) {} else if (boundaryEvent === void 0) throw new SessionBranchError(`rewind boundary ${toBoundary} does not exist in session "${id}"`, "INVALID_BOUNDARY");
|
|
22790
23805
|
else if (boundaryEvent.type !== "turn/end" && boundaryEvent.type !== "user/message") throw new SessionBranchError(`rewind boundary ${toBoundary} is not a turn/end or user/message (${boundaryEvent.type})`, "INVALID_BOUNDARY");
|
|
22791
23806
|
const rawKeepLength = toBoundary === -1 ? 0 : boundaryEvent.type === "turn/end" ? toBoundary + 1 : toBoundary;
|
|
22792
|
-
const
|
|
23807
|
+
const kept = balanceRewindPrefix(events.slice(0, rawKeepLength));
|
|
23808
|
+
const keepLength = kept.length;
|
|
22793
23809
|
const internals = this.persistence.internals();
|
|
22794
23810
|
const denseBoundary = keepLength - 1;
|
|
22795
23811
|
const newSeedLength = await internals.backend.transaction(async (tx) => {
|
|
@@ -22814,6 +23830,7 @@ var SessionBranchRdbProvider = class {
|
|
|
22814
23830
|
internals.writeGuard.confirmHead(id, denseBoundary);
|
|
22815
23831
|
if (live !== void 0) {
|
|
22816
23832
|
truncateLiveSession(live, keepLength);
|
|
23833
|
+
this.live.resetProjections?.(live);
|
|
22817
23834
|
const agent = this.live.getAgent(id);
|
|
22818
23835
|
if (agent !== void 0) {
|
|
22819
23836
|
agent.requestHeaderLogged = false;
|
|
@@ -22823,7 +23840,15 @@ var SessionBranchRdbProvider = class {
|
|
|
22823
23840
|
}
|
|
22824
23841
|
const handle = this.persistence.tracker.writerOf(id);
|
|
22825
23842
|
if (handle !== void 0) handle.resetAfterRewind(keepLength, newSeedLength === null ? void 0 : newSeedLength);
|
|
22826
|
-
|
|
23843
|
+
agent?.inbox?.clear();
|
|
23844
|
+
await this.live.flush(live);
|
|
23845
|
+
await this.refreshProjectionCache(live);
|
|
23846
|
+
} else await this.refreshProjectionCache({
|
|
23847
|
+
id,
|
|
23848
|
+
header: meta,
|
|
23849
|
+
inheritedEventCount: SessionLogOffset(raw.inheritedEventCount),
|
|
23850
|
+
snapshotEvents: () => kept
|
|
23851
|
+
});
|
|
22827
23852
|
const row = await internals.backend.getSession(id);
|
|
22828
23853
|
if (row === void 0) return {
|
|
22829
23854
|
header: {
|
|
@@ -22844,6 +23869,16 @@ var SessionBranchRdbProvider = class {
|
|
|
22844
23869
|
revision: await internals.readStoredRevision(id)
|
|
22845
23870
|
};
|
|
22846
23871
|
}
|
|
23872
|
+
/**
|
|
23873
|
+
* 让持久化投影检查点跟随截断后的 log(见 {@link LiveSessionHooks.refreshProjectionCache})。
|
|
23874
|
+
* 缓存是派生数据:刷新失败只让缓存多滞后一轮,不能让 rewind 失败。
|
|
23875
|
+
*/
|
|
23876
|
+
async refreshProjectionCache(session) {
|
|
23877
|
+
if (this.live.refreshProjectionCache === void 0) return;
|
|
23878
|
+
try {
|
|
23879
|
+
await this.live.refreshProjectionCache(session);
|
|
23880
|
+
} catch {}
|
|
23881
|
+
}
|
|
22847
23882
|
};
|
|
22848
23883
|
var SessionBranchRdb = class extends SessionBranch {
|
|
22849
23884
|
static inject = ["sessionPersistence", "sessions"];
|
|
@@ -22855,7 +23890,21 @@ var SessionBranchRdb = class extends SessionBranch {
|
|
|
22855
23890
|
getAgent: (id) => {
|
|
22856
23891
|
return this.ctx.get("agents")?.get(id);
|
|
22857
23892
|
},
|
|
22858
|
-
flush: (session) => this.ctx.sessions.flush(session)
|
|
23893
|
+
flush: (session) => this.ctx.sessions.flush(session),
|
|
23894
|
+
resetProjections: (session) => {
|
|
23895
|
+
const registry = this.ctx.get("sessionProjections");
|
|
23896
|
+
if (registry?.registrations === void 0) return;
|
|
23897
|
+
for (const registration of registry.registrations.values()) registration.cells.delete(session);
|
|
23898
|
+
},
|
|
23899
|
+
refreshProjectionCache: async (session) => {
|
|
23900
|
+
const cache = this.ctx.get("sessionProjectionCache");
|
|
23901
|
+
if (cache === void 0) return;
|
|
23902
|
+
try {
|
|
23903
|
+
await cache.write(session);
|
|
23904
|
+
} catch (error) {
|
|
23905
|
+
this.ctx.logger.warn(`session-rdb: projection cache refresh after rewind for "${session.id}" failed (cache stays stale): ${String(error)}`);
|
|
23906
|
+
}
|
|
23907
|
+
}
|
|
22859
23908
|
});
|
|
22860
23909
|
readBranchPrefix(id, atSeq, mode, signal) {
|
|
22861
23910
|
return this.provider.readBranchPrefix(id, atSeq, mode, signal);
|
|
@@ -23504,35 +24553,43 @@ function registerSessionImport(ctx, persistence) {
|
|
|
23504
24553
|
}
|
|
23505
24554
|
//#endregion
|
|
23506
24555
|
//#region ../session-rdb/src/legacy.ts
|
|
23507
|
-
/** 重建 v0/v1 物理 header 记录(RDB 行 → 物理 JSON 对象)。 */
|
|
24556
|
+
/** 重建 v0/v1/v2 物理 header 记录(RDB 行 → 物理 JSON 对象)。 */
|
|
23508
24557
|
function physicalHeader(row) {
|
|
23509
|
-
|
|
24558
|
+
const common = {
|
|
23510
24559
|
type: "session",
|
|
23511
24560
|
version: row.fVersion,
|
|
23512
24561
|
id: row.fSessionId,
|
|
23513
24562
|
createdAt: row.fCreatedAt,
|
|
23514
24563
|
...row.fCwd !== null ? { cwd: row.fCwd } : {},
|
|
23515
24564
|
...row.fParentSession !== null ? { parentSession: row.fParentSession } : {},
|
|
23516
|
-
...row.fSeedLength !== null ? { seedLength: row.fSeedLength } : {},
|
|
23517
24565
|
...row.fOrigin !== null ? { origin: row.fOrigin } : {},
|
|
23518
24566
|
delegationDepth: row.fDelegationDepth ?? 0
|
|
23519
24567
|
};
|
|
24568
|
+
return row.fVersion < 2 ? {
|
|
24569
|
+
...common,
|
|
24570
|
+
...row.fSeedLength !== null ? { seedLength: row.fSeedLength } : {}
|
|
24571
|
+
} : {
|
|
24572
|
+
...common,
|
|
24573
|
+
isSeeded: row.fSeedLength !== null
|
|
24574
|
+
};
|
|
23520
24575
|
}
|
|
23521
|
-
/** 重建一条 v0/v1 物理事件记录(桥接行 + 事件行 → 物理 JSON 对象)。 */
|
|
24576
|
+
/** 重建一条 v0/v1/v2 物理事件记录(桥接行 + 事件行 → 物理 JSON 对象)。 */
|
|
23522
24577
|
function physicalEvent(row) {
|
|
24578
|
+
const stored = JSON.parse(row.fData);
|
|
24579
|
+
const full = typeof stored === "object" && stored !== null && !Array.isArray(stored) && typeof stored["type"] === "string" && "data" in stored;
|
|
23523
24580
|
return {
|
|
23524
24581
|
type: row.fType,
|
|
23525
24582
|
seq: row.fSequence,
|
|
23526
24583
|
time: row.fCreatedAt,
|
|
23527
|
-
data:
|
|
24584
|
+
data: full ? stored["data"] : stored,
|
|
23528
24585
|
...row.fSurfaceOp !== null ? { surfaceOp: JSON.parse(row.fSurfaceOp) } : {}
|
|
23529
24586
|
};
|
|
23530
24587
|
}
|
|
23531
24588
|
/**
|
|
23532
|
-
*
|
|
23533
|
-
* @param row - 会话行(f_version <
|
|
24589
|
+
* 把非当前格式(v0/v1/v2)行转换为当前逻辑事件与 header。
|
|
24590
|
+
* @param row - 会话行(f_version < SESSION_FORMAT_VERSION)。
|
|
23534
24591
|
* @param eventRows - 已扫描保留的桥接行(稠密 seq,torn tail 已剔除)。
|
|
23535
|
-
* @returns
|
|
24592
|
+
* @returns 当前逻辑 header、继承前缀长度与事件。
|
|
23536
24593
|
* @throws 迁移链拒绝(格式损坏 / 无法迁移)时原样抛出。
|
|
23537
24594
|
*/
|
|
23538
24595
|
function convertLegacyRows(row, eventRows) {
|
|
@@ -23548,9 +24605,9 @@ function convertLegacyRows(row, eventRows) {
|
|
|
23548
24605
|
events: artifact.events
|
|
23549
24606
|
};
|
|
23550
24607
|
}
|
|
23551
|
-
/**
|
|
24608
|
+
/** 会话行是否携带非当前格式(f_version < SESSION_FORMAT_VERSION)数据。 */
|
|
23552
24609
|
function isLegacyVersion(version) {
|
|
23553
|
-
return version <
|
|
24610
|
+
return version < SESSION_FORMAT_VERSION;
|
|
23554
24611
|
}
|
|
23555
24612
|
/**
|
|
23556
24613
|
* 迁移链拒绝后,把旧格式行直接当**当前格式**事件视图采用。
|
|
@@ -23564,7 +24621,7 @@ function isLegacyVersion(version) {
|
|
|
23564
24621
|
* 调用方须在此之后执行 `validateStoredEvents`:真正属于旧格式的类型
|
|
23565
24622
|
* (`assistant/chunk` / `compact/*` 等)仍会被 fail-loud 拒绝。
|
|
23566
24623
|
*
|
|
23567
|
-
* @param row - 会话行(f_version <
|
|
24624
|
+
* @param row - 会话行(f_version < SESSION_FORMAT_VERSION)。
|
|
23568
24625
|
* @param eventRows - 该会话全部桥接行(按 f_sequence 升序)。
|
|
23569
24626
|
* @returns 当前格式 header(version 归一到 SESSION_FORMAT_VERSION)、收缩后的
|
|
23570
24627
|
* 继承前缀长度、稠密事件与可选 torn tail 起点。
|
|
@@ -23572,6 +24629,7 @@ function isLegacyVersion(version) {
|
|
|
23572
24629
|
*/
|
|
23573
24630
|
function adoptLegacyRows(row, eventRows) {
|
|
23574
24631
|
const { preserved, tornFrom } = scanRows(eventRows, 0);
|
|
24632
|
+
repairRequestHeaders(preserved);
|
|
23575
24633
|
return {
|
|
23576
24634
|
meta: {
|
|
23577
24635
|
...rowToMeta(row),
|
|
@@ -23921,6 +24979,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
|
|
|
23921
24979
|
}));
|
|
23922
24980
|
const log = await this.readLog(id, {}, options?.signal);
|
|
23923
24981
|
if (log === void 0) throw new SessionPersistenceNotFoundError(id);
|
|
24982
|
+
repairReadView(log.events);
|
|
23924
24983
|
validateStoredEvents(log.meta, log.events);
|
|
23925
24984
|
return this.tracker.adopt(new RdbSessionHandle(this, id, log.meta, "read", {
|
|
23926
24985
|
cursor: log.events.length,
|
|
@@ -23937,6 +24996,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
|
|
|
23937
24996
|
}));
|
|
23938
24997
|
const log = await this.readLog(id, {}, options?.signal);
|
|
23939
24998
|
if (log === void 0) throw new SessionPersistenceNotFoundError(id);
|
|
24999
|
+
repairReadView(log.events);
|
|
23940
25000
|
validateStoredEvents(log.meta, log.events);
|
|
23941
25001
|
if (log.migrated && log.events.length !== log.storedCount) await this.rewriteMigratedLog(id, log);
|
|
23942
25002
|
this.writeGuard.confirmHead(id, log.events.at(-1)?.seq ?? -1);
|
|
@@ -24025,9 +25085,9 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
|
|
|
24025
25085
|
this.writeGuard.confirmHead(meta.id, -1);
|
|
24026
25086
|
}
|
|
24027
25087
|
/** 原样 append 落库(handle 已校验 contiguity;torn tail 先截断)。
|
|
24028
|
-
* 与上游 JSONL 一致:ignorable
|
|
24029
|
-
*
|
|
24030
|
-
*
|
|
25088
|
+
* 与上游 JSONL 一致:ignorable 事件原样存储,不做过滤。写路径校验当前
|
|
25089
|
+
* 格式形状(fail-closed):未知类型(非 ignorable)与非法消息形状拒绝入库;
|
|
25090
|
+
* 非当前格式(v0/v1/v2)数据只在读取时经 legacy 转换链动态转换,不落新库。 */
|
|
24031
25091
|
async appendBatch(meta, inheritedEventCount, events, tornTruncateTo) {
|
|
24032
25092
|
await this.ready;
|
|
24033
25093
|
if (events.length === 0) return false;
|
|
@@ -24108,7 +25168,7 @@ var SessionPersistenceRdb = class SessionPersistenceRdb extends SessionPersisten
|
|
|
24108
25168
|
};
|
|
24109
25169
|
}
|
|
24110
25170
|
/**
|
|
24111
|
-
*
|
|
25171
|
+
* 把迁移链读出的当前格式视图整体落库(非当前格式会话写打开时的一次性迁移)。
|
|
24112
25172
|
*
|
|
24113
25173
|
* 迁移链会生成/合并事件(end-seed / attempt / chunk 合并),事件 seq 空间
|
|
24114
25174
|
* 与存储桥接行数不再相等;写路径以存储 head 为锚点重编号,二者不一致会让
|