@alook/cli 0.0.150 → 0.0.152
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/index.js +365 -209
- package/dist/session-runner.js +356 -203
- package/package.json +5 -5
package/dist/session-runner.js
CHANGED
|
@@ -98,6 +98,8 @@ var TERMINAL_ISSUE_STATUSES = [
|
|
|
98
98
|
];
|
|
99
99
|
var POLL_INTERVAL_MS = Number(process.env.POLL_INTERVAL_MS) || 3000;
|
|
100
100
|
var OFFLINE_THRESHOLD_MS = Number(process.env.OFFLINE_THRESHOLD_MS) || 30000;
|
|
101
|
+
var COMMUNITY_MACHINE_HEARTBEAT_MS = 30000;
|
|
102
|
+
var COMMUNITY_MACHINE_OFFLINE_THRESHOLD_MS = 3 * COMMUNITY_MACHINE_HEARTBEAT_MS;
|
|
101
103
|
var COMMUNITY_MACHINE_PAIR_TOKEN_TTL_MS = 15 * 60000;
|
|
102
104
|
var EVENT_POLL_INTERVAL_MS = Number(process.env.EVENT_POLL_INTERVAL_MS) || 2000;
|
|
103
105
|
var MeetingStatus = {
|
|
@@ -116,12 +118,21 @@ var COMMUNITY_BOT_NAME_MIN = 1;
|
|
|
116
118
|
var COMMUNITY_BOT_NAME_MAX = 32;
|
|
117
119
|
var COMMUNITY_BOT_DESCRIPTION_MAX = 1024;
|
|
118
120
|
var COMMUNITY_BOT_IMAGE_URL_MAX = 2048;
|
|
119
|
-
var
|
|
120
|
-
|
|
121
|
-
|
|
121
|
+
var DEV_PORTS = {
|
|
122
|
+
web: 3000,
|
|
123
|
+
emailWorker: 8787,
|
|
124
|
+
wsDo: 8789,
|
|
125
|
+
wakeWorker: 8790
|
|
126
|
+
};
|
|
127
|
+
var DEV_WEB_URL = process.env.ALOOK_SERVER_URL || `http://localhost:${DEV_PORTS.web}`;
|
|
128
|
+
var DEV_WS_DO_URL = process.env.DEV_WS_DO_URL || `http://localhost:${DEV_PORTS.wsDo}`;
|
|
129
|
+
var DEV_EMAIL_WORKER_URL = process.env.DEV_EMAIL_WORKER_URL || `http://localhost:${DEV_PORTS.emailWorker}`;
|
|
130
|
+
var DEV_WAKE_WORKER_URL = process.env.DEV_WAKE_WORKER_URL || `http://localhost:${DEV_PORTS.wakeWorker}`;
|
|
122
131
|
// ../shared/src/constants/community.ts
|
|
132
|
+
var MAX_MESSAGE_CONTENT_LENGTH = 4000;
|
|
123
133
|
var MAX_ATTACHMENT_SIZE_BYTES = 25 * 1024 * 1024;
|
|
124
134
|
var MAX_SERVER_ICON_SIZE_BYTES = 5 * 1024 * 1024;
|
|
135
|
+
var MAX_ICON_SOURCE_FILE_SIZE_BYTES = 15 * 1024 * 1024;
|
|
125
136
|
// ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/external.js
|
|
126
137
|
var exports_external = {};
|
|
127
138
|
__export(exports_external, {
|
|
@@ -14952,6 +14963,11 @@ var SessionErrorFrameSchema = exports_external.object({
|
|
|
14952
14963
|
agentId: exports_external.string().optional(),
|
|
14953
14964
|
payload: exports_external.record(exports_external.string(), exports_external.unknown()).optional()
|
|
14954
14965
|
});
|
|
14966
|
+
var AgentActivityMessageSchema = exports_external.object({
|
|
14967
|
+
type: exports_external.literal("agent_activity"),
|
|
14968
|
+
agentId: exports_external.string(),
|
|
14969
|
+
state: exports_external.enum(["idle", "starting", "running", "stopping"])
|
|
14970
|
+
});
|
|
14955
14971
|
var CommunityPairTokenResponseSchema = exports_external.object({
|
|
14956
14972
|
tokenId: exports_external.string(),
|
|
14957
14973
|
expiresAt: exports_external.string()
|
|
@@ -14976,8 +14992,9 @@ var CommunityDaemonEnrollAgentResponseSchema = exports_external.object({
|
|
|
14976
14992
|
runnerKey: exports_external.string(),
|
|
14977
14993
|
expiresAt: exports_external.string().nullable()
|
|
14978
14994
|
});
|
|
14979
|
-
var
|
|
14980
|
-
|
|
14995
|
+
var BOT_AVATAR_ROUTE_PATTERN = /^\/api\/community\/bots\/[A-Za-z0-9_-]+\/avatar$/;
|
|
14996
|
+
var BotImageUrlSchema = exports_external.string().max(COMMUNITY_BOT_IMAGE_URL_MAX).refine((v) => v.startsWith("https://") || v.startsWith("avatar:") || BOT_AVATAR_ROUTE_PATTERN.test(v), {
|
|
14997
|
+
message: "image must be an https URL, the bot avatar route, or an avatar: config"
|
|
14981
14998
|
});
|
|
14982
14999
|
var CommunityBotCreateRequestSchema = exports_external.object({
|
|
14983
15000
|
name: exports_external.string().trim().min(COMMUNITY_BOT_NAME_MIN).max(COMMUNITY_BOT_NAME_MAX),
|
|
@@ -14996,14 +15013,71 @@ var CommunityBotPatchRequestSchema = exports_external.object({
|
|
|
14996
15013
|
var CommunityBotAddToServerRequestSchema = exports_external.object({
|
|
14997
15014
|
botId: exports_external.string().min(1)
|
|
14998
15015
|
});
|
|
14999
|
-
var
|
|
15000
|
-
|
|
15001
|
-
|
|
15002
|
-
|
|
15003
|
-
|
|
15004
|
-
|
|
15005
|
-
|
|
15006
|
-
|
|
15016
|
+
var CommunityAgentMessageContentSchema = exports_external.object({ text: exports_external.string().min(1).max(MAX_MESSAGE_CONTENT_LENGTH) }).catchall(exports_external.unknown());
|
|
15017
|
+
var CommunityAgentSeqSchema = exports_external.number().int().min(0);
|
|
15018
|
+
var CommunityAgentPositiveSeqSchema = exports_external.number().int().min(1);
|
|
15019
|
+
var CommunityAgentCursorSchema = exports_external.object({
|
|
15020
|
+
channel: exports_external.string().min(1),
|
|
15021
|
+
seq: CommunityAgentPositiveSeqSchema
|
|
15022
|
+
});
|
|
15023
|
+
var CommunityAgentSendRequestSchema = exports_external.object({
|
|
15024
|
+
channel: exports_external.string().min(1),
|
|
15025
|
+
content: CommunityAgentMessageContentSchema,
|
|
15026
|
+
seenUpToSeq: CommunityAgentSeqSchema.optional()
|
|
15027
|
+
});
|
|
15028
|
+
var CommunityAgentInboxPullRequestSchema = exports_external.object({
|
|
15029
|
+
max: exports_external.number().int().min(1).max(200).optional()
|
|
15030
|
+
});
|
|
15031
|
+
var CommunityAgentAckRequestSchema = exports_external.object({
|
|
15032
|
+
cursors: exports_external.array(CommunityAgentCursorSchema).min(1)
|
|
15033
|
+
});
|
|
15034
|
+
var CommunityAgentReadRequestSchema = exports_external.object({
|
|
15035
|
+
channel: exports_external.string().min(1),
|
|
15036
|
+
before: CommunityAgentSeqSchema.optional(),
|
|
15037
|
+
after: CommunityAgentSeqSchema.optional(),
|
|
15038
|
+
around: CommunityAgentSeqSchema.optional(),
|
|
15039
|
+
limit: exports_external.number().int().min(1).max(200).optional()
|
|
15040
|
+
}).refine((v) => [v.before, v.after, v.around].filter((x) => x !== undefined).length <= 1, { message: "at most one of before/after/around may be supplied" });
|
|
15041
|
+
var CommunityAgentResolveRequestSchema = exports_external.object({
|
|
15042
|
+
channel: exports_external.string().min(1),
|
|
15043
|
+
seq: CommunityAgentSeqSchema
|
|
15044
|
+
});
|
|
15045
|
+
var CommunityAgentListChannelsRequestSchema = exports_external.object({
|
|
15046
|
+
server: exports_external.string().min(1).optional()
|
|
15047
|
+
});
|
|
15048
|
+
var CommunityAgentListMembersRequestSchema = exports_external.object({
|
|
15049
|
+
server: exports_external.string().min(1)
|
|
15050
|
+
});
|
|
15051
|
+
var CommunityAgentJoinServerRequestSchema = exports_external.object({
|
|
15052
|
+
invite: exports_external.string().min(1)
|
|
15053
|
+
});
|
|
15054
|
+
var AuditLogCliInvocationPayloadSchema = exports_external.object({
|
|
15055
|
+
subcommand: exports_external.string().min(1)
|
|
15056
|
+
});
|
|
15057
|
+
var AuditLogToolCallPayloadSchema = exports_external.object({
|
|
15058
|
+
name: exports_external.string().min(1)
|
|
15059
|
+
});
|
|
15060
|
+
var AuditLogThinkingPayloadSchema = exports_external.object({
|
|
15061
|
+
text: exports_external.string(),
|
|
15062
|
+
truncated: exports_external.boolean(),
|
|
15063
|
+
chars: exports_external.number().int().nonnegative()
|
|
15064
|
+
});
|
|
15065
|
+
var BotAuditEventSchema = exports_external.discriminatedUnion("kind", [
|
|
15066
|
+
exports_external.object({ kind: exports_external.literal("cli_invocation"), payload: AuditLogCliInvocationPayloadSchema }),
|
|
15067
|
+
exports_external.object({ kind: exports_external.literal("tool_call"), payload: AuditLogToolCallPayloadSchema }),
|
|
15068
|
+
exports_external.object({ kind: exports_external.literal("thinking"), payload: AuditLogThinkingPayloadSchema })
|
|
15069
|
+
]);
|
|
15070
|
+
var BotAuditEventKindSchema = exports_external.enum([
|
|
15071
|
+
"cli_invocation",
|
|
15072
|
+
"tool_call",
|
|
15073
|
+
"thinking"
|
|
15074
|
+
]);
|
|
15075
|
+
var HostBotAuditEventFrameSchema = exports_external.object({
|
|
15076
|
+
type: exports_external.literal("bot_audit_event"),
|
|
15077
|
+
agentId: exports_external.string().min(1),
|
|
15078
|
+
sessionId: exports_external.string().nullable().optional(),
|
|
15079
|
+
launchId: exports_external.string().nullable().optional(),
|
|
15080
|
+
event: BotAuditEventSchema
|
|
15007
15081
|
});
|
|
15008
15082
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/entity.js
|
|
15009
15083
|
var entityKind = Symbol.for("drizzle:entityKind");
|
|
@@ -15030,47 +15104,6 @@ function is(value, type) {
|
|
|
15030
15104
|
return false;
|
|
15031
15105
|
}
|
|
15032
15106
|
|
|
15033
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/table.utils.js
|
|
15034
|
-
var TableName = Symbol.for("drizzle:Name");
|
|
15035
|
-
|
|
15036
|
-
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/table.js
|
|
15037
|
-
var Schema = Symbol.for("drizzle:Schema");
|
|
15038
|
-
var Columns = Symbol.for("drizzle:Columns");
|
|
15039
|
-
var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
15040
|
-
var OriginalName = Symbol.for("drizzle:OriginalName");
|
|
15041
|
-
var BaseName = Symbol.for("drizzle:BaseName");
|
|
15042
|
-
var IsAlias = Symbol.for("drizzle:IsAlias");
|
|
15043
|
-
var ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
|
15044
|
-
var IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
|
15045
|
-
|
|
15046
|
-
class Table {
|
|
15047
|
-
static [entityKind] = "Table";
|
|
15048
|
-
static Symbol = {
|
|
15049
|
-
Name: TableName,
|
|
15050
|
-
Schema,
|
|
15051
|
-
OriginalName,
|
|
15052
|
-
Columns,
|
|
15053
|
-
ExtraConfigColumns,
|
|
15054
|
-
BaseName,
|
|
15055
|
-
IsAlias,
|
|
15056
|
-
ExtraConfigBuilder
|
|
15057
|
-
};
|
|
15058
|
-
[TableName];
|
|
15059
|
-
[OriginalName];
|
|
15060
|
-
[Schema];
|
|
15061
|
-
[Columns];
|
|
15062
|
-
[ExtraConfigColumns];
|
|
15063
|
-
[BaseName];
|
|
15064
|
-
[IsAlias] = false;
|
|
15065
|
-
[IsDrizzleTable] = true;
|
|
15066
|
-
[ExtraConfigBuilder] = undefined;
|
|
15067
|
-
constructor(name, schema, baseName) {
|
|
15068
|
-
this[TableName] = this[OriginalName] = name;
|
|
15069
|
-
this[Schema] = schema;
|
|
15070
|
-
this[BaseName] = baseName;
|
|
15071
|
-
}
|
|
15072
|
-
}
|
|
15073
|
-
|
|
15074
15107
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/column.js
|
|
15075
15108
|
class Column {
|
|
15076
15109
|
constructor(table, config2) {
|
|
@@ -15177,6 +15210,9 @@ class ColumnBuilder {
|
|
|
15177
15210
|
}
|
|
15178
15211
|
}
|
|
15179
15212
|
|
|
15213
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/table.utils.js
|
|
15214
|
+
var TableName = Symbol.for("drizzle:Name");
|
|
15215
|
+
|
|
15180
15216
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/tracing-utils.js
|
|
15181
15217
|
function iife(fn, ...args) {
|
|
15182
15218
|
return fn(...args);
|
|
@@ -15314,6 +15350,44 @@ var tracer = {
|
|
|
15314
15350
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/view-common.js
|
|
15315
15351
|
var ViewBaseConfig = Symbol.for("drizzle:ViewBaseConfig");
|
|
15316
15352
|
|
|
15353
|
+
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/table.js
|
|
15354
|
+
var Schema = Symbol.for("drizzle:Schema");
|
|
15355
|
+
var Columns = Symbol.for("drizzle:Columns");
|
|
15356
|
+
var ExtraConfigColumns = Symbol.for("drizzle:ExtraConfigColumns");
|
|
15357
|
+
var OriginalName = Symbol.for("drizzle:OriginalName");
|
|
15358
|
+
var BaseName = Symbol.for("drizzle:BaseName");
|
|
15359
|
+
var IsAlias = Symbol.for("drizzle:IsAlias");
|
|
15360
|
+
var ExtraConfigBuilder = Symbol.for("drizzle:ExtraConfigBuilder");
|
|
15361
|
+
var IsDrizzleTable = Symbol.for("drizzle:IsDrizzleTable");
|
|
15362
|
+
|
|
15363
|
+
class Table {
|
|
15364
|
+
static [entityKind] = "Table";
|
|
15365
|
+
static Symbol = {
|
|
15366
|
+
Name: TableName,
|
|
15367
|
+
Schema,
|
|
15368
|
+
OriginalName,
|
|
15369
|
+
Columns,
|
|
15370
|
+
ExtraConfigColumns,
|
|
15371
|
+
BaseName,
|
|
15372
|
+
IsAlias,
|
|
15373
|
+
ExtraConfigBuilder
|
|
15374
|
+
};
|
|
15375
|
+
[TableName];
|
|
15376
|
+
[OriginalName];
|
|
15377
|
+
[Schema];
|
|
15378
|
+
[Columns];
|
|
15379
|
+
[ExtraConfigColumns];
|
|
15380
|
+
[BaseName];
|
|
15381
|
+
[IsAlias] = false;
|
|
15382
|
+
[IsDrizzleTable] = true;
|
|
15383
|
+
[ExtraConfigBuilder] = undefined;
|
|
15384
|
+
constructor(name, schema, baseName) {
|
|
15385
|
+
this[TableName] = this[OriginalName] = name;
|
|
15386
|
+
this[Schema] = schema;
|
|
15387
|
+
this[BaseName] = baseName;
|
|
15388
|
+
}
|
|
15389
|
+
}
|
|
15390
|
+
|
|
15317
15391
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/sql/sql.js
|
|
15318
15392
|
function isSQLWrapper(value) {
|
|
15319
15393
|
return value !== null && value !== undefined && typeof value.getSQL === "function";
|
|
@@ -15683,6 +15757,34 @@ function getColumnNameAndConfig(a, b) {
|
|
|
15683
15757
|
}
|
|
15684
15758
|
var textDecoder = typeof TextDecoder === "undefined" ? null : new TextDecoder;
|
|
15685
15759
|
|
|
15760
|
+
// ../shared/src/db/community-schema.ts
|
|
15761
|
+
var exports_community_schema = {};
|
|
15762
|
+
__export(exports_community_schema, {
|
|
15763
|
+
communityUserProfile: () => communityUserProfile,
|
|
15764
|
+
communityThreadParticipant: () => communityThreadParticipant,
|
|
15765
|
+
communityServerMember: () => communityServerMember,
|
|
15766
|
+
communityServerInvite: () => communityServerInvite,
|
|
15767
|
+
communityServerFolderItem: () => communityServerFolderItem,
|
|
15768
|
+
communityServerFolder: () => communityServerFolder,
|
|
15769
|
+
communityServer: () => communityServer,
|
|
15770
|
+
communityReadState: () => communityReadState,
|
|
15771
|
+
communityReaction: () => communityReaction,
|
|
15772
|
+
communityPin: () => communityPin,
|
|
15773
|
+
communityNotificationSetting: () => communityNotificationSetting,
|
|
15774
|
+
communityMessageSeq: () => communityMessageSeq,
|
|
15775
|
+
communityMessage: () => communityMessage,
|
|
15776
|
+
communityMention: () => communityMention,
|
|
15777
|
+
communityFriendship: () => communityFriendship,
|
|
15778
|
+
communityDmConversation: () => communityDmConversation,
|
|
15779
|
+
communityChannelMember: () => communityChannelMember,
|
|
15780
|
+
communityChannel: () => communityChannel,
|
|
15781
|
+
communityCategory: () => communityCategory,
|
|
15782
|
+
communityBotApprovalRequest: () => communityBotApprovalRequest,
|
|
15783
|
+
communityBotActivityEvent: () => communityBotActivityEvent,
|
|
15784
|
+
communityAuditLog: () => communityAuditLog,
|
|
15785
|
+
communityAttachment: () => communityAttachment
|
|
15786
|
+
});
|
|
15787
|
+
|
|
15686
15788
|
// ../../node_modules/.pnpm/drizzle-orm@0.45.2_@cloudflare+workers-types@4.20260702.1_@opentelemetry+api@1.9.1_@typ_9f1a3370d3c5742dfd96aef86d667915/node_modules/drizzle-orm/sqlite-core/foreign-keys.js
|
|
15687
15789
|
class ForeignKeyBuilder {
|
|
15688
15790
|
static [entityKind] = "SQLiteForeignKeyBuilder";
|
|
@@ -16351,6 +16453,9 @@ class PrimaryKey {
|
|
|
16351
16453
|
}
|
|
16352
16454
|
}
|
|
16353
16455
|
|
|
16456
|
+
// ../shared/src/db/community-schema.ts
|
|
16457
|
+
init_nanoid();
|
|
16458
|
+
|
|
16354
16459
|
// ../shared/src/db/schema.ts
|
|
16355
16460
|
var exports_schema = {};
|
|
16356
16461
|
__export(exports_schema, {
|
|
@@ -16399,7 +16504,7 @@ var user = sqliteTable("user", {
|
|
|
16399
16504
|
createdAt: text("createdAt").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16400
16505
|
updatedAt: text("updatedAt").notNull().$defaultFn(() => new Date().toISOString()),
|
|
16401
16506
|
isBot: integer2("isBot", { mode: "boolean" }).notNull().default(false),
|
|
16402
|
-
ownerUserId: text("ownerUserId"),
|
|
16507
|
+
ownerUserId: text("ownerUserId").references(() => user.id, { onDelete: "no action" }),
|
|
16403
16508
|
deletedAt: text("deletedAt"),
|
|
16404
16509
|
discriminator: text("discriminator").notNull().default("0000")
|
|
16405
16510
|
}, (t) => [index("idx_user_ownerUserId_isBot").on(t.ownerUserId, t.isBot)]);
|
|
@@ -16940,30 +17045,6 @@ var inboxUnread = sqliteTable("inbox_unread", {
|
|
|
16940
17045
|
]);
|
|
16941
17046
|
|
|
16942
17047
|
// ../shared/src/db/community-schema.ts
|
|
16943
|
-
var exports_community_schema = {};
|
|
16944
|
-
__export(exports_community_schema, {
|
|
16945
|
-
communityUserProfile: () => communityUserProfile,
|
|
16946
|
-
communityServerMember: () => communityServerMember,
|
|
16947
|
-
communityServerInvite: () => communityServerInvite,
|
|
16948
|
-
communityServerFolderItem: () => communityServerFolderItem,
|
|
16949
|
-
communityServerFolder: () => communityServerFolder,
|
|
16950
|
-
communityServer: () => communityServer,
|
|
16951
|
-
communityReadState: () => communityReadState,
|
|
16952
|
-
communityReaction: () => communityReaction,
|
|
16953
|
-
communityPin: () => communityPin,
|
|
16954
|
-
communityNotificationSetting: () => communityNotificationSetting,
|
|
16955
|
-
communityMessage: () => communityMessage,
|
|
16956
|
-
communityMention: () => communityMention,
|
|
16957
|
-
communityInboxDismissal: () => communityInboxDismissal,
|
|
16958
|
-
communityFriendship: () => communityFriendship,
|
|
16959
|
-
communityDmConversation: () => communityDmConversation,
|
|
16960
|
-
communityChannel: () => communityChannel,
|
|
16961
|
-
communityCategory: () => communityCategory,
|
|
16962
|
-
communityBotApprovalRequest: () => communityBotApprovalRequest,
|
|
16963
|
-
communityAuditLog: () => communityAuditLog,
|
|
16964
|
-
communityAttachment: () => communityAttachment
|
|
16965
|
-
});
|
|
16966
|
-
init_nanoid();
|
|
16967
17048
|
var communityServer = sqliteTable("community_server", {
|
|
16968
17049
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
16969
17050
|
name: text("name").notNull(),
|
|
@@ -17005,6 +17086,26 @@ var communityChannel = sqliteTable("community_channel", {
|
|
|
17005
17086
|
index("idx_channel_server_last_message").on(t.serverId, t.lastMessageAt),
|
|
17006
17087
|
index("idx_channel_parent").on(t.parentChannelId)
|
|
17007
17088
|
]);
|
|
17089
|
+
var communityChannelMember = sqliteTable("community_channel_member", {
|
|
17090
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17091
|
+
channelId: text("channel_id").notNull().references(() => communityChannel.id, { onDelete: "cascade" }),
|
|
17092
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17093
|
+
addedBy: text("added_by").references(() => user.id, { onDelete: "set null" }),
|
|
17094
|
+
addedAt: text("added_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17095
|
+
}, (t) => [
|
|
17096
|
+
unique("uq_channel_member").on(t.channelId, t.userId),
|
|
17097
|
+
index("idx_channel_member_user").on(t.userId)
|
|
17098
|
+
]);
|
|
17099
|
+
var communityThreadParticipant = sqliteTable("community_thread_participant", {
|
|
17100
|
+
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17101
|
+
threadChannelId: text("thread_channel_id").notNull().references(() => communityChannel.id, { onDelete: "cascade" }),
|
|
17102
|
+
userId: text("user_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17103
|
+
source: text("source").notNull().default("mention"),
|
|
17104
|
+
addedAt: text("added_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17105
|
+
}, (t) => [
|
|
17106
|
+
unique("uq_thread_participant").on(t.threadChannelId, t.userId),
|
|
17107
|
+
index("idx_thread_participant_user").on(t.userId)
|
|
17108
|
+
]);
|
|
17008
17109
|
var communityDmConversation = sqliteTable("community_dm_conversation", {
|
|
17009
17110
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17010
17111
|
user1Id: text("user1_id").references(() => user.id, { onDelete: "set null" }),
|
|
@@ -17029,12 +17130,17 @@ var communityMessage = sqliteTable("community_message", {
|
|
|
17029
17130
|
channelId: text("channel_id").references(() => communityChannel.id, {
|
|
17030
17131
|
onDelete: "cascade"
|
|
17031
17132
|
}),
|
|
17032
|
-
dmConversationId: text("dm_conversation_id").references(() => communityDmConversation.id, { onDelete: "cascade" })
|
|
17133
|
+
dmConversationId: text("dm_conversation_id").references(() => communityDmConversation.id, { onDelete: "cascade" }),
|
|
17134
|
+
seq: integer2("seq").notNull().default(0)
|
|
17033
17135
|
}, (t) => [
|
|
17034
17136
|
index("idx_message_channel_created").on(t.channelId, t.createdAt),
|
|
17035
17137
|
index("idx_message_channel_mention_created").on(t.channelId, t.mentionType, t.createdAt),
|
|
17036
17138
|
index("idx_message_dm_created").on(t.dmConversationId, t.createdAt)
|
|
17037
17139
|
]);
|
|
17140
|
+
var communityMessageSeq = sqliteTable("community_message_seq", {
|
|
17141
|
+
scopeKey: text("scope_key").primaryKey(),
|
|
17142
|
+
nextSeq: integer2("next_seq").notNull()
|
|
17143
|
+
});
|
|
17038
17144
|
var communityServerMember = sqliteTable("community_server_member", {
|
|
17039
17145
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17040
17146
|
serverId: text("server_id").notNull().references(() => communityServer.id, { onDelete: "cascade" }),
|
|
@@ -17093,7 +17199,8 @@ var communityReadState = sqliteTable("community_read_state", {
|
|
|
17093
17199
|
}),
|
|
17094
17200
|
dmConversationId: text("dm_conversation_id").references(() => communityDmConversation.id, { onDelete: "cascade" }),
|
|
17095
17201
|
lastReadAt: text("last_read_at").notNull(),
|
|
17096
|
-
lastReadMessageId: text("last_read_message_id")
|
|
17202
|
+
lastReadMessageId: text("last_read_message_id"),
|
|
17203
|
+
lastReadSeq: integer2("last_read_seq").notNull().default(0)
|
|
17097
17204
|
}, (t) => [index("idx_read_state_user").on(t.userId)]);
|
|
17098
17205
|
var communityReaction = sqliteTable("community_reaction", {
|
|
17099
17206
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
@@ -17139,7 +17246,9 @@ var communityMention = sqliteTable("community_mention", {
|
|
|
17139
17246
|
var communityUserProfile = sqliteTable("community_user_profile", {
|
|
17140
17247
|
userId: text("user_id").primaryKey().references(() => user.id, { onDelete: "cascade" }),
|
|
17141
17248
|
aboutMe: text("about_me").default(""),
|
|
17142
|
-
bannerColor: text("banner_color")
|
|
17249
|
+
bannerColor: text("banner_color"),
|
|
17250
|
+
statusEmoji: text("status_emoji"),
|
|
17251
|
+
statusText: text("status_text").default("")
|
|
17143
17252
|
});
|
|
17144
17253
|
var communityNotificationSetting = sqliteTable("community_notification_setting", {
|
|
17145
17254
|
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
@@ -17182,16 +17291,117 @@ var communityBotApprovalRequest = sqliteTable("community_bot_approval_request",
|
|
|
17182
17291
|
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString()),
|
|
17183
17292
|
resolvedAt: text("resolved_at")
|
|
17184
17293
|
}, (t) => [index("idx_community_bot_approval_bot").on(t.botId, t.status)]);
|
|
17185
|
-
var
|
|
17186
|
-
id: text("id").primaryKey().$defaultFn(() => nanoid3()),
|
|
17187
|
-
|
|
17188
|
-
|
|
17189
|
-
|
|
17294
|
+
var communityBotActivityEvent = sqliteTable("community_bot_activity_event", {
|
|
17295
|
+
id: text("id").primaryKey().$defaultFn(() => "bae_" + nanoid3()),
|
|
17296
|
+
botId: text("bot_id").notNull().references(() => user.id, { onDelete: "cascade" }),
|
|
17297
|
+
sessionId: text("session_id"),
|
|
17298
|
+
launchId: text("launch_id"),
|
|
17299
|
+
kind: text("kind").notNull(),
|
|
17300
|
+
payload: text("payload").notNull(),
|
|
17301
|
+
createdAt: text("created_at").notNull().$defaultFn(() => new Date().toISOString())
|
|
17190
17302
|
}, (t) => [
|
|
17191
|
-
|
|
17192
|
-
index("idx_inbox_dismissal_user").on(t.userId)
|
|
17303
|
+
index("idx_bot_activity_event_bot_created").on(t.botId, t.createdAt, t.id)
|
|
17193
17304
|
]);
|
|
17194
17305
|
|
|
17306
|
+
// ../shared/src/logger.ts
|
|
17307
|
+
var LEVELS = {
|
|
17308
|
+
debug: 0,
|
|
17309
|
+
info: 1,
|
|
17310
|
+
warn: 2,
|
|
17311
|
+
error: 3,
|
|
17312
|
+
silent: 4
|
|
17313
|
+
};
|
|
17314
|
+
|
|
17315
|
+
class Logger {
|
|
17316
|
+
service;
|
|
17317
|
+
level;
|
|
17318
|
+
pretty;
|
|
17319
|
+
fields;
|
|
17320
|
+
constructor(opts, fields) {
|
|
17321
|
+
this.service = opts.service;
|
|
17322
|
+
this.level = LEVELS[opts.level ?? "info"];
|
|
17323
|
+
this.pretty = opts.pretty ?? false;
|
|
17324
|
+
this.fields = fields ?? {};
|
|
17325
|
+
}
|
|
17326
|
+
debug(msg, ctx) {
|
|
17327
|
+
this.write("debug", msg, ctx);
|
|
17328
|
+
}
|
|
17329
|
+
info(msg, ctx) {
|
|
17330
|
+
this.write("info", msg, ctx);
|
|
17331
|
+
}
|
|
17332
|
+
warn(msg, ctx) {
|
|
17333
|
+
this.write("warn", msg, ctx);
|
|
17334
|
+
}
|
|
17335
|
+
error(msg, ctx) {
|
|
17336
|
+
this.write("error", msg, ctx);
|
|
17337
|
+
}
|
|
17338
|
+
child(fields) {
|
|
17339
|
+
const merged = { ...this.fields, ...fields };
|
|
17340
|
+
const child = new Logger({ service: this.service, level: this.levelName(), pretty: this.pretty }, merged);
|
|
17341
|
+
return child;
|
|
17342
|
+
}
|
|
17343
|
+
levelName() {
|
|
17344
|
+
for (const [name, num] of Object.entries(LEVELS)) {
|
|
17345
|
+
if (num === this.level)
|
|
17346
|
+
return name;
|
|
17347
|
+
}
|
|
17348
|
+
return "info";
|
|
17349
|
+
}
|
|
17350
|
+
write(level, msg, ctx) {
|
|
17351
|
+
if (LEVELS[level] < this.level)
|
|
17352
|
+
return;
|
|
17353
|
+
const entry = {
|
|
17354
|
+
level,
|
|
17355
|
+
msg,
|
|
17356
|
+
service: this.service,
|
|
17357
|
+
...this.fields,
|
|
17358
|
+
...ctx,
|
|
17359
|
+
ts: new Date().toISOString()
|
|
17360
|
+
};
|
|
17361
|
+
for (const [k, v] of Object.entries(entry)) {
|
|
17362
|
+
if (v instanceof Error) {
|
|
17363
|
+
entry[k] = { message: v.message, stack: v.stack };
|
|
17364
|
+
}
|
|
17365
|
+
}
|
|
17366
|
+
let line;
|
|
17367
|
+
if (this.pretty) {
|
|
17368
|
+
const ts = entry.ts.replace("T", " ").replace("Z", "");
|
|
17369
|
+
const lvl = entry.level.toUpperCase().padEnd(5);
|
|
17370
|
+
const pairs = Object.entries(entry).filter(([k]) => k !== "level" && k !== "msg" && k !== "service" && k !== "ts").map(([k, v]) => `${k}=${typeof v === "object" ? JSON.stringify(v) : v}`).join(" ");
|
|
17371
|
+
line = `${ts} ${lvl} [${entry.service}] ${entry.msg}${pairs ? " " + pairs : ""}`;
|
|
17372
|
+
} else {
|
|
17373
|
+
line = JSON.stringify(entry);
|
|
17374
|
+
}
|
|
17375
|
+
if (level === "error") {
|
|
17376
|
+
console.error(line);
|
|
17377
|
+
} else {
|
|
17378
|
+
console.log(line);
|
|
17379
|
+
}
|
|
17380
|
+
}
|
|
17381
|
+
}
|
|
17382
|
+
function createLogger(opts) {
|
|
17383
|
+
return new Logger(opts);
|
|
17384
|
+
}
|
|
17385
|
+
|
|
17386
|
+
// ../shared/src/db/queries/community/message.ts
|
|
17387
|
+
var log = createLogger({ service: "community-queries" });
|
|
17388
|
+
var listedMessageProjection = {
|
|
17389
|
+
id: communityMessage.id,
|
|
17390
|
+
authorId: communityMessage.authorId,
|
|
17391
|
+
content: communityMessage.content,
|
|
17392
|
+
type: communityMessage.type,
|
|
17393
|
+
mentionType: communityMessage.mentionType,
|
|
17394
|
+
replyToId: communityMessage.replyToId,
|
|
17395
|
+
embeds: communityMessage.embeds,
|
|
17396
|
+
flags: communityMessage.flags,
|
|
17397
|
+
createdAt: communityMessage.createdAt,
|
|
17398
|
+
channelId: communityMessage.channelId,
|
|
17399
|
+
dmConversationId: communityMessage.dmConversationId,
|
|
17400
|
+
authorName: user.name,
|
|
17401
|
+
authorEmail: user.email,
|
|
17402
|
+
authorImage: user.image
|
|
17403
|
+
};
|
|
17404
|
+
|
|
17195
17405
|
// ../shared/src/db/community-machine-schema.ts
|
|
17196
17406
|
var exports_community_machine_schema = {};
|
|
17197
17407
|
__export(exports_community_machine_schema, {
|
|
@@ -17266,8 +17476,6 @@ var communityAgentRunnerKey = sqliteTable("community_agent_runner_key", {
|
|
|
17266
17476
|
index("idx_community_agent_runner_key_machine_agent").on(t.machineId, t.agentId)
|
|
17267
17477
|
]);
|
|
17268
17478
|
|
|
17269
|
-
// ../shared/src/db/index.ts
|
|
17270
|
-
var allSchema = { ...exports_schema, ...exports_community_schema, ...exports_community_machine_schema };
|
|
17271
17479
|
// ../shared/src/db/queries/user.ts
|
|
17272
17480
|
var publicUserColumns = {
|
|
17273
17481
|
id: user.id,
|
|
@@ -17285,6 +17493,53 @@ var internalUserColumns = {
|
|
|
17285
17493
|
ownerUserId: user.ownerUserId,
|
|
17286
17494
|
deletedAt: user.deletedAt
|
|
17287
17495
|
};
|
|
17496
|
+
|
|
17497
|
+
// ../shared/src/db/queries/community/channel.ts
|
|
17498
|
+
var log2 = createLogger({ service: "community-queries" });
|
|
17499
|
+
var CHANNEL_COLUMNS = {
|
|
17500
|
+
id: communityChannel.id,
|
|
17501
|
+
serverId: communityChannel.serverId,
|
|
17502
|
+
categoryId: communityChannel.categoryId,
|
|
17503
|
+
name: communityChannel.name,
|
|
17504
|
+
type: communityChannel.type,
|
|
17505
|
+
topic: communityChannel.topic,
|
|
17506
|
+
position: communityChannel.position,
|
|
17507
|
+
forumTags: communityChannel.forumTags,
|
|
17508
|
+
parentChannelId: communityChannel.parentChannelId,
|
|
17509
|
+
creatorId: communityChannel.creatorId,
|
|
17510
|
+
messageCount: communityChannel.messageCount,
|
|
17511
|
+
archived: communityChannel.archived,
|
|
17512
|
+
parentMessageId: communityChannel.parentMessageId,
|
|
17513
|
+
lastMessageAt: communityChannel.lastMessageAt,
|
|
17514
|
+
createdAt: communityChannel.createdAt
|
|
17515
|
+
};
|
|
17516
|
+
|
|
17517
|
+
// ../shared/src/db/queries/community/agent-inbox.ts
|
|
17518
|
+
var AGENT_MESSAGE_COLUMNS = {
|
|
17519
|
+
id: communityMessage.id,
|
|
17520
|
+
authorId: communityMessage.authorId,
|
|
17521
|
+
content: communityMessage.content,
|
|
17522
|
+
createdAt: communityMessage.createdAt,
|
|
17523
|
+
channelId: communityMessage.channelId,
|
|
17524
|
+
dmConversationId: communityMessage.dmConversationId,
|
|
17525
|
+
seq: communityMessage.seq
|
|
17526
|
+
};
|
|
17527
|
+
// ../shared/src/community/bot-activity-presets.ts
|
|
17528
|
+
var BOT_ACTIVITY_PRESETS = {
|
|
17529
|
+
idle: { emoji: "\uD83D\uDCA4", text: "Idle" },
|
|
17530
|
+
starting: { emoji: "\uD83C\uDF00", text: "Waking up" },
|
|
17531
|
+
stopping: { emoji: "\uD83C\uDF19", text: "Wrapping up" }
|
|
17532
|
+
};
|
|
17533
|
+
var RUNNING_PRESETS = [
|
|
17534
|
+
{ emoji: "⚡", text: "Working on it" },
|
|
17535
|
+
{ emoji: "\uD83D\uDEE0️", text: "Cooking" },
|
|
17536
|
+
{ emoji: "\uD83E\uDDE0", text: "Thinking hard" },
|
|
17537
|
+
{ emoji: "\uD83D\uDD27", text: "Tinkering" },
|
|
17538
|
+
{ emoji: "\uD83D\uDE80", text: "On it" },
|
|
17539
|
+
{ emoji: "\uD83D\uDD25", text: "In the zone" }
|
|
17540
|
+
];
|
|
17541
|
+
// ../shared/src/db/index.ts
|
|
17542
|
+
var allSchema = { ...exports_schema, ...exports_community_schema, ...exports_community_machine_schema };
|
|
17288
17543
|
// ../shared/src/db/queries/task.ts
|
|
17289
17544
|
var DEFAULT_STALE_SECONDS = Number(process.env.ALOOK_STALE_DISPATCH_TIMEOUT_S) || 20;
|
|
17290
17545
|
var DEFAULT_STALE_RUNNING_SECONDS = Number(process.env.ALOOK_STALE_RUNNING_TIMEOUT_S) || 3600;
|
|
@@ -17310,109 +17565,15 @@ var RESERVED_HANDLES = new Set([
|
|
|
17310
17565
|
function toAlookAddress(h) {
|
|
17311
17566
|
return `${h}${DOMAIN}`;
|
|
17312
17567
|
}
|
|
17313
|
-
// ../shared/src/logger.ts
|
|
17314
|
-
var LEVELS = {
|
|
17315
|
-
debug: 0,
|
|
17316
|
-
info: 1,
|
|
17317
|
-
warn: 2,
|
|
17318
|
-
error: 3,
|
|
17319
|
-
silent: 4
|
|
17320
|
-
};
|
|
17321
|
-
|
|
17322
|
-
class Logger {
|
|
17323
|
-
service;
|
|
17324
|
-
level;
|
|
17325
|
-
pretty;
|
|
17326
|
-
fields;
|
|
17327
|
-
constructor(opts, fields) {
|
|
17328
|
-
this.service = opts.service;
|
|
17329
|
-
this.level = LEVELS[opts.level ?? "info"];
|
|
17330
|
-
this.pretty = opts.pretty ?? false;
|
|
17331
|
-
this.fields = fields ?? {};
|
|
17332
|
-
}
|
|
17333
|
-
debug(msg, ctx) {
|
|
17334
|
-
this.write("debug", msg, ctx);
|
|
17335
|
-
}
|
|
17336
|
-
info(msg, ctx) {
|
|
17337
|
-
this.write("info", msg, ctx);
|
|
17338
|
-
}
|
|
17339
|
-
warn(msg, ctx) {
|
|
17340
|
-
this.write("warn", msg, ctx);
|
|
17341
|
-
}
|
|
17342
|
-
error(msg, ctx) {
|
|
17343
|
-
this.write("error", msg, ctx);
|
|
17344
|
-
}
|
|
17345
|
-
child(fields) {
|
|
17346
|
-
const merged = { ...this.fields, ...fields };
|
|
17347
|
-
const child = new Logger({ service: this.service, level: this.levelName(), pretty: this.pretty }, merged);
|
|
17348
|
-
return child;
|
|
17349
|
-
}
|
|
17350
|
-
levelName() {
|
|
17351
|
-
for (const [name, num] of Object.entries(LEVELS)) {
|
|
17352
|
-
if (num === this.level)
|
|
17353
|
-
return name;
|
|
17354
|
-
}
|
|
17355
|
-
return "info";
|
|
17356
|
-
}
|
|
17357
|
-
write(level, msg, ctx) {
|
|
17358
|
-
if (LEVELS[level] < this.level)
|
|
17359
|
-
return;
|
|
17360
|
-
const entry = {
|
|
17361
|
-
level,
|
|
17362
|
-
msg,
|
|
17363
|
-
service: this.service,
|
|
17364
|
-
...this.fields,
|
|
17365
|
-
...ctx,
|
|
17366
|
-
ts: new Date().toISOString()
|
|
17367
|
-
};
|
|
17368
|
-
for (const [k, v] of Object.entries(entry)) {
|
|
17369
|
-
if (v instanceof Error) {
|
|
17370
|
-
entry[k] = { message: v.message, stack: v.stack };
|
|
17371
|
-
}
|
|
17372
|
-
}
|
|
17373
|
-
let line;
|
|
17374
|
-
if (this.pretty) {
|
|
17375
|
-
const ts = entry.ts.replace("T", " ").replace("Z", "");
|
|
17376
|
-
const lvl = entry.level.toUpperCase().padEnd(5);
|
|
17377
|
-
const pairs = Object.entries(entry).filter(([k]) => k !== "level" && k !== "msg" && k !== "service" && k !== "ts").map(([k, v]) => `${k}=${typeof v === "object" ? JSON.stringify(v) : v}`).join(" ");
|
|
17378
|
-
line = `${ts} ${lvl} [${entry.service}] ${entry.msg}${pairs ? " " + pairs : ""}`;
|
|
17379
|
-
} else {
|
|
17380
|
-
line = JSON.stringify(entry);
|
|
17381
|
-
}
|
|
17382
|
-
if (level === "error") {
|
|
17383
|
-
console.error(line);
|
|
17384
|
-
} else {
|
|
17385
|
-
console.log(line);
|
|
17386
|
-
}
|
|
17387
|
-
}
|
|
17388
|
-
}
|
|
17389
|
-
function createLogger(opts) {
|
|
17390
|
-
return new Logger(opts);
|
|
17391
|
-
}
|
|
17392
|
-
|
|
17393
|
-
// ../shared/src/db/queries/community/channel.ts
|
|
17394
|
-
var log = createLogger({ service: "community-queries" });
|
|
17395
|
-
var CHANNEL_COLUMNS = {
|
|
17396
|
-
id: communityChannel.id,
|
|
17397
|
-
serverId: communityChannel.serverId,
|
|
17398
|
-
categoryId: communityChannel.categoryId,
|
|
17399
|
-
name: communityChannel.name,
|
|
17400
|
-
type: communityChannel.type,
|
|
17401
|
-
topic: communityChannel.topic,
|
|
17402
|
-
position: communityChannel.position,
|
|
17403
|
-
forumTags: communityChannel.forumTags,
|
|
17404
|
-
parentChannelId: communityChannel.parentChannelId,
|
|
17405
|
-
creatorId: communityChannel.creatorId,
|
|
17406
|
-
messageCount: communityChannel.messageCount,
|
|
17407
|
-
archived: communityChannel.archived,
|
|
17408
|
-
parentMessageId: communityChannel.parentMessageId,
|
|
17409
|
-
lastMessageAt: communityChannel.lastMessageAt,
|
|
17410
|
-
createdAt: communityChannel.createdAt
|
|
17411
|
-
};
|
|
17412
|
-
// ../shared/src/db/queries/community/message.ts
|
|
17413
|
-
var log2 = createLogger({ service: "community-queries" });
|
|
17414
17568
|
// ../shared/src/db/queries/community/search.ts
|
|
17415
17569
|
var FTS_KEYWORDS = new Set(["and", "or", "not", "near"]);
|
|
17570
|
+
// ../shared/src/db/queries/community/machine.ts
|
|
17571
|
+
var BOT_ACTIVITY_STATUS_PAIRS = [
|
|
17572
|
+
BOT_ACTIVITY_PRESETS.idle,
|
|
17573
|
+
BOT_ACTIVITY_PRESETS.starting,
|
|
17574
|
+
BOT_ACTIVITY_PRESETS.stopping,
|
|
17575
|
+
...RUNNING_PRESETS
|
|
17576
|
+
];
|
|
17416
17577
|
// ../shared/src/mode.ts
|
|
17417
17578
|
function isLocalUrl(url2) {
|
|
17418
17579
|
try {
|
|
@@ -17727,23 +17888,15 @@ function isAlive(pid) {
|
|
|
17727
17888
|
}
|
|
17728
17889
|
}
|
|
17729
17890
|
function signalTree(pid, signal) {
|
|
17730
|
-
if (isPosix) {
|
|
17731
|
-
try {
|
|
17732
|
-
process.kill(-pid, signal);
|
|
17733
|
-
return;
|
|
17734
|
-
} catch (e) {
|
|
17735
|
-
const code = e?.code;
|
|
17736
|
-
if (code === "ESRCH")
|
|
17737
|
-
return;
|
|
17738
|
-
}
|
|
17739
|
-
}
|
|
17740
17891
|
if (!isPosix) {
|
|
17741
17892
|
try {
|
|
17742
17893
|
execSync(`taskkill /PID ${pid} /T /F`, { stdio: "ignore" });
|
|
17743
|
-
return;
|
|
17744
17894
|
} catch {}
|
|
17745
17895
|
return;
|
|
17746
17896
|
}
|
|
17897
|
+
try {
|
|
17898
|
+
process.kill(-pid, signal);
|
|
17899
|
+
} catch {}
|
|
17747
17900
|
try {
|
|
17748
17901
|
process.kill(pid, signal);
|
|
17749
17902
|
} catch {}
|