@alook/daemon 0.1.48 → 0.1.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +470 -380
- package/dist/index.js +470 -380
- package/package.json +2 -2
package/dist/cli/index.js
CHANGED
|
@@ -19499,7 +19499,7 @@ __export(exports_community_machine_schema, {
|
|
|
19499
19499
|
DIAGNOSTIC_REPORT_FAILURE_CODES: () => DIAGNOSTIC_REPORT_FAILURE_CODES
|
|
19500
19500
|
});
|
|
19501
19501
|
|
|
19502
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19502
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/entity.js
|
|
19503
19503
|
var entityKind = Symbol.for("drizzle:entityKind");
|
|
19504
19504
|
var hasOwnEntityKind = Symbol.for("drizzle:hasOwnEntityKind");
|
|
19505
19505
|
function is(value, type) {
|
|
@@ -19524,7 +19524,7 @@ function is(value, type) {
|
|
|
19524
19524
|
return false;
|
|
19525
19525
|
}
|
|
19526
19526
|
|
|
19527
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19527
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/column.js
|
|
19528
19528
|
class Column {
|
|
19529
19529
|
constructor(table, config2) {
|
|
19530
19530
|
this.table = table;
|
|
@@ -19574,7 +19574,7 @@ class Column {
|
|
|
19574
19574
|
}
|
|
19575
19575
|
}
|
|
19576
19576
|
|
|
19577
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19577
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/column-builder.js
|
|
19578
19578
|
class ColumnBuilder {
|
|
19579
19579
|
static [entityKind] = "ColumnBuilder";
|
|
19580
19580
|
config;
|
|
@@ -19630,20 +19630,20 @@ class ColumnBuilder {
|
|
|
19630
19630
|
}
|
|
19631
19631
|
}
|
|
19632
19632
|
|
|
19633
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19633
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/table.utils.js
|
|
19634
19634
|
var TableName = Symbol.for("drizzle:Name");
|
|
19635
19635
|
|
|
19636
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19636
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/tracing-utils.js
|
|
19637
19637
|
function iife(fn, ...args) {
|
|
19638
19638
|
return fn(...args);
|
|
19639
19639
|
}
|
|
19640
19640
|
|
|
19641
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19641
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/pg-core/unique-constraint.js
|
|
19642
19642
|
function uniqueKeyName(table, columns) {
|
|
19643
19643
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
19644
19644
|
}
|
|
19645
19645
|
|
|
19646
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19646
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/pg-core/columns/common.js
|
|
19647
19647
|
class PgColumn extends Column {
|
|
19648
19648
|
constructor(table, config2) {
|
|
19649
19649
|
if (!config2.uniqueName) {
|
|
@@ -19692,7 +19692,7 @@ class ExtraConfigColumn extends PgColumn {
|
|
|
19692
19692
|
}
|
|
19693
19693
|
}
|
|
19694
19694
|
|
|
19695
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19695
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/pg-core/columns/enum.js
|
|
19696
19696
|
class PgEnumObjectColumn extends PgColumn {
|
|
19697
19697
|
static [entityKind] = "PgEnumObjectColumn";
|
|
19698
19698
|
enum;
|
|
@@ -19722,7 +19722,7 @@ class PgEnumColumn extends PgColumn {
|
|
|
19722
19722
|
}
|
|
19723
19723
|
}
|
|
19724
19724
|
|
|
19725
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19725
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/subquery.js
|
|
19726
19726
|
class Subquery {
|
|
19727
19727
|
static [entityKind] = "Subquery";
|
|
19728
19728
|
constructor(sql, fields, alias, isWith = false, usedTables = []) {
|
|
@@ -19737,10 +19737,10 @@ class Subquery {
|
|
|
19737
19737
|
}
|
|
19738
19738
|
}
|
|
19739
19739
|
|
|
19740
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19741
|
-
var version2 = "0.45.
|
|
19740
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/version.js
|
|
19741
|
+
var version2 = "0.45.4";
|
|
19742
19742
|
|
|
19743
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19743
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/tracing.js
|
|
19744
19744
|
var otel;
|
|
19745
19745
|
var rawTracer;
|
|
19746
19746
|
var tracer = {
|
|
@@ -19767,10 +19767,10 @@ var tracer = {
|
|
|
19767
19767
|
}
|
|
19768
19768
|
};
|
|
19769
19769
|
|
|
19770
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19770
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/view-common.js
|
|
19771
19771
|
var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
19772
19772
|
|
|
19773
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19773
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/table.js
|
|
19774
19774
|
var Schema = Symbol.for("drizzle:Schema");
|
|
19775
19775
|
var Columns = Symbol.for("drizzle:Columns");
|
|
19776
19776
|
var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
@@ -19808,7 +19808,7 @@ class Table {
|
|
|
19808
19808
|
}
|
|
19809
19809
|
}
|
|
19810
19810
|
|
|
19811
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
19811
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sql/sql.js
|
|
19812
19812
|
function isSQLWrapper(value) {
|
|
19813
19813
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
19814
19814
|
}
|
|
@@ -20171,7 +20171,7 @@ Subquery.prototype.getSQL = function() {
|
|
|
20171
20171
|
return new SQL([this]);
|
|
20172
20172
|
};
|
|
20173
20173
|
|
|
20174
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20174
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/alias.js
|
|
20175
20175
|
class ColumnAliasProxyHandler {
|
|
20176
20176
|
constructor(table) {
|
|
20177
20177
|
this.table = table;
|
|
@@ -20227,12 +20227,12 @@ class TableAliasProxyHandler {
|
|
|
20227
20227
|
}
|
|
20228
20228
|
}
|
|
20229
20229
|
|
|
20230
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20230
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/alias.js
|
|
20231
20231
|
function alias(table, alias2) {
|
|
20232
20232
|
return new Proxy(table, new TableAliasProxyHandler(alias2, false));
|
|
20233
20233
|
}
|
|
20234
20234
|
|
|
20235
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20235
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/checks.js
|
|
20236
20236
|
class CheckBuilder {
|
|
20237
20237
|
constructor(name, value) {
|
|
20238
20238
|
this.name = name;
|
|
@@ -20259,7 +20259,7 @@ function check2(name, value) {
|
|
|
20259
20259
|
return new CheckBuilder(name, value);
|
|
20260
20260
|
}
|
|
20261
20261
|
|
|
20262
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20262
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/utils.js
|
|
20263
20263
|
function getColumnNameAndConfig(a, b) {
|
|
20264
20264
|
return {
|
|
20265
20265
|
name: typeof a === "string" && a.length > 0 ? a : "",
|
|
@@ -20268,7 +20268,7 @@ function getColumnNameAndConfig(a, b) {
|
|
|
20268
20268
|
}
|
|
20269
20269
|
var textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
20270
20270
|
|
|
20271
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20271
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
20272
20272
|
class ForeignKeyBuilder {
|
|
20273
20273
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
20274
20274
|
reference;
|
|
@@ -20336,7 +20336,7 @@ function foreignKey(config2) {
|
|
|
20336
20336
|
return new ForeignKeyBuilder(mappedConfig);
|
|
20337
20337
|
}
|
|
20338
20338
|
|
|
20339
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20339
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/unique-constraint.js
|
|
20340
20340
|
function uniqueKeyName2(table, columns) {
|
|
20341
20341
|
return `${table[TableName]}_${columns.join("_")}_unique`;
|
|
20342
20342
|
}
|
|
@@ -20381,7 +20381,7 @@ class UniqueConstraint {
|
|
|
20381
20381
|
}
|
|
20382
20382
|
}
|
|
20383
20383
|
|
|
20384
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20384
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/common.js
|
|
20385
20385
|
class SQLiteColumnBuilder extends ColumnBuilder {
|
|
20386
20386
|
static [entityKind] = "SQLiteColumnBuilder";
|
|
20387
20387
|
foreignKeyConfigs = [];
|
|
@@ -20432,7 +20432,7 @@ class SQLiteColumn extends Column {
|
|
|
20432
20432
|
static [entityKind] = "SQLiteColumn";
|
|
20433
20433
|
}
|
|
20434
20434
|
|
|
20435
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20435
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/blob.js
|
|
20436
20436
|
class SQLiteBigIntBuilder extends SQLiteColumnBuilder {
|
|
20437
20437
|
static [entityKind] = "SQLiteBigIntBuilder";
|
|
20438
20438
|
constructor(name) {
|
|
@@ -20520,7 +20520,7 @@ function blob(a, b) {
|
|
|
20520
20520
|
return new SQLiteBlobBufferBuilder(name);
|
|
20521
20521
|
}
|
|
20522
20522
|
|
|
20523
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20523
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/custom.js
|
|
20524
20524
|
class SQLiteCustomColumnBuilder extends SQLiteColumnBuilder {
|
|
20525
20525
|
static [entityKind] = "SQLiteCustomColumnBuilder";
|
|
20526
20526
|
constructor(name, fieldConfig, customTypeParams) {
|
|
@@ -20561,7 +20561,7 @@ function customType(customTypeParams) {
|
|
|
20561
20561
|
};
|
|
20562
20562
|
}
|
|
20563
20563
|
|
|
20564
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20564
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/integer.js
|
|
20565
20565
|
class SQLiteBaseIntegerBuilder extends SQLiteColumnBuilder {
|
|
20566
20566
|
static [entityKind] = "SQLiteBaseIntegerBuilder";
|
|
20567
20567
|
constructor(name, dataType, columnType) {
|
|
@@ -20663,7 +20663,7 @@ function integer2(a, b) {
|
|
|
20663
20663
|
return new SQLiteIntegerBuilder(name);
|
|
20664
20664
|
}
|
|
20665
20665
|
|
|
20666
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20666
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/numeric.js
|
|
20667
20667
|
class SQLiteNumericBuilder extends SQLiteColumnBuilder {
|
|
20668
20668
|
static [entityKind] = "SQLiteNumericBuilder";
|
|
20669
20669
|
constructor(name) {
|
|
@@ -20733,7 +20733,7 @@ function numeric(a, b) {
|
|
|
20733
20733
|
return mode === "number" ? new SQLiteNumericNumberBuilder(name) : mode === "bigint" ? new SQLiteNumericBigIntBuilder(name) : new SQLiteNumericBuilder(name);
|
|
20734
20734
|
}
|
|
20735
20735
|
|
|
20736
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20736
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/real.js
|
|
20737
20737
|
class SQLiteRealBuilder extends SQLiteColumnBuilder {
|
|
20738
20738
|
static [entityKind] = "SQLiteRealBuilder";
|
|
20739
20739
|
constructor(name) {
|
|
@@ -20754,7 +20754,7 @@ function real(name) {
|
|
|
20754
20754
|
return new SQLiteRealBuilder(name ?? "");
|
|
20755
20755
|
}
|
|
20756
20756
|
|
|
20757
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20757
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/text.js
|
|
20758
20758
|
class SQLiteTextBuilder extends SQLiteColumnBuilder {
|
|
20759
20759
|
static [entityKind] = "SQLiteTextBuilder";
|
|
20760
20760
|
constructor(name, config2) {
|
|
@@ -20809,7 +20809,7 @@ function text(a, b = {}) {
|
|
|
20809
20809
|
return new SQLiteTextBuilder(name, config2);
|
|
20810
20810
|
}
|
|
20811
20811
|
|
|
20812
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20812
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/columns/all.js
|
|
20813
20813
|
function getSQLiteColumnBuilders() {
|
|
20814
20814
|
return {
|
|
20815
20815
|
blob,
|
|
@@ -20821,7 +20821,7 @@ function getSQLiteColumnBuilders() {
|
|
|
20821
20821
|
};
|
|
20822
20822
|
}
|
|
20823
20823
|
|
|
20824
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20824
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/table.js
|
|
20825
20825
|
var InlineForeignKeys = Symbol.for("drizzle:SQLiteInlineForeignKeys");
|
|
20826
20826
|
|
|
20827
20827
|
class SQLiteTable extends Table {
|
|
@@ -20855,7 +20855,7 @@ var sqliteTable = (name, columns, extraConfig) => {
|
|
|
20855
20855
|
return sqliteTableBase(name, columns, extraConfig);
|
|
20856
20856
|
};
|
|
20857
20857
|
|
|
20858
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20858
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/indexes.js
|
|
20859
20859
|
class IndexBuilderOn {
|
|
20860
20860
|
constructor(name, unique2) {
|
|
20861
20861
|
this.name = name;
|
|
@@ -20901,7 +20901,7 @@ function uniqueIndex(name) {
|
|
|
20901
20901
|
return new IndexBuilderOn(name, true);
|
|
20902
20902
|
}
|
|
20903
20903
|
|
|
20904
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20904
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sqlite-core/primary-keys.js
|
|
20905
20905
|
function primaryKey(...config2) {
|
|
20906
20906
|
if (config2[0].columns) {
|
|
20907
20907
|
return new PrimaryKeyBuilder(config2[0].columns, config2[0].name);
|
|
@@ -20936,7 +20936,7 @@ class PrimaryKey {
|
|
|
20936
20936
|
}
|
|
20937
20937
|
}
|
|
20938
20938
|
|
|
20939
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20939
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sql/expressions/conditions.js
|
|
20940
20940
|
function bindIfParam(value, column) {
|
|
20941
20941
|
if (isDriverValueEncoder(column) && !isSQLWrapper(value) && !is(value, Param) && !is(value, Placeholder) && !is(value, Column) && !is(value, Table) && !is(value, View)) {
|
|
20942
20942
|
return new Param(value, column);
|
|
@@ -20964,7 +20964,7 @@ function isNotNull(value) {
|
|
|
20964
20964
|
return sql`${value} is not null`;
|
|
20965
20965
|
}
|
|
20966
20966
|
|
|
20967
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.
|
|
20967
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.4_@cloudflare+workers-types@5.20261009.1_@opentelemetry+api@1.9.1_@typ_2c5bdbc2e285e95e03f6fc3b5df79b2b/node_modules/drizzle-orm/sql/expressions/select.js
|
|
20968
20968
|
function desc(column) {
|
|
20969
20969
|
return sql`${column} desc`;
|
|
20970
20970
|
}
|
|
@@ -22143,30 +22143,288 @@ var HostCommandSchema = exports_external.discriminatedUnion("type", [
|
|
|
22143
22143
|
// src/cli/proxyServerApi.ts
|
|
22144
22144
|
import * as fs from "fs";
|
|
22145
22145
|
import * as path from "path";
|
|
22146
|
-
// ../shared/src/community-
|
|
22146
|
+
// ../shared/src/community-contract.ts
|
|
22147
|
+
var COMMUNITY_RESOURCE_CONTRACT_VERSION = 3;
|
|
22148
|
+
|
|
22149
|
+
// ../shared/src/community-friend-approval.ts
|
|
22150
|
+
var profile = exports_external.strictObject({
|
|
22151
|
+
id: exports_external.string(),
|
|
22152
|
+
name: exports_external.string(),
|
|
22153
|
+
discriminator: exports_external.string(),
|
|
22154
|
+
image: exports_external.string().nullable(),
|
|
22155
|
+
avatarVersion: exports_external.number().int().nonnegative()
|
|
22156
|
+
});
|
|
22157
|
+
var FriendApprovalPayloadSchema = exports_external.strictObject({
|
|
22158
|
+
friendshipId: exports_external.string(),
|
|
22159
|
+
status: exports_external.enum(["pending", "approved", "denied", "superseded", "cancelled"]),
|
|
22160
|
+
waitingOn: exports_external.enum(["you", "other-owner", "addressee"]).nullable(),
|
|
22161
|
+
otherProfile: profile,
|
|
22162
|
+
botProfile: profile,
|
|
22163
|
+
waitingOnProfile: profile.nullable().optional()
|
|
22164
|
+
});
|
|
22165
|
+
|
|
22166
|
+
// ../shared/src/community-resources.ts
|
|
22147
22167
|
var id = exports_external.string().min(1);
|
|
22148
|
-
var
|
|
22149
|
-
|
|
22168
|
+
var nullableId = id.nullable();
|
|
22169
|
+
var legacyArchivedSchema = exports_external.union([exports_external.boolean(), exports_external.literal(0), exports_external.literal(1)]).transform((value) => value === true || value === 1);
|
|
22170
|
+
var CommunityChannelResourceSchema = exports_external.strictObject({
|
|
22171
|
+
id,
|
|
22172
|
+
type: exports_external.enum(["text", "forum", "thread", "dm"]),
|
|
22173
|
+
serverId: nullableId,
|
|
22174
|
+
categoryId: nullableId,
|
|
22175
|
+
name: exports_external.string().nullable(),
|
|
22176
|
+
topic: exports_external.string(),
|
|
22177
|
+
parentChannelId: nullableId,
|
|
22178
|
+
parentMessageId: nullableId,
|
|
22179
|
+
creatorId: nullableId,
|
|
22180
|
+
position: exports_external.number(),
|
|
22181
|
+
archived: exports_external.boolean(),
|
|
22182
|
+
createdAt: exports_external.string(),
|
|
22183
|
+
lastMessageAt: exports_external.string().nullable(),
|
|
22184
|
+
messageCount: exports_external.number().int().nonnegative()
|
|
22185
|
+
});
|
|
22186
|
+
var CommunityChannelIdentitySchema = CommunityChannelResourceSchema.pick({
|
|
22187
|
+
id: true,
|
|
22188
|
+
type: true,
|
|
22189
|
+
serverId: true,
|
|
22190
|
+
name: true,
|
|
22191
|
+
parentChannelId: true,
|
|
22192
|
+
parentMessageId: true,
|
|
22193
|
+
creatorId: true,
|
|
22194
|
+
archived: true,
|
|
22195
|
+
lastMessageAt: true,
|
|
22196
|
+
createdAt: true
|
|
22197
|
+
}).partial({ createdAt: true }).strip();
|
|
22198
|
+
var legacyChannelIdentitySchema = CommunityChannelIdentitySchema.extend({
|
|
22199
|
+
archived: legacyArchivedSchema,
|
|
22200
|
+
parentChannelId: nullableId.default(null),
|
|
22201
|
+
parentMessageId: nullableId.default(null),
|
|
22202
|
+
creatorId: nullableId.default(null),
|
|
22203
|
+
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null)
|
|
22204
|
+
});
|
|
22205
|
+
var CommunityAccessDecisionSchema = exports_external.strictObject({
|
|
22206
|
+
channelId: id,
|
|
22207
|
+
canRead: exports_external.boolean(),
|
|
22208
|
+
canSend: exports_external.boolean(),
|
|
22209
|
+
canCreateDiscussion: exports_external.boolean()
|
|
22210
|
+
});
|
|
22211
|
+
var CommunityLegacyMessageAttachmentSchema = exports_external.strictObject({
|
|
22212
|
+
kind: exports_external.enum(["image", "file"]),
|
|
22213
|
+
name: exports_external.string(),
|
|
22214
|
+
url: exports_external.string(),
|
|
22215
|
+
thumbnailUrl: exports_external.string().optional(),
|
|
22216
|
+
contentType: exports_external.string().optional(),
|
|
22217
|
+
size: exports_external.string().optional(),
|
|
22218
|
+
sizeBytes: exports_external.number().nonnegative().optional(),
|
|
22219
|
+
width: exports_external.number().nonnegative().optional(),
|
|
22220
|
+
height: exports_external.number().nonnegative().optional()
|
|
22221
|
+
});
|
|
22222
|
+
var CommunityMessageAttachmentSchema = exports_external.strictObject({
|
|
22223
|
+
id,
|
|
22224
|
+
name: exports_external.string(),
|
|
22225
|
+
url: exports_external.string(),
|
|
22226
|
+
thumbnailUrl: exports_external.string().nullable(),
|
|
22227
|
+
contentType: exports_external.string().nullable(),
|
|
22228
|
+
sizeBytes: exports_external.number().int().nonnegative().nullable(),
|
|
22229
|
+
width: exports_external.number().int().nonnegative().nullable(),
|
|
22230
|
+
height: exports_external.number().int().nonnegative().nullable()
|
|
22231
|
+
});
|
|
22232
|
+
var CommunityMessagePreviewAttachmentSchema = CommunityMessageAttachmentSchema.partial().required({ name: true, url: true });
|
|
22233
|
+
var CommunityResourceProfileSchema = exports_external.strictObject({
|
|
22234
|
+
id,
|
|
22235
|
+
name: exports_external.string(),
|
|
22236
|
+
discriminator: exports_external.string().min(1).nullable(),
|
|
22237
|
+
avatar: exports_external.string().nullable(),
|
|
22238
|
+
avatarVersion: exports_external.number().int().nonnegative(),
|
|
22239
|
+
aboutMe: exports_external.string().optional(),
|
|
22240
|
+
bannerColor: exports_external.string().nullable().optional(),
|
|
22241
|
+
kind: exports_external.enum(["human", "bot"]).optional(),
|
|
22242
|
+
ownerUserId: nullableId.optional(),
|
|
22243
|
+
ownerHandle: exports_external.string().nullable().optional(),
|
|
22244
|
+
mutualServers: exports_external.number().int().nonnegative().optional(),
|
|
22245
|
+
ownedByViewer: exports_external.boolean().optional(),
|
|
22246
|
+
statusEmoji: exports_external.string().nullable().optional(),
|
|
22247
|
+
statusText: exports_external.string().nullable().optional()
|
|
22248
|
+
});
|
|
22249
|
+
var CommunityMessageThreadParticipantSchema = CommunityResourceProfileSchema.pick({ id: true, name: true, avatar: true, avatarVersion: true });
|
|
22250
|
+
var messageThreadSchema = exports_external.strictObject({
|
|
22251
|
+
id,
|
|
22252
|
+
name: CommunityChannelResourceSchema.shape.name,
|
|
22253
|
+
messageCount: CommunityChannelResourceSchema.shape.messageCount,
|
|
22254
|
+
lastReplyAt: CommunityChannelResourceSchema.shape.lastMessageAt.optional(),
|
|
22255
|
+
tags: exports_external.array(exports_external.string()).optional(),
|
|
22256
|
+
preview: exports_external.string().optional(),
|
|
22257
|
+
participants: exports_external.array(CommunityMessageThreadParticipantSchema).optional(),
|
|
22258
|
+
participantCount: exports_external.number().int().nonnegative().optional()
|
|
22259
|
+
});
|
|
22260
|
+
var legacyMessageThreadSchema = messageThreadSchema.extend({
|
|
22261
|
+
name: exports_external.string(),
|
|
22262
|
+
lastReplyAt: exports_external.string().optional(),
|
|
22263
|
+
participants: exports_external.array(CommunityMessageThreadParticipantSchema.extend({ avatar: exports_external.string() })).optional()
|
|
22264
|
+
});
|
|
22265
|
+
var messageThreadPreviewSchema = messageThreadSchema.partial().required({ id: true }).extend({
|
|
22266
|
+
participants: exports_external.array(CommunityMessageThreadParticipantSchema.partial().required({ id: true })).optional()
|
|
22267
|
+
});
|
|
22268
|
+
var CommunityMessageResourceSchema = exports_external.strictObject({
|
|
22269
|
+
id,
|
|
22270
|
+
channelId: id,
|
|
22271
|
+
seq: exports_external.number().int().nonnegative(),
|
|
22272
|
+
authorId: id,
|
|
22273
|
+
createdAt: exports_external.string(),
|
|
22274
|
+
type: exports_external.enum(["chat", "system"]),
|
|
22275
|
+
content: exports_external.string(),
|
|
22276
|
+
replyToId: nullableId,
|
|
22277
|
+
clientNonce: exports_external.string().nullable(),
|
|
22278
|
+
attachments: exports_external.array(CommunityMessageAttachmentSchema),
|
|
22279
|
+
systemKind: exports_external.literal("thread").optional(),
|
|
22280
|
+
authorName: exports_external.string().optional(),
|
|
22281
|
+
authorAvatar: exports_external.string().nullable().optional(),
|
|
22282
|
+
authorAvatarVersion: exports_external.number().int().nonnegative().optional(),
|
|
22283
|
+
mentionType: exports_external.literal("everyone").nullable().optional(),
|
|
22284
|
+
replyTo: exports_external.strictObject({
|
|
22285
|
+
id,
|
|
22286
|
+
authorId: id.optional(),
|
|
22287
|
+
authorName: exports_external.string(),
|
|
22288
|
+
text: exports_external.string(),
|
|
22289
|
+
deleted: exports_external.boolean().optional()
|
|
22290
|
+
}).optional(),
|
|
22291
|
+
embeds: exports_external.array(exports_external.unknown()).optional(),
|
|
22292
|
+
reactions: exports_external.array(exports_external.strictObject({
|
|
22293
|
+
emoji: exports_external.string(),
|
|
22294
|
+
count: exports_external.number().int().nonnegative(),
|
|
22295
|
+
me: exports_external.boolean(),
|
|
22296
|
+
userIds: exports_external.array(id)
|
|
22297
|
+
})).optional(),
|
|
22298
|
+
thread: messageThreadSchema.optional(),
|
|
22299
|
+
approval: FriendApprovalPayloadSchema.optional()
|
|
22300
|
+
});
|
|
22301
|
+
var CommunityMessagePreviewSchema = CommunityMessageResourceSchema.partial().required({
|
|
22302
|
+
id: true,
|
|
22303
|
+
type: true
|
|
22304
|
+
}).extend({ attachments: exports_external.array(CommunityMessagePreviewAttachmentSchema).optional(), thread: messageThreadPreviewSchema.optional() });
|
|
22305
|
+
var CommunityReadStateResourceSchema = exports_external.strictObject({
|
|
22150
22306
|
channelId: id,
|
|
22151
|
-
|
|
22152
|
-
|
|
22307
|
+
lastReadMessageId: nullableId,
|
|
22308
|
+
lastReadAt: exports_external.string().nullable(),
|
|
22309
|
+
lastReadSeq: exports_external.number().int().nonnegative()
|
|
22310
|
+
});
|
|
22311
|
+
var CommunityMemberRelationSchema = exports_external.strictObject({
|
|
22312
|
+
channelId: id,
|
|
22313
|
+
userId: id,
|
|
22314
|
+
relation: exports_external.enum(["access", "notify"]),
|
|
22315
|
+
source: exports_external.string(),
|
|
22316
|
+
isCreator: exports_external.boolean(),
|
|
22317
|
+
role: exports_external.string().nullable(),
|
|
22318
|
+
memberId: nullableId
|
|
22319
|
+
});
|
|
22320
|
+
var CommunityPageSchema = exports_external.strictObject({
|
|
22321
|
+
olderCursor: exports_external.string().nullable(),
|
|
22322
|
+
newerCursor: exports_external.string().nullable(),
|
|
22323
|
+
hasMoreOlder: exports_external.boolean(),
|
|
22324
|
+
hasMoreNewer: exports_external.boolean(),
|
|
22325
|
+
latestSeq: exports_external.number().int().nonnegative()
|
|
22326
|
+
});
|
|
22327
|
+
var envelope = { contractVersion: exports_external.literal(COMMUNITY_RESOURCE_CONTRACT_VERSION), channelId: id };
|
|
22328
|
+
var CommunityChannelReadSchema = exports_external.strictObject({ ...envelope, channel: CommunityChannelResourceSchema, access: CommunityAccessDecisionSchema });
|
|
22329
|
+
var CommunityMessagesReadSchema = exports_external.strictObject({
|
|
22330
|
+
...envelope,
|
|
22331
|
+
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
22332
|
+
page: CommunityPageSchema,
|
|
22333
|
+
surfaceReceipt: exports_external.strictObject({ channelId: id, surfaceKind: exports_external.enum(["channel", "forum", "thread", "dm"]) })
|
|
22334
|
+
});
|
|
22335
|
+
var CommunityMessagePostedSchema = CommunityMessagesReadSchema.pick({ contractVersion: true, channelId: true }).extend({
|
|
22336
|
+
message: CommunityMessageResourceSchema,
|
|
22337
|
+
deduped: exports_external.boolean(),
|
|
22338
|
+
threadId: id.optional()
|
|
22339
|
+
});
|
|
22340
|
+
var CommunityMessageReadSchema = CommunityMessagePostedSchema.omit({ deduped: true, threadId: true });
|
|
22341
|
+
var CommunityReadStateReadSchema = exports_external.strictObject({ ...envelope, readState: CommunityReadStateResourceSchema });
|
|
22342
|
+
var CommunityMembersReadSchema = exports_external.strictObject({ ...envelope, relation: exports_external.enum(["access", "notify"]), members: exports_external.array(CommunityMemberRelationSchema), profiles: exports_external.array(CommunityResourceProfileSchema) });
|
|
22343
|
+
var CommunityThreadsReadSchema = exports_external.strictObject({
|
|
22344
|
+
...envelope,
|
|
22345
|
+
channel: CommunityChannelResourceSchema,
|
|
22346
|
+
threads: exports_external.array(CommunityChannelResourceSchema),
|
|
22347
|
+
included: exports_external.strictObject({
|
|
22348
|
+
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
22349
|
+
members: exports_external.array(CommunityMemberRelationSchema),
|
|
22350
|
+
profiles: exports_external.array(CommunityResourceProfileSchema),
|
|
22351
|
+
tags: exports_external.array(exports_external.strictObject({ messageId: id, tag: exports_external.string() })),
|
|
22352
|
+
participantCounts: exports_external.array(exports_external.strictObject({ channelId: id, count: exports_external.number().int().nonnegative() }))
|
|
22353
|
+
}),
|
|
22354
|
+
page: exports_external.strictObject({ nextCursor: exports_external.string().nullable(), hasMore: exports_external.boolean() })
|
|
22355
|
+
});
|
|
22356
|
+
var CommunityReadAdvanceSchema = exports_external.strictObject({ ...envelope, changed: exports_external.boolean(), targetSeq: exports_external.number().int().nonnegative(), revision: exports_external.number().int().nonnegative() });
|
|
22357
|
+
var CommunityReadErrorSchema = exports_external.strictObject({ contractVersion: exports_external.literal(COMMUNITY_RESOURCE_CONTRACT_VERSION), error: exports_external.strictObject({
|
|
22358
|
+
code: exports_external.enum(["invalid_input", "invalid_reply_target", "unauthenticated", "not_found", "not_allowed", "blocked", "idempotency_conflict", "rate_limited", "temporarily_unavailable"]),
|
|
22359
|
+
message: exports_external.string(),
|
|
22360
|
+
retryable: exports_external.boolean()
|
|
22361
|
+
}) });
|
|
22362
|
+
var legacyProfileSchema = CommunityResourceProfileSchema.pick({
|
|
22363
|
+
id: true,
|
|
22364
|
+
name: true,
|
|
22365
|
+
avatar: true,
|
|
22366
|
+
avatarVersion: true
|
|
22367
|
+
}).extend({ discriminator: exports_external.string().nullable(), statusEmoji: exports_external.string().nullable(), statusText: exports_external.string() });
|
|
22368
|
+
var CommunityLegacyMessageResourceSchema = CommunityMessageResourceSchema.extend({ authorAvatar: exports_external.string().optional(), attachments: exports_external.array(CommunityLegacyMessageAttachmentSchema), thread: legacyMessageThreadSchema.optional() });
|
|
22369
|
+
var legacyEnvelope = { contractVersion: exports_external.literal(2), channelId: id };
|
|
22370
|
+
var legacyReadSchemas = {
|
|
22371
|
+
channel: CommunityChannelReadSchema.extend(legacyEnvelope),
|
|
22372
|
+
messages: CommunityMessagesReadSchema.extend({ ...legacyEnvelope, messages: exports_external.array(CommunityLegacyMessageResourceSchema) }),
|
|
22373
|
+
readState: CommunityReadStateReadSchema.extend(legacyEnvelope),
|
|
22374
|
+
members: CommunityMembersReadSchema.extend({ ...legacyEnvelope, profiles: exports_external.array(legacyProfileSchema) }),
|
|
22375
|
+
threads: CommunityThreadsReadSchema.extend({ ...legacyEnvelope, included: CommunityThreadsReadSchema.shape.included.extend({
|
|
22376
|
+
messages: exports_external.array(CommunityLegacyMessageResourceSchema),
|
|
22377
|
+
profiles: exports_external.array(legacyProfileSchema)
|
|
22378
|
+
}) }),
|
|
22379
|
+
readAdvance: CommunityReadAdvanceSchema.extend(legacyEnvelope),
|
|
22380
|
+
error: CommunityReadErrorSchema.extend({ contractVersion: exports_external.literal(2) })
|
|
22381
|
+
};
|
|
22382
|
+
var legacyChannelResourcePreviewSchema = CommunityChannelResourceSchema.partial().strip().extend({
|
|
22383
|
+
archived: legacyArchivedSchema.optional()
|
|
22384
|
+
});
|
|
22385
|
+
var legacyChannelResourceSchema = CommunityChannelResourceSchema.strip().extend({
|
|
22386
|
+
topic: CommunityChannelResourceSchema.shape.topic.nullish().transform((value) => value ?? ""),
|
|
22387
|
+
position: CommunityChannelResourceSchema.shape.position.nullish().transform((value) => value ?? 0),
|
|
22388
|
+
messageCount: CommunityChannelResourceSchema.shape.messageCount.nullish().transform((value) => value ?? 0),
|
|
22389
|
+
categoryId: nullableId.default(null),
|
|
22390
|
+
parentChannelId: nullableId.default(null),
|
|
22391
|
+
parentMessageId: nullableId.default(null),
|
|
22392
|
+
creatorId: nullableId.default(null),
|
|
22393
|
+
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null),
|
|
22394
|
+
archived: legacyArchivedSchema
|
|
22395
|
+
});
|
|
22396
|
+
var legacyMessageResourceSchema = CommunityLegacyMessageResourceSchema.strip().extend({
|
|
22397
|
+
channelId: id.optional(),
|
|
22398
|
+
replyToId: nullableId.optional(),
|
|
22399
|
+
clientNonce: CommunityMessageResourceSchema.shape.clientNonce.default(null),
|
|
22400
|
+
attachments: CommunityLegacyMessageResourceSchema.shape.attachments.default([]),
|
|
22401
|
+
embeds: CommunityMessageResourceSchema.shape.embeds.nullable().transform((value) => value ?? undefined)
|
|
22402
|
+
});
|
|
22403
|
+
|
|
22404
|
+
// ../shared/src/community-attention.ts
|
|
22405
|
+
var id2 = exports_external.string().min(1);
|
|
22406
|
+
var AttentionScopeSchema = exports_external.strictObject({
|
|
22407
|
+
scopeId: id2,
|
|
22408
|
+
channelId: id2,
|
|
22409
|
+
serverId: id2.nullable().optional(),
|
|
22410
|
+
parentChannelId: id2.nullable().optional(),
|
|
22153
22411
|
ordinaryUnread: exports_external.boolean(),
|
|
22154
22412
|
lastUnreadSeq: exports_external.number().int().nonnegative(),
|
|
22155
22413
|
lastAttentionSeq: exports_external.number().int().nonnegative().nullable().optional(),
|
|
22156
22414
|
attentionCount: exports_external.number().int().nonnegative()
|
|
22157
22415
|
});
|
|
22158
22416
|
var AttentionItemSchema = exports_external.strictObject({
|
|
22159
|
-
id,
|
|
22417
|
+
id: id2,
|
|
22160
22418
|
kind: exports_external.enum(["mention", "reply", "friend_request", "forum_post"]),
|
|
22161
|
-
sourceId:
|
|
22162
|
-
scopeId:
|
|
22163
|
-
messageId:
|
|
22164
|
-
actorUserId:
|
|
22419
|
+
sourceId: id2,
|
|
22420
|
+
scopeId: id2.nullable().optional(),
|
|
22421
|
+
messageId: id2.nullable().optional(),
|
|
22422
|
+
actorUserId: id2.nullable().optional(),
|
|
22165
22423
|
createdAt: exports_external.string(),
|
|
22166
|
-
childChannelId:
|
|
22424
|
+
childChannelId: id2.optional(),
|
|
22167
22425
|
openerSeq: exports_external.number().int().nonnegative().optional(),
|
|
22168
22426
|
readTarget: exports_external.strictObject({
|
|
22169
|
-
channelId:
|
|
22427
|
+
channelId: id2,
|
|
22170
22428
|
seq: exports_external.number().int().nonnegative()
|
|
22171
22429
|
}).optional()
|
|
22172
22430
|
}).superRefine((item, ctx) => {
|
|
@@ -22196,26 +22454,30 @@ var AttentionItemSchema = exports_external.strictObject({
|
|
|
22196
22454
|
}
|
|
22197
22455
|
});
|
|
22198
22456
|
var AttentionIncludedServerSchema = exports_external.strictObject({
|
|
22199
|
-
id,
|
|
22457
|
+
id: id2,
|
|
22200
22458
|
name: exports_external.string(),
|
|
22201
22459
|
discriminator: exports_external.string()
|
|
22202
22460
|
});
|
|
22203
|
-
var AttentionIncludedChannelSchema =
|
|
22204
|
-
id,
|
|
22205
|
-
serverId:
|
|
22206
|
-
name:
|
|
22207
|
-
type:
|
|
22208
|
-
parentChannelId:
|
|
22209
|
-
parentMessageId:
|
|
22210
|
-
creatorId:
|
|
22211
|
-
archived:
|
|
22212
|
-
lastMessageAt:
|
|
22461
|
+
var AttentionIncludedChannelSchema = CommunityChannelResourceSchema.pick({
|
|
22462
|
+
id: true,
|
|
22463
|
+
serverId: true,
|
|
22464
|
+
name: true,
|
|
22465
|
+
type: true,
|
|
22466
|
+
parentChannelId: true,
|
|
22467
|
+
parentMessageId: true,
|
|
22468
|
+
creatorId: true,
|
|
22469
|
+
archived: true,
|
|
22470
|
+
lastMessageAt: true
|
|
22471
|
+
}).extend({
|
|
22472
|
+
serverId: CommunityChannelResourceSchema.shape.serverId.unwrap(),
|
|
22473
|
+
name: CommunityChannelResourceSchema.shape.name.unwrap(),
|
|
22474
|
+
type: CommunityChannelResourceSchema.shape.type.extract(["text", "forum", "thread"]),
|
|
22213
22475
|
openerSeq: exports_external.number().int().nonnegative().optional(),
|
|
22214
22476
|
openerUnread: exports_external.boolean().optional()
|
|
22215
22477
|
});
|
|
22216
22478
|
var AttentionIncludedDmSchema = exports_external.strictObject({
|
|
22217
|
-
id,
|
|
22218
|
-
userId:
|
|
22479
|
+
id: id2,
|
|
22480
|
+
userId: id2,
|
|
22219
22481
|
name: exports_external.string(),
|
|
22220
22482
|
discriminator: exports_external.string(),
|
|
22221
22483
|
avatar: exports_external.string(),
|
|
@@ -22224,22 +22486,21 @@ var AttentionIncludedDmSchema = exports_external.strictObject({
|
|
|
22224
22486
|
lastUnreadSeq: exports_external.number().int().nonnegative()
|
|
22225
22487
|
});
|
|
22226
22488
|
var AttentionIncludedProfileSchema = exports_external.strictObject({
|
|
22227
|
-
userId: id,
|
|
22228
|
-
name:
|
|
22489
|
+
userId: CommunityResourceProfileSchema.shape.id,
|
|
22490
|
+
...CommunityResourceProfileSchema.pick({ name: true, discriminator: true, avatar: true, avatarVersion: true }).shape,
|
|
22229
22491
|
discriminator: exports_external.string(),
|
|
22230
|
-
avatar: exports_external.string()
|
|
22231
|
-
avatarVersion: exports_external.number().int().nonnegative()
|
|
22232
|
-
});
|
|
22233
|
-
var AttentionIncludedMessageSchema = exports_external.strictObject({
|
|
22234
|
-
id,
|
|
22235
|
-
channelId: id,
|
|
22236
|
-
type: exports_external.enum(["chat", "system"]),
|
|
22237
|
-
authorId: id.optional(),
|
|
22238
|
-
authorName: exports_external.string().optional(),
|
|
22239
|
-
seq: exports_external.number().int().nonnegative(),
|
|
22240
|
-
createdAt: exports_external.string(),
|
|
22241
|
-
content: exports_external.string()
|
|
22492
|
+
avatar: exports_external.string()
|
|
22242
22493
|
});
|
|
22494
|
+
var AttentionIncludedMessageSchema = CommunityMessagePreviewSchema.pick({
|
|
22495
|
+
id: true,
|
|
22496
|
+
channelId: true,
|
|
22497
|
+
type: true,
|
|
22498
|
+
authorId: true,
|
|
22499
|
+
authorName: true,
|
|
22500
|
+
seq: true,
|
|
22501
|
+
createdAt: true,
|
|
22502
|
+
content: true
|
|
22503
|
+
}).required({ channelId: true, seq: true, createdAt: true, content: true });
|
|
22243
22504
|
var AttentionIncludedSchema = exports_external.strictObject({
|
|
22244
22505
|
servers: exports_external.array(AttentionIncludedServerSchema),
|
|
22245
22506
|
channels: exports_external.array(AttentionIncludedChannelSchema),
|
|
@@ -22265,7 +22526,7 @@ var AccountAttentionSnapshotSchema = exports_external.strictObject({
|
|
|
22265
22526
|
const serverById = new Map(snapshot.included.servers.map((server) => [server.id, server]));
|
|
22266
22527
|
const channelById = new Map(snapshot.included.channels.map((channel2) => [channel2.id, channel2]));
|
|
22267
22528
|
const dmById = new Map(snapshot.included.dms.map((dm) => [dm.id, dm]));
|
|
22268
|
-
const profileById = new Map(snapshot.included.profiles.map((
|
|
22529
|
+
const profileById = new Map(snapshot.included.profiles.map((profile2) => [profile2.userId, profile2]));
|
|
22269
22530
|
const messageById = new Map(snapshot.included.messages.map((message2) => [message2.id, message2]));
|
|
22270
22531
|
const rejectDuplicates = (values, kind) => {
|
|
22271
22532
|
const seen = new Set;
|
|
@@ -22278,7 +22539,7 @@ var AccountAttentionSnapshotSchema = exports_external.strictObject({
|
|
|
22278
22539
|
rejectDuplicates(snapshot.included.servers.map((server) => server.id), "server");
|
|
22279
22540
|
rejectDuplicates(snapshot.included.channels.map((channel2) => channel2.id), "channel");
|
|
22280
22541
|
rejectDuplicates(snapshot.included.dms.map((dm) => dm.id), "dm");
|
|
22281
|
-
rejectDuplicates(snapshot.included.profiles.map((
|
|
22542
|
+
rejectDuplicates(snapshot.included.profiles.map((profile2) => profile2.userId), "profile");
|
|
22282
22543
|
rejectDuplicates(snapshot.included.messages.map((message2) => message2.id), "message");
|
|
22283
22544
|
for (const scope of snapshot.scopes) {
|
|
22284
22545
|
if (scope.serverId) {
|
|
@@ -23090,15 +23351,15 @@ var CommunityMachineRuntimeListSchema = exports_external.array(CommunityMachineR
|
|
|
23090
23351
|
var CommunityRunningAgentListSchema = exports_external.array(exports_external.string()).transform((list) => {
|
|
23091
23352
|
const seen = new Set;
|
|
23092
23353
|
const out = [];
|
|
23093
|
-
for (const
|
|
23094
|
-
if (seen.has(
|
|
23354
|
+
for (const id3 of list) {
|
|
23355
|
+
if (seen.has(id3))
|
|
23095
23356
|
continue;
|
|
23096
|
-
seen.add(
|
|
23097
|
-
out.push(
|
|
23357
|
+
seen.add(id3);
|
|
23358
|
+
out.push(id3);
|
|
23098
23359
|
}
|
|
23099
23360
|
return out;
|
|
23100
23361
|
});
|
|
23101
|
-
var CommunityMachineSummarySchema = exports_external.
|
|
23362
|
+
var CommunityMachineSummarySchema = exports_external.strictObject({
|
|
23102
23363
|
id: exports_external.string(),
|
|
23103
23364
|
hostname: exports_external.string(),
|
|
23104
23365
|
displayName: exports_external.string(),
|
|
@@ -23108,8 +23369,8 @@ var CommunityMachineSummarySchema = exports_external.object({
|
|
|
23108
23369
|
daemonVersion: exports_external.string(),
|
|
23109
23370
|
lastSeenAt: exports_external.string().nullable(),
|
|
23110
23371
|
status: exports_external.enum(["online", "offline"]),
|
|
23111
|
-
availableRuntimes: exports_external.array(CommunityMachineRuntimeSchema
|
|
23112
|
-
lastRuntimeError: exports_external.
|
|
23372
|
+
availableRuntimes: exports_external.array(CommunityMachineRuntimeSchema.strict()),
|
|
23373
|
+
lastRuntimeError: exports_external.strictObject({
|
|
23113
23374
|
requested: exports_external.string(),
|
|
23114
23375
|
available: exports_external.array(exports_external.string()),
|
|
23115
23376
|
at: exports_external.string()
|
|
@@ -24049,203 +24310,6 @@ var AGENT_UNREAD_CHANNEL_CHUNK_SIZE = maxInParams(13);
|
|
|
24049
24310
|
|
|
24050
24311
|
// ../shared/src/db/queries/community/mention.ts
|
|
24051
24312
|
var MENTION_INSERT_MAX_ROWS = maxRowsPerInsert(5);
|
|
24052
|
-
// ../shared/src/community-friend-approval.ts
|
|
24053
|
-
var profile = exports_external.strictObject({
|
|
24054
|
-
id: exports_external.string(),
|
|
24055
|
-
name: exports_external.string(),
|
|
24056
|
-
discriminator: exports_external.string(),
|
|
24057
|
-
image: exports_external.string().nullable(),
|
|
24058
|
-
avatarVersion: exports_external.number().int().nonnegative()
|
|
24059
|
-
});
|
|
24060
|
-
var FriendApprovalPayloadSchema = exports_external.strictObject({
|
|
24061
|
-
friendshipId: exports_external.string(),
|
|
24062
|
-
status: exports_external.enum(["pending", "approved", "denied", "superseded", "cancelled"]),
|
|
24063
|
-
waitingOn: exports_external.enum(["you", "other-owner", "addressee"]).nullable(),
|
|
24064
|
-
otherProfile: profile,
|
|
24065
|
-
botProfile: profile,
|
|
24066
|
-
waitingOnProfile: profile.nullable().optional()
|
|
24067
|
-
});
|
|
24068
|
-
|
|
24069
|
-
// ../shared/src/community-contract.ts
|
|
24070
|
-
var COMMUNITY_CONTRACT_VERSION = 2;
|
|
24071
|
-
|
|
24072
|
-
// ../shared/src/community-resources.ts
|
|
24073
|
-
var id2 = exports_external.string().min(1);
|
|
24074
|
-
var nullableId = id2.nullable();
|
|
24075
|
-
var legacyArchivedSchema = exports_external.union([exports_external.boolean(), exports_external.literal(0), exports_external.literal(1)]).transform((value) => value === true || value === 1);
|
|
24076
|
-
var CommunityChannelResourceSchema = exports_external.strictObject({
|
|
24077
|
-
id: id2,
|
|
24078
|
-
type: exports_external.enum(["text", "forum", "thread", "dm"]),
|
|
24079
|
-
serverId: nullableId,
|
|
24080
|
-
categoryId: nullableId,
|
|
24081
|
-
name: exports_external.string().nullable(),
|
|
24082
|
-
topic: exports_external.string(),
|
|
24083
|
-
parentChannelId: nullableId,
|
|
24084
|
-
parentMessageId: nullableId,
|
|
24085
|
-
creatorId: nullableId,
|
|
24086
|
-
position: exports_external.number(),
|
|
24087
|
-
archived: exports_external.boolean(),
|
|
24088
|
-
createdAt: exports_external.string(),
|
|
24089
|
-
lastMessageAt: exports_external.string().nullable(),
|
|
24090
|
-
messageCount: exports_external.number().int().nonnegative()
|
|
24091
|
-
});
|
|
24092
|
-
var CommunityChannelIdentitySchema = CommunityChannelResourceSchema.pick({
|
|
24093
|
-
id: true,
|
|
24094
|
-
type: true,
|
|
24095
|
-
serverId: true,
|
|
24096
|
-
name: true,
|
|
24097
|
-
parentChannelId: true,
|
|
24098
|
-
parentMessageId: true,
|
|
24099
|
-
creatorId: true,
|
|
24100
|
-
archived: true,
|
|
24101
|
-
lastMessageAt: true,
|
|
24102
|
-
createdAt: true
|
|
24103
|
-
}).partial({ createdAt: true }).strip();
|
|
24104
|
-
var legacyChannelIdentitySchema = CommunityChannelIdentitySchema.extend({
|
|
24105
|
-
archived: legacyArchivedSchema,
|
|
24106
|
-
parentChannelId: nullableId.default(null),
|
|
24107
|
-
parentMessageId: nullableId.default(null),
|
|
24108
|
-
creatorId: nullableId.default(null),
|
|
24109
|
-
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null)
|
|
24110
|
-
});
|
|
24111
|
-
var CommunityAccessDecisionSchema = exports_external.strictObject({
|
|
24112
|
-
channelId: id2,
|
|
24113
|
-
canRead: exports_external.boolean(),
|
|
24114
|
-
canSend: exports_external.boolean(),
|
|
24115
|
-
canCreateDiscussion: exports_external.boolean()
|
|
24116
|
-
});
|
|
24117
|
-
var CommunityMessageAttachmentSchema = exports_external.strictObject({
|
|
24118
|
-
kind: exports_external.enum(["image", "file"]),
|
|
24119
|
-
name: exports_external.string(),
|
|
24120
|
-
url: exports_external.string(),
|
|
24121
|
-
thumbnailUrl: exports_external.string().optional(),
|
|
24122
|
-
contentType: exports_external.string().optional(),
|
|
24123
|
-
size: exports_external.string().optional(),
|
|
24124
|
-
sizeBytes: exports_external.number().nonnegative().optional(),
|
|
24125
|
-
width: exports_external.number().nonnegative().optional(),
|
|
24126
|
-
height: exports_external.number().nonnegative().optional()
|
|
24127
|
-
});
|
|
24128
|
-
var CommunityMessageResourceSchema = exports_external.strictObject({
|
|
24129
|
-
id: id2,
|
|
24130
|
-
channelId: id2,
|
|
24131
|
-
seq: exports_external.number().int().nonnegative(),
|
|
24132
|
-
authorId: id2,
|
|
24133
|
-
createdAt: exports_external.string(),
|
|
24134
|
-
type: exports_external.enum(["chat", "system"]),
|
|
24135
|
-
content: exports_external.string(),
|
|
24136
|
-
replyToId: nullableId,
|
|
24137
|
-
clientNonce: exports_external.string().nullable(),
|
|
24138
|
-
attachments: exports_external.array(CommunityMessageAttachmentSchema),
|
|
24139
|
-
systemKind: exports_external.literal("thread").optional(),
|
|
24140
|
-
authorName: exports_external.string().optional(),
|
|
24141
|
-
authorAvatar: exports_external.string().optional(),
|
|
24142
|
-
authorAvatarVersion: exports_external.number().int().nonnegative().optional(),
|
|
24143
|
-
mentionType: exports_external.literal("everyone").nullable().optional(),
|
|
24144
|
-
replyTo: exports_external.strictObject({
|
|
24145
|
-
id: id2,
|
|
24146
|
-
authorId: id2.optional(),
|
|
24147
|
-
authorName: exports_external.string(),
|
|
24148
|
-
text: exports_external.string(),
|
|
24149
|
-
deleted: exports_external.boolean().optional()
|
|
24150
|
-
}).optional(),
|
|
24151
|
-
embeds: exports_external.array(exports_external.unknown()).optional(),
|
|
24152
|
-
reactions: exports_external.array(exports_external.strictObject({
|
|
24153
|
-
emoji: exports_external.string(),
|
|
24154
|
-
count: exports_external.number().int().nonnegative(),
|
|
24155
|
-
me: exports_external.boolean(),
|
|
24156
|
-
userIds: exports_external.array(id2)
|
|
24157
|
-
})).optional(),
|
|
24158
|
-
thread: exports_external.strictObject({
|
|
24159
|
-
id: id2,
|
|
24160
|
-
name: exports_external.string(),
|
|
24161
|
-
messageCount: exports_external.number().int().nonnegative(),
|
|
24162
|
-
lastReplyAt: exports_external.string().optional(),
|
|
24163
|
-
tags: exports_external.array(exports_external.string()).optional(),
|
|
24164
|
-
preview: exports_external.string().optional(),
|
|
24165
|
-
participants: exports_external.array(exports_external.strictObject({ id: id2, name: exports_external.string(), avatar: exports_external.string(), avatarVersion: exports_external.number().int().nonnegative() })).optional(),
|
|
24166
|
-
participantCount: exports_external.number().int().nonnegative().optional()
|
|
24167
|
-
}).optional(),
|
|
24168
|
-
approval: FriendApprovalPayloadSchema.optional()
|
|
24169
|
-
});
|
|
24170
|
-
var CommunityReadStateResourceSchema = exports_external.strictObject({
|
|
24171
|
-
channelId: id2,
|
|
24172
|
-
lastReadMessageId: nullableId,
|
|
24173
|
-
lastReadAt: exports_external.string().nullable(),
|
|
24174
|
-
lastReadSeq: exports_external.number().int().nonnegative()
|
|
24175
|
-
});
|
|
24176
|
-
var CommunityMemberRelationSchema = exports_external.strictObject({
|
|
24177
|
-
channelId: id2,
|
|
24178
|
-
userId: id2,
|
|
24179
|
-
relation: exports_external.enum(["access", "notify"]),
|
|
24180
|
-
source: exports_external.string(),
|
|
24181
|
-
isCreator: exports_external.boolean(),
|
|
24182
|
-
role: exports_external.string().nullable(),
|
|
24183
|
-
memberId: nullableId
|
|
24184
|
-
});
|
|
24185
|
-
var CommunityResourceProfileSchema = exports_external.strictObject({
|
|
24186
|
-
id: id2,
|
|
24187
|
-
name: exports_external.string(),
|
|
24188
|
-
discriminator: exports_external.string().nullable(),
|
|
24189
|
-
avatar: exports_external.string().nullable(),
|
|
24190
|
-
avatarVersion: exports_external.number().int().nonnegative(),
|
|
24191
|
-
statusEmoji: exports_external.string().nullable(),
|
|
24192
|
-
statusText: exports_external.string()
|
|
24193
|
-
});
|
|
24194
|
-
var CommunityPageSchema = exports_external.strictObject({
|
|
24195
|
-
olderCursor: exports_external.string().nullable(),
|
|
24196
|
-
newerCursor: exports_external.string().nullable(),
|
|
24197
|
-
hasMoreOlder: exports_external.boolean(),
|
|
24198
|
-
hasMoreNewer: exports_external.boolean(),
|
|
24199
|
-
latestSeq: exports_external.number().int().nonnegative()
|
|
24200
|
-
});
|
|
24201
|
-
var envelope = { contractVersion: exports_external.literal(COMMUNITY_CONTRACT_VERSION), channelId: id2 };
|
|
24202
|
-
var CommunityChannelReadSchema = exports_external.strictObject({ ...envelope, channel: CommunityChannelResourceSchema, access: CommunityAccessDecisionSchema });
|
|
24203
|
-
var CommunityMessagesReadSchema = exports_external.strictObject({
|
|
24204
|
-
...envelope,
|
|
24205
|
-
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
24206
|
-
page: CommunityPageSchema,
|
|
24207
|
-
surfaceReceipt: exports_external.strictObject({ channelId: id2, surfaceKind: exports_external.enum(["channel", "forum", "thread", "dm"]) })
|
|
24208
|
-
});
|
|
24209
|
-
var CommunityReadStateReadSchema = exports_external.strictObject({ ...envelope, readState: CommunityReadStateResourceSchema });
|
|
24210
|
-
var CommunityMembersReadSchema = exports_external.strictObject({ ...envelope, relation: exports_external.enum(["access", "notify"]), members: exports_external.array(CommunityMemberRelationSchema), profiles: exports_external.array(CommunityResourceProfileSchema) });
|
|
24211
|
-
var CommunityThreadsReadSchema = exports_external.strictObject({
|
|
24212
|
-
...envelope,
|
|
24213
|
-
channel: CommunityChannelResourceSchema,
|
|
24214
|
-
threads: exports_external.array(CommunityChannelResourceSchema),
|
|
24215
|
-
included: exports_external.strictObject({
|
|
24216
|
-
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
24217
|
-
members: exports_external.array(CommunityMemberRelationSchema),
|
|
24218
|
-
profiles: exports_external.array(CommunityResourceProfileSchema),
|
|
24219
|
-
tags: exports_external.array(exports_external.strictObject({ messageId: id2, tag: exports_external.string() })),
|
|
24220
|
-
participantCounts: exports_external.array(exports_external.strictObject({ channelId: id2, count: exports_external.number().int().nonnegative() }))
|
|
24221
|
-
}),
|
|
24222
|
-
page: exports_external.strictObject({ nextCursor: exports_external.string().nullable(), hasMore: exports_external.boolean() })
|
|
24223
|
-
});
|
|
24224
|
-
var CommunityReadAdvanceSchema = exports_external.strictObject({ ...envelope, changed: exports_external.boolean(), targetSeq: exports_external.number().int().nonnegative(), revision: exports_external.number().int().nonnegative() });
|
|
24225
|
-
var CommunityReadErrorSchema = exports_external.strictObject({ contractVersion: exports_external.literal(COMMUNITY_CONTRACT_VERSION), error: exports_external.strictObject({
|
|
24226
|
-
code: exports_external.enum(["invalid_input", "invalid_reply_target", "unauthenticated", "not_found", "not_allowed", "blocked", "idempotency_conflict", "rate_limited", "temporarily_unavailable"]),
|
|
24227
|
-
message: exports_external.string(),
|
|
24228
|
-
retryable: exports_external.boolean()
|
|
24229
|
-
}) });
|
|
24230
|
-
var legacyChannelResourceSchema = CommunityChannelResourceSchema.strip().extend({
|
|
24231
|
-
topic: CommunityChannelResourceSchema.shape.topic.nullish().transform((value) => value ?? ""),
|
|
24232
|
-
position: CommunityChannelResourceSchema.shape.position.nullish().transform((value) => value ?? 0),
|
|
24233
|
-
messageCount: CommunityChannelResourceSchema.shape.messageCount.nullish().transform((value) => value ?? 0),
|
|
24234
|
-
categoryId: nullableId.default(null),
|
|
24235
|
-
parentChannelId: nullableId.default(null),
|
|
24236
|
-
parentMessageId: nullableId.default(null),
|
|
24237
|
-
creatorId: nullableId.default(null),
|
|
24238
|
-
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null),
|
|
24239
|
-
archived: legacyArchivedSchema
|
|
24240
|
-
});
|
|
24241
|
-
var legacyMessageResourceSchema = CommunityMessageResourceSchema.strip().extend({
|
|
24242
|
-
channelId: id2.optional(),
|
|
24243
|
-
replyToId: nullableId.optional(),
|
|
24244
|
-
clientNonce: CommunityMessageResourceSchema.shape.clientNonce.default(null),
|
|
24245
|
-
attachments: CommunityMessageResourceSchema.shape.attachments.default([]),
|
|
24246
|
-
embeds: CommunityMessageResourceSchema.shape.embeds.nullable().transform((value) => value ?? undefined)
|
|
24247
|
-
});
|
|
24248
|
-
|
|
24249
24313
|
// ../shared/src/community-ws-events.ts
|
|
24250
24314
|
var string4 = exports_external.string();
|
|
24251
24315
|
var nullableString = string4.nullable();
|
|
@@ -24275,6 +24339,7 @@ var messageSchema = CommunityMessageResourceSchema.pick({
|
|
|
24275
24339
|
seq: exports_external.number(),
|
|
24276
24340
|
authorId: string4,
|
|
24277
24341
|
authorName: string4,
|
|
24342
|
+
authorAvatar: string4.optional(),
|
|
24278
24343
|
authorAvatarVersion: CommunityMessageResourceSchema.shape.authorAvatarVersion.unwrap(),
|
|
24279
24344
|
replyToId: nullableString.optional(),
|
|
24280
24345
|
replyTo: CommunityMessageResourceSchema.shape.replyTo.unwrap().extend({
|
|
@@ -24284,7 +24349,7 @@ var messageSchema = CommunityMessageResourceSchema.pick({
|
|
|
24284
24349
|
attachments: exports_external.array(messageAttachmentSchema).optional(),
|
|
24285
24350
|
clientNonce: string4.optional()
|
|
24286
24351
|
});
|
|
24287
|
-
var
|
|
24352
|
+
var CommunityLegacyMessageCreateSchema = exports_external.strictObject({
|
|
24288
24353
|
type: exports_external.literal("community:message.create"),
|
|
24289
24354
|
channelId: string4,
|
|
24290
24355
|
serverId: string4.optional(),
|
|
@@ -24596,29 +24661,9 @@ var communityProfileUpdateSchema = exports_external.strictObject({
|
|
|
24596
24661
|
kind: exports_external.enum(["human", "bot"]),
|
|
24597
24662
|
ownerUserId: nullableString
|
|
24598
24663
|
});
|
|
24599
|
-
var machineRuntimeSchema = CommunityMachineRuntimeSchema.strict();
|
|
24600
|
-
var CommunityMachineSummarySchema2 = exports_external.strictObject({
|
|
24601
|
-
id: string4,
|
|
24602
|
-
hostname: string4,
|
|
24603
|
-
displayName: string4,
|
|
24604
|
-
platform: string4,
|
|
24605
|
-
arch: string4,
|
|
24606
|
-
osRelease: string4,
|
|
24607
|
-
daemonVersion: string4,
|
|
24608
|
-
lastSeenAt: nullableString,
|
|
24609
|
-
status: exports_external.enum(["online", "offline"]),
|
|
24610
|
-
availableRuntimes: exports_external.array(machineRuntimeSchema),
|
|
24611
|
-
lastRuntimeError: exports_external.strictObject({
|
|
24612
|
-
requested: string4,
|
|
24613
|
-
available: exports_external.array(string4),
|
|
24614
|
-
at: string4
|
|
24615
|
-
}).optional(),
|
|
24616
|
-
createdAt: string4,
|
|
24617
|
-
updatedAt: string4
|
|
24618
|
-
});
|
|
24619
24664
|
var communityMachineCreatedSchema = exports_external.strictObject({
|
|
24620
24665
|
type: exports_external.literal("community:machine.created"),
|
|
24621
|
-
machine:
|
|
24666
|
+
machine: CommunityMachineSummarySchema,
|
|
24622
24667
|
tokenId: string4
|
|
24623
24668
|
});
|
|
24624
24669
|
var communityMachineStatusSchema = exports_external.strictObject({
|
|
@@ -24629,7 +24674,7 @@ var communityMachineStatusSchema = exports_external.strictObject({
|
|
|
24629
24674
|
});
|
|
24630
24675
|
var communityMachineUpdatedSchema = exports_external.strictObject({
|
|
24631
24676
|
type: exports_external.literal("community:machine.updated"),
|
|
24632
|
-
machine:
|
|
24677
|
+
machine: CommunityMachineSummarySchema
|
|
24633
24678
|
});
|
|
24634
24679
|
var communityMachineRemovedSchema = exports_external.strictObject({
|
|
24635
24680
|
type: exports_external.literal("community:machine.removed"),
|
|
@@ -24645,8 +24690,7 @@ var communityBotAuditEventSchema = exports_external.strictObject({
|
|
|
24645
24690
|
launchId: nullableString.optional(),
|
|
24646
24691
|
createdAt: string4
|
|
24647
24692
|
}).refine((event) => Object.prototype.hasOwnProperty.call(event, "payload"));
|
|
24648
|
-
var
|
|
24649
|
-
communityMessageCreateSchema,
|
|
24693
|
+
var commonCommunityEventSchemas = [
|
|
24650
24694
|
communityMessageUpdatedSchema,
|
|
24651
24695
|
communityMessageEditedSchema,
|
|
24652
24696
|
communityReactionAddSchema,
|
|
@@ -24655,12 +24699,8 @@ var CommunityWsEventDiscriminatedSchema = exports_external.discriminatedUnion("t
|
|
|
24655
24699
|
communityPinRemoveSchema,
|
|
24656
24700
|
communityTypingStartSchema,
|
|
24657
24701
|
communityTypingStopSchema,
|
|
24658
|
-
communityChildChannelCreateSchema,
|
|
24659
|
-
communityChildChannelUpdateSchema,
|
|
24660
24702
|
communityServerUpdateSchema,
|
|
24661
24703
|
communityServerDeleteSchema,
|
|
24662
|
-
communityChannelCreateSchema,
|
|
24663
|
-
communityChannelUpdateSchema,
|
|
24664
24704
|
communityChannelDeleteSchema,
|
|
24665
24705
|
communityChannelReorderSchema,
|
|
24666
24706
|
communityChannelMemberAddSchema,
|
|
@@ -24685,15 +24725,34 @@ var CommunityWsEventDiscriminatedSchema = exports_external.discriminatedUnion("t
|
|
|
24685
24725
|
communityInboxChangedSchema,
|
|
24686
24726
|
communityPresenceUpdateSchema,
|
|
24687
24727
|
communityStatusUpdateSchema,
|
|
24688
|
-
communityIdentityUpdateSchema,
|
|
24689
|
-
communityProfileUpdateSchema,
|
|
24690
24728
|
communityMachineCreatedSchema,
|
|
24691
24729
|
communityMachineStatusSchema,
|
|
24692
24730
|
communityMachineUpdatedSchema,
|
|
24693
24731
|
communityMachineRemovedSchema,
|
|
24694
24732
|
communityBotAuditEventSchema
|
|
24733
|
+
];
|
|
24734
|
+
var CommunityWsEventDiscriminatedSchema = exports_external.discriminatedUnion("type", [
|
|
24735
|
+
...commonCommunityEventSchemas,
|
|
24736
|
+
CommunityLegacyMessageCreateSchema,
|
|
24737
|
+
communityChildChannelCreateSchema,
|
|
24738
|
+
communityChannelCreateSchema,
|
|
24739
|
+
communityChildChannelUpdateSchema,
|
|
24740
|
+
communityChannelUpdateSchema,
|
|
24741
|
+
communityIdentityUpdateSchema,
|
|
24742
|
+
communityProfileUpdateSchema
|
|
24743
|
+
]);
|
|
24744
|
+
var CommunityResourceWsEventDiscriminatedSchema = exports_external.discriminatedUnion("type", [
|
|
24745
|
+
...commonCommunityEventSchemas,
|
|
24746
|
+
CommunityLegacyMessageCreateSchema.extend({ message: CommunityMessageResourceSchema.required({ authorName: true, authorAvatarVersion: true }) }).refine((event) => event.message.channelId === event.channelId),
|
|
24747
|
+
communityChildChannelCreateSchema.extend({ channel: CommunityChannelResourceSchema.extend({ type: exports_external.literal("thread") }) }).refine((event) => event.channel.parentChannelId === event.parentChannelId && (event.parentMessageId === undefined || event.parentMessageId === event.channel.parentMessageId)),
|
|
24748
|
+
communityChannelCreateSchema.extend({ channel: CommunityChannelResourceSchema.extend({ type: channelTypeSchema }) }).refine((event) => event.channel.serverId === event.serverId),
|
|
24749
|
+
communityChildChannelUpdateSchema.extend({ changes: CommunityChannelResourceSchema.pick({ name: true, archived: true, lastMessageAt: true, messageCount: true }).partial().extend({ tags: exports_external.array(string4).nullable().optional() }) }),
|
|
24750
|
+
communityChannelUpdateSchema.extend({ changes: CommunityChannelResourceSchema.pick({ name: true, topic: true, categoryId: true, type: true }).partial().extend({ type: channelTypeSchema.optional() }) }),
|
|
24751
|
+
communityIdentityUpdateSchema.extend({ avatar: CommunityResourceProfileSchema.shape.avatar, avatarVersion: CommunityResourceProfileSchema.shape.avatarVersion.refine((version3) => version3 > 0) }),
|
|
24752
|
+
CommunityResourceProfileSchema.pick({ name: true, discriminator: true, aboutMe: true, bannerColor: true, kind: true, ownerUserId: true }).required().extend({ type: exports_external.literal("community:profile.update"), userId: string4 })
|
|
24695
24753
|
]);
|
|
24696
24754
|
var CommunityWsEventSchema = CommunityWsEventDiscriminatedSchema.transform((event) => event);
|
|
24755
|
+
var CommunityResourceWsEventSchema = CommunityResourceWsEventDiscriminatedSchema.transform((event) => event);
|
|
24697
24756
|
var WS_EVENTS = {
|
|
24698
24757
|
MESSAGE_CREATE: "community:message.create",
|
|
24699
24758
|
MESSAGE_UPDATED: "community:message.updated",
|
|
@@ -24777,6 +24836,7 @@ var memberAddedSchema = exports_external.strictObject({
|
|
|
24777
24836
|
channelId: exports_external.string().min(1)
|
|
24778
24837
|
});
|
|
24779
24838
|
var batchShape = exports_external.strictObject({
|
|
24839
|
+
communityContract: exports_external.literal(3).optional(),
|
|
24780
24840
|
messageId: exports_external.string().min(1),
|
|
24781
24841
|
messageEvent: exports_external.unknown(),
|
|
24782
24842
|
contentUserIds: targetList,
|
|
@@ -33604,15 +33664,14 @@ function createPiSessionDependencies(ctx, loadSdk = loadPiSdkModule) {
|
|
|
33604
33664
|
},
|
|
33605
33665
|
async createAgentSession(opts) {
|
|
33606
33666
|
const sdk = await loadSdk();
|
|
33607
|
-
const
|
|
33667
|
+
const modelRuntime = await sdk.ModelRuntime.create();
|
|
33608
33668
|
const runtimeConfig = ctx.config.runtimeConfig;
|
|
33609
33669
|
const provider = runtimeConfig && "provider" in runtimeConfig ? runtimeConfig.provider : undefined;
|
|
33610
33670
|
if (provider?.kind === "builtin") {
|
|
33611
|
-
|
|
33671
|
+
await modelRuntime.setRuntimeApiKey(provider.providerId, provider.apiKey);
|
|
33612
33672
|
}
|
|
33613
|
-
const modelRegistry = sdk.ModelRegistry.create(authStorage);
|
|
33614
33673
|
const parsed = parseModelString(opts.model);
|
|
33615
|
-
const model = parsed ?
|
|
33674
|
+
const model = parsed ? modelRuntime.getModel(parsed.provider, parsed.id) : undefined;
|
|
33616
33675
|
const cwd = opts.cwd;
|
|
33617
33676
|
const requestedSessionId = opts.sessionId;
|
|
33618
33677
|
let sessionManager;
|
|
@@ -33631,8 +33690,7 @@ function createPiSessionDependencies(ctx, loadSdk = loadPiSdkModule) {
|
|
|
33631
33690
|
cwd,
|
|
33632
33691
|
model,
|
|
33633
33692
|
thinkingLevel: opts.thinkingLevel,
|
|
33634
|
-
|
|
33635
|
-
modelRegistry,
|
|
33693
|
+
modelRuntime,
|
|
33636
33694
|
sessionManager,
|
|
33637
33695
|
customTools: [bashTool]
|
|
33638
33696
|
});
|
|
@@ -33867,9 +33925,8 @@ class PiDriver {
|
|
|
33867
33925
|
try {
|
|
33868
33926
|
const reasoning = await Promise.race([
|
|
33869
33927
|
this.loadSdk().then(async (sdk) => {
|
|
33870
|
-
const
|
|
33871
|
-
|
|
33872
|
-
return parsePiModelCatalog(await registry2.getAvailable());
|
|
33928
|
+
const modelRuntime = await sdk.ModelRuntime.create();
|
|
33929
|
+
return parsePiModelCatalog(await modelRuntime.getAvailable());
|
|
33873
33930
|
}),
|
|
33874
33931
|
new Promise((resolve4) => {
|
|
33875
33932
|
timer = setTimeout(() => resolve4(undefined), PI_MODEL_PROBE_TIMEOUT_MS);
|
|
@@ -37474,10 +37531,31 @@ function reduceManager(state, event) {
|
|
|
37474
37531
|
return withAgent(state, event.agentId, (a) => a ?? freshAgent(event.agentId), []);
|
|
37475
37532
|
case "wake":
|
|
37476
37533
|
return onWake(state, event.agentId, event.message);
|
|
37477
|
-
case "spawned":
|
|
37534
|
+
case "spawned": {
|
|
37535
|
+
const existing = state.agents[event.agentId];
|
|
37536
|
+
if (!existing || existing.status !== "starting")
|
|
37537
|
+
return { state, effects: [] };
|
|
37538
|
+
const agent2 = clone2(existing);
|
|
37539
|
+
enterStable(agent2, "running");
|
|
37540
|
+
syncExecutionProjection(agent2);
|
|
37541
|
+
const mode = leaseIsWorking(agent2.execution.lease) || agent2.pendingAdmissions.length > 0 ? "busy" : "idle";
|
|
37542
|
+
const messages = drainInbox(agent2);
|
|
37543
|
+
return commit(state, agent2, messages.map((message2) => ({ type: "send", agentId: event.agentId, message: message2, mode })));
|
|
37544
|
+
}
|
|
37545
|
+
case "queue_delivery":
|
|
37478
37546
|
return mutate(state, event.agentId, (a) => {
|
|
37479
|
-
|
|
37547
|
+
const queuedById = new Map(a.inbox.filter((message2) => message2.id).map((message2) => [message2.id, message2]));
|
|
37548
|
+
const restoredIds = new Set;
|
|
37549
|
+
const messages = event.messages.filter((message2) => {
|
|
37550
|
+
if (message2.id && restoredIds.has(message2.id))
|
|
37551
|
+
return false;
|
|
37552
|
+
if (message2.id)
|
|
37553
|
+
restoredIds.add(message2.id);
|
|
37554
|
+
return true;
|
|
37555
|
+
}).map((message2) => message2.id ? queuedById.get(message2.id) ?? message2 : message2);
|
|
37556
|
+
a.inbox = [...messages, ...a.inbox.filter((message2) => !message2.id || !restoredIds.has(message2.id))];
|
|
37480
37557
|
syncExecutionProjection(a);
|
|
37558
|
+
a.idleSince = null;
|
|
37481
37559
|
});
|
|
37482
37560
|
case "backend_session":
|
|
37483
37561
|
return mutate(state, event.agentId, (a) => {
|
|
@@ -37818,14 +37896,14 @@ function onTurnCompleted(state, agentId, sessionInstanceId, nowMs, turnId, endRe
|
|
|
37818
37896
|
agent2.stalledSessionId = null;
|
|
37819
37897
|
syncExecutionProjection(agent2);
|
|
37820
37898
|
const clearEffects = clearedStallSessionId === null ? [] : [{ type: "clear_stall_recovery", agentId, sessionId: clearedStallSessionId }];
|
|
37821
|
-
if (agent2.inbox.length > 0 && !agent2.resetting) {
|
|
37899
|
+
if (agent2.status === "running" && agent2.inbox.length > 0 && !agent2.resetting) {
|
|
37822
37900
|
const messages = drainInbox(agent2);
|
|
37823
37901
|
return commit(state, agent2, [
|
|
37824
37902
|
...clearEffects,
|
|
37825
37903
|
...messages.map((queued) => ({ type: "send", agentId, message: queued, mode: "idle" }))
|
|
37826
37904
|
]);
|
|
37827
37905
|
}
|
|
37828
|
-
agent2.idleSince = nowMs;
|
|
37906
|
+
agent2.idleSince = agent2.status === "running" && !agent2.resetting ? nowMs : null;
|
|
37829
37907
|
return commit(state, agent2, clearEffects);
|
|
37830
37908
|
}
|
|
37831
37909
|
function onTurnToolLifecycle(state, event, lifecycle) {
|
|
@@ -39621,8 +39699,34 @@ class AgentProcessManager {
|
|
|
39621
39699
|
}
|
|
39622
39700
|
}
|
|
39623
39701
|
}
|
|
39624
|
-
|
|
39625
|
-
|
|
39702
|
+
const completed = new Set;
|
|
39703
|
+
const deferSends = (agentId) => {
|
|
39704
|
+
const remaining = effects.filter((candidate) => candidate.type === "send" && !completed.has(candidate) && (agentId === undefined || candidate.agentId === agentId));
|
|
39705
|
+
for (const id3 of new Set(remaining.map((candidate) => candidate.agentId))) {
|
|
39706
|
+
const batch = remaining.filter((candidate) => candidate.agentId === id3);
|
|
39707
|
+
batch.forEach((candidate) => completed.add(candidate));
|
|
39708
|
+
this.dispatch({
|
|
39709
|
+
type: "queue_delivery",
|
|
39710
|
+
agentId: id3,
|
|
39711
|
+
messages: batch.map((candidate) => candidate.message)
|
|
39712
|
+
});
|
|
39713
|
+
}
|
|
39714
|
+
};
|
|
39715
|
+
try {
|
|
39716
|
+
for (const effect of effects) {
|
|
39717
|
+
if (completed.has(effect))
|
|
39718
|
+
continue;
|
|
39719
|
+
if (effect.type === "send" && !this.canSend(effect.agentId)) {
|
|
39720
|
+
deferSends(effect.agentId);
|
|
39721
|
+
continue;
|
|
39722
|
+
}
|
|
39723
|
+
this.applyEffect(effect);
|
|
39724
|
+
completed.add(effect);
|
|
39725
|
+
}
|
|
39726
|
+
} catch (error62) {
|
|
39727
|
+
deferSends();
|
|
39728
|
+
throw error62;
|
|
39729
|
+
}
|
|
39626
39730
|
return effects;
|
|
39627
39731
|
}
|
|
39628
39732
|
deriveActivitySnapshot(state) {
|
|
@@ -39654,6 +39758,26 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
39654
39758
|
stampNow(text3) {
|
|
39655
39759
|
return this.opts.stampWakePromptTime ? `[${nowLocalISO()}] ${text3}` : text3;
|
|
39656
39760
|
}
|
|
39761
|
+
prepareDelivery(message2) {
|
|
39762
|
+
return {
|
|
39763
|
+
...message2,
|
|
39764
|
+
preparedInput: message2.preparedInput ?? {
|
|
39765
|
+
id: message2.id,
|
|
39766
|
+
kind: "user",
|
|
39767
|
+
text: this.stampNow(this.withFooter(message2.text)),
|
|
39768
|
+
sequence: message2.seq
|
|
39769
|
+
}
|
|
39770
|
+
};
|
|
39771
|
+
}
|
|
39772
|
+
canSend(agentId) {
|
|
39773
|
+
const session2 = this.sessions.get(agentId);
|
|
39774
|
+
const owner = this.activeSpawnState.get(agentId);
|
|
39775
|
+
const agent2 = this.state.agents[agentId];
|
|
39776
|
+
if (!session2 || !owner || owner.session !== session2 || owner.torndown || owner.superseded || agent2?.status !== "running" || agent2.resetting || agent2.execution.sessionInstanceId !== session2.sessionInstanceId)
|
|
39777
|
+
return false;
|
|
39778
|
+
const driverState = session2.snapshot().state;
|
|
39779
|
+
return driverState !== "stopping" && driverState !== "closed";
|
|
39780
|
+
}
|
|
39657
39781
|
beginPendingDelivery(owner, commandId, message2, mode, span, requeueOnFailure = true) {
|
|
39658
39782
|
const sessionInstanceId = owner.sessionInstanceId;
|
|
39659
39783
|
if (!sessionInstanceId || owner.pendingDeliverySpans.has(commandId))
|
|
@@ -39713,18 +39837,15 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
39713
39837
|
break;
|
|
39714
39838
|
case "send": {
|
|
39715
39839
|
const session2 = this.sessions.get(effect.agentId);
|
|
39716
|
-
|
|
39717
|
-
|
|
39718
|
-
|
|
39719
|
-
|
|
39720
|
-
sequence: effect.message.seq
|
|
39721
|
-
};
|
|
39722
|
-
if (session2) {
|
|
39840
|
+
if (session2 && this.canSend(effect.agentId)) {
|
|
39841
|
+
const message2 = this.prepareDelivery(effect.message);
|
|
39842
|
+
effect.message = message2;
|
|
39843
|
+
const input2 = message2.preparedInput;
|
|
39723
39844
|
const owner = this.activeSpawnState.get(effect.agentId);
|
|
39724
39845
|
const exactOwner = owner?.session === session2 ? owner : undefined;
|
|
39725
39846
|
const associatedSpan = exactOwner ? effect.mode === "idle" ? this.openTurn(exactOwner) : exactOwner.activeSpan : null;
|
|
39726
39847
|
if (exactOwner)
|
|
39727
|
-
this.beginPendingDelivery(exactOwner, input2.id,
|
|
39848
|
+
this.beginPendingDelivery(exactOwner, input2.id, message2, effect.mode, associatedSpan);
|
|
39728
39849
|
let sent;
|
|
39729
39850
|
try {
|
|
39730
39851
|
sent = session2.send(input2);
|
|
@@ -39933,9 +40054,11 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
39933
40054
|
this.log.info("agent session ended", { agentId, sessionId, reason });
|
|
39934
40055
|
}
|
|
39935
40056
|
doSpawn(agentId, messages, resumeSessionId) {
|
|
39936
|
-
const [
|
|
39937
|
-
if (!
|
|
40057
|
+
const [initial, ...pending] = messages;
|
|
40058
|
+
if (!initial)
|
|
39938
40059
|
throw new Error(`AgentProcessManager: spawn for ${agentId} has no command`);
|
|
40060
|
+
this.dispatch({ type: "queue_delivery", agentId, messages: pending });
|
|
40061
|
+
const first = this.prepareDelivery(initial);
|
|
39939
40062
|
const prompt = this.withFooter(first.text);
|
|
39940
40063
|
const driver = this.opts.driverFor(agentId, this.runtimeConfigs.get(agentId));
|
|
39941
40064
|
this.liveBackendIds.set(agentId, driver.id);
|
|
@@ -40139,12 +40262,7 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
40139
40262
|
this.beginPendingDelivery(state, commandId, first, "idle", startedSpan, false);
|
|
40140
40263
|
let startResult;
|
|
40141
40264
|
try {
|
|
40142
|
-
startResult = session2.start(
|
|
40143
|
-
id: commandId,
|
|
40144
|
-
kind: "user",
|
|
40145
|
-
text: this.stampNow(prompt),
|
|
40146
|
-
sequence: first.seq
|
|
40147
|
-
});
|
|
40265
|
+
startResult = session2.start(first.preparedInput);
|
|
40148
40266
|
this.markPendingDeliveryObserved(state, commandId);
|
|
40149
40267
|
} catch (error62) {
|
|
40150
40268
|
this.settlePendingDelivery(state, commandId);
|
|
@@ -40152,7 +40270,7 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
40152
40270
|
throw error62;
|
|
40153
40271
|
}
|
|
40154
40272
|
startResult.then((receipt) => {
|
|
40155
|
-
if (this.sessions.get(agentId) !== session2 || state.torndown)
|
|
40273
|
+
if (this.sessions.get(agentId) !== session2 || state.torndown || state.superseded || this.activeSpawnState.get(agentId) !== state)
|
|
40156
40274
|
return;
|
|
40157
40275
|
if (receipt?.status === "rejected") {
|
|
40158
40276
|
this.settlePendingDelivery(state, commandId);
|
|
@@ -40161,44 +40279,16 @@ ${this.opts.wakePromptFooter}` : text3;
|
|
|
40161
40279
|
session2.stop({ reason: "shutdown", forceAfterMs: SESSION_STOP_GRACE_MS2 });
|
|
40162
40280
|
return;
|
|
40163
40281
|
}
|
|
40164
|
-
|
|
40165
|
-
|
|
40166
|
-
|
|
40167
|
-
|
|
40168
|
-
|
|
40169
|
-
|
|
40170
|
-
|
|
40171
|
-
|
|
40172
|
-
|
|
40173
|
-
|
|
40174
|
-
id: message2.id,
|
|
40175
|
-
kind: "user",
|
|
40176
|
-
text: this.stampNow(this.withFooter(message2.text)),
|
|
40177
|
-
sequence: message2.seq
|
|
40178
|
-
});
|
|
40179
|
-
this.markPendingDeliveryObserved(state, message2.id);
|
|
40180
|
-
queuedReceipt = await queuedResult;
|
|
40181
|
-
} catch (error62) {
|
|
40182
|
-
this.settlePendingDelivery(state, message2.id);
|
|
40183
|
-
if (!state.torndown && this.sessions.get(agentId) === session2 && this.activeSpawnState.get(agentId) === state) {
|
|
40184
|
-
this.emitErrorAudit(agentId, "runtime", "send_failed", String(error62));
|
|
40185
|
-
session2.stop({ reason: "shutdown", forceAfterMs: SESSION_STOP_GRACE_MS2 });
|
|
40186
|
-
}
|
|
40187
|
-
return;
|
|
40188
|
-
}
|
|
40189
|
-
if (state.torndown || this.sessions.get(agentId) !== session2 || this.activeSpawnState.get(agentId) !== state) {
|
|
40190
|
-
return;
|
|
40191
|
-
}
|
|
40192
|
-
if (queuedReceipt.status === "rejected") {
|
|
40193
|
-
if (!state.pendingDeliverySpans.has(message2.id))
|
|
40194
|
-
return;
|
|
40195
|
-
this.settlePendingDelivery(state, message2.id);
|
|
40196
|
-
this.emitErrorAudit(agentId, "runtime", queuedReceipt.error?.code ?? queuedReceipt.reason, queuedReceipt.error?.message ?? `Delivery rejected (${queuedReceipt.reason})`);
|
|
40197
|
-
session2.stop({ reason: "shutdown", forceAfterMs: SESSION_STOP_GRACE_MS2 });
|
|
40198
|
-
return;
|
|
40199
|
-
}
|
|
40200
|
-
}
|
|
40201
|
-
})().catch((error62) => this.emitErrorAudit(agentId, "runtime", "send_failed", String(error62)));
|
|
40282
|
+
const driverState = session2.snapshot().state;
|
|
40283
|
+
if (this.state.agents[agentId]?.status !== "starting" || driverState === "stopping" || driverState === "closed")
|
|
40284
|
+
return;
|
|
40285
|
+
try {
|
|
40286
|
+
this.dispatch({ type: "spawned", agentId, nowMs: this.now() }, state);
|
|
40287
|
+
} catch (error62) {
|
|
40288
|
+
this.emitErrorAudit(agentId, "runtime", "send_failed", String(error62));
|
|
40289
|
+
session2.stop({ reason: "shutdown", forceAfterMs: SESSION_STOP_GRACE_MS2 });
|
|
40290
|
+
return;
|
|
40291
|
+
}
|
|
40202
40292
|
if (state.hasEstablished || state.hasReportedSpawnFailure)
|
|
40203
40293
|
return;
|
|
40204
40294
|
state.handshakeTimer = setTimeout(() => {
|