@alook/daemon 0.1.45 → 0.1.46
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 +459 -266
- package/dist/index.js +269 -76
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1002,7 +1002,7 @@ async function queryNativeRows(path3, cursor, loadSqlite = async () => {
|
|
|
1002
1002
|
}
|
|
1003
1003
|
|
|
1004
1004
|
// agent-driver/dist/internal/modelCatalog.js
|
|
1005
|
-
var RUNTIME_MODEL_CATALOG_MAX =
|
|
1005
|
+
var RUNTIME_MODEL_CATALOG_MAX = 1024;
|
|
1006
1006
|
var RUNTIME_MODEL_ID_MAX = 100;
|
|
1007
1007
|
function normalizeRuntimeModelId(value) {
|
|
1008
1008
|
if (typeof value !== "string")
|
|
@@ -1020,7 +1020,7 @@ function catalogFromIds(ids) {
|
|
|
1020
1020
|
if (!id || seen.has(id))
|
|
1021
1021
|
continue;
|
|
1022
1022
|
if (models.length >= RUNTIME_MODEL_CATALOG_MAX)
|
|
1023
|
-
|
|
1023
|
+
break;
|
|
1024
1024
|
seen.add(id);
|
|
1025
1025
|
models.push({ id, supportedReasoningEfforts: [] });
|
|
1026
1026
|
}
|
|
@@ -1070,26 +1070,28 @@ function tryParseJsonRecord(line) {
|
|
|
1070
1070
|
|
|
1071
1071
|
// agent-driver/dist/adapters/antigravity/catalog.js
|
|
1072
1072
|
function choices(value) {
|
|
1073
|
-
if (!Array.isArray(value)
|
|
1073
|
+
if (!Array.isArray(value))
|
|
1074
1074
|
return [];
|
|
1075
1075
|
const rows = [];
|
|
1076
|
+
const seen = new Set;
|
|
1076
1077
|
for (const item of value) {
|
|
1077
1078
|
const row = asRecord(item);
|
|
1078
1079
|
if (!row)
|
|
1079
1080
|
continue;
|
|
1080
1081
|
const nested2 = Array.isArray(row.options) ? row.options : [row];
|
|
1081
|
-
if (nested2.length + rows.length > RUNTIME_MODEL_CATALOG_MAX)
|
|
1082
|
-
return [];
|
|
1083
1082
|
for (const child of nested2) {
|
|
1084
1083
|
const option = asRecord(child);
|
|
1085
1084
|
const id = normalizeRuntimeModelId(option?.value ?? option?.modelId);
|
|
1086
|
-
if (!id)
|
|
1085
|
+
if (!id || seen.has(id))
|
|
1087
1086
|
continue;
|
|
1087
|
+
seen.add(id);
|
|
1088
1088
|
const name = option?.name;
|
|
1089
1089
|
rows.push({ id, ...typeof name === "string" && name.length <= 256 ? { displayName: name } : {} });
|
|
1090
|
+
if (rows.length >= RUNTIME_MODEL_CATALOG_MAX)
|
|
1091
|
+
return rows;
|
|
1090
1092
|
}
|
|
1091
1093
|
}
|
|
1092
|
-
return rows
|
|
1094
|
+
return rows;
|
|
1093
1095
|
}
|
|
1094
1096
|
function parseAntigravityCatalog(value) {
|
|
1095
1097
|
const session = asRecord(value);
|
|
@@ -4040,7 +4042,6 @@ class CodexDriver {
|
|
|
4040
4042
|
let listId = 0;
|
|
4041
4043
|
const models = [];
|
|
4042
4044
|
const seenModels = new Set;
|
|
4043
|
-
let overflow = false;
|
|
4044
4045
|
let defaultModelId;
|
|
4045
4046
|
const finish = (catalog) => {
|
|
4046
4047
|
if (settled)
|
|
@@ -4064,10 +4065,6 @@ class CodexDriver {
|
|
|
4064
4065
|
const id = normalizeRuntimeModelId(model.id);
|
|
4065
4066
|
if (!id || seenModels.has(id))
|
|
4066
4067
|
return;
|
|
4067
|
-
if (models.length >= MODEL_LIST_MAX) {
|
|
4068
|
-
overflow = true;
|
|
4069
|
-
return;
|
|
4070
|
-
}
|
|
4071
4068
|
const rawOptions = Array.isArray(model.supportedReasoningEfforts) ? model.supportedReasoningEfforts : [];
|
|
4072
4069
|
const seenEfforts = new Set;
|
|
4073
4070
|
const supportedReasoningEfforts = rawOptions.flatMap((raw) => {
|
|
@@ -4109,14 +4106,13 @@ class CodexDriver {
|
|
|
4109
4106
|
if (message.error || !message.result || typeof message.result !== "object")
|
|
4110
4107
|
return finish();
|
|
4111
4108
|
const result = message.result;
|
|
4112
|
-
for (const model of Array.isArray(result.data) ? result.data : [])
|
|
4109
|
+
for (const model of Array.isArray(result.data) ? result.data : []) {
|
|
4113
4110
|
consumeModel(model);
|
|
4114
|
-
|
|
4115
|
-
|
|
4111
|
+
if (models.length >= MODEL_LIST_MAX)
|
|
4112
|
+
break;
|
|
4113
|
+
}
|
|
4116
4114
|
const cursor = typeof result.nextCursor === "string" ? result.nextCursor : undefined;
|
|
4117
|
-
if (cursor && models.length
|
|
4118
|
-
return finish();
|
|
4119
|
-
if (cursor)
|
|
4115
|
+
if (cursor && models.length < MODEL_LIST_MAX)
|
|
4120
4116
|
return requestModelPage(cursor);
|
|
4121
4117
|
if (models.length === 0)
|
|
4122
4118
|
return finish();
|
|
@@ -4398,7 +4394,7 @@ function parseCursorAcpModelCatalog(session) {
|
|
|
4398
4394
|
if (option.value === "default[]" || seen.has(option.value))
|
|
4399
4395
|
continue;
|
|
4400
4396
|
if (models.length >= RUNTIME_MODEL_CATALOG_MAX)
|
|
4401
|
-
|
|
4397
|
+
break;
|
|
4402
4398
|
seen.add(option.value);
|
|
4403
4399
|
models.push({
|
|
4404
4400
|
id: option.value,
|
|
@@ -5457,7 +5453,7 @@ function parseGrokModelCatalog(value) {
|
|
|
5457
5453
|
if (!model || !id || seen.has(id))
|
|
5458
5454
|
continue;
|
|
5459
5455
|
if (models.length >= RUNTIME_MODEL_CATALOG_MAX)
|
|
5460
|
-
|
|
5456
|
+
break;
|
|
5461
5457
|
seen.add(id);
|
|
5462
5458
|
const displayName = boundedText(model.name, MODEL_DISPLAY_NAME_MAX2);
|
|
5463
5459
|
models.push({ id, ...displayName ? { displayName } : {}, ...reasoningCatalog(model) });
|
|
@@ -6616,7 +6612,6 @@ import { randomBytes as randomBytes4 } from "node:crypto";
|
|
|
6616
6612
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
6617
6613
|
import { EventEmitter as EventEmitter5 } from "node:events";
|
|
6618
6614
|
import { createServer as createServer2 } from "node:net";
|
|
6619
|
-
var SUPPORTED_VERSION = "1.17.20";
|
|
6620
6615
|
var HOST = "127.0.0.1";
|
|
6621
6616
|
var START_TIMEOUT_MS = 15000;
|
|
6622
6617
|
var REQUEST_TIMEOUT_MS = 15000;
|
|
@@ -7034,8 +7029,8 @@ class OpenCodeServiceLane {
|
|
|
7034
7029
|
const { response, body } = await this.fetchJsonWithTimeout("/global/health", { method: "GET" }, "health", healthTimeoutMs);
|
|
7035
7030
|
if (response.ok) {
|
|
7036
7031
|
const health = record4(body);
|
|
7037
|
-
if (health?.healthy !== true
|
|
7038
|
-
throw new OpenCodeIncompatibleError(
|
|
7032
|
+
if (health?.healthy !== true) {
|
|
7033
|
+
throw new OpenCodeIncompatibleError("Installed OpenCode service did not report healthy status");
|
|
7039
7034
|
}
|
|
7040
7035
|
await this.verifyOpenApi();
|
|
7041
7036
|
return;
|
|
@@ -7849,7 +7844,7 @@ class OpenCodeDriver {
|
|
|
7849
7844
|
instructionDelivery = { kind: "workspace_file", canonical: "AGENTS.md", aliases: ["CLAUDE.md"] };
|
|
7850
7845
|
execution = {
|
|
7851
7846
|
lifetime: "session",
|
|
7852
|
-
transport: { kind: "http_sse", protocol: "opencode.v2.service
|
|
7847
|
+
transport: { kind: "http_sse", protocol: "opencode.v2.service" },
|
|
7853
7848
|
wakeStart: "immediate",
|
|
7854
7849
|
terminalOwnership: "transport_request"
|
|
7855
7850
|
};
|
|
@@ -38347,7 +38342,7 @@ var REASONING_EFFORT_RE = /^[A-Za-z0-9._-]+$/;
|
|
|
38347
38342
|
var COMMUNITY_REASONING_EFFORT_MAX = 32;
|
|
38348
38343
|
var COMMUNITY_REASONING_DESCRIPTION_MAX = 256;
|
|
38349
38344
|
var COMMUNITY_REASONING_OPTIONS_MAX = 16;
|
|
38350
|
-
var COMMUNITY_REASONING_MODELS_MAX =
|
|
38345
|
+
var COMMUNITY_REASONING_MODELS_MAX = 1024;
|
|
38351
38346
|
var ReasoningEffortSchema = exports_external.string().min(1).max(COMMUNITY_REASONING_EFFORT_MAX).regex(REASONING_EFFORT_RE, "invalid reasoning effort charset");
|
|
38352
38347
|
var RuntimeReasoningOptionSchema = exports_external.object({
|
|
38353
38348
|
value: ReasoningEffortSchema,
|
|
@@ -38377,18 +38372,22 @@ var RuntimeReasoningModelSchema = exports_external.object({
|
|
|
38377
38372
|
var RuntimeReasoningCatalogSchema = exports_external.object({
|
|
38378
38373
|
updateMode: exports_external.enum(["live_next_turn", "context_preserving_restart", "unsupported"]),
|
|
38379
38374
|
defaultModelId: exports_external.string().min(1).max(100).optional().catch(undefined),
|
|
38380
|
-
models: exports_external.array(exports_external.unknown()).
|
|
38375
|
+
models: exports_external.array(exports_external.unknown()).transform((models) => {
|
|
38381
38376
|
const seen = new Set;
|
|
38382
|
-
|
|
38377
|
+
const retained = [];
|
|
38378
|
+
for (const candidate of models) {
|
|
38383
38379
|
const parsed = RuntimeReasoningModelSchema.safeParse(candidate);
|
|
38384
38380
|
if (!parsed.success)
|
|
38385
|
-
|
|
38381
|
+
continue;
|
|
38386
38382
|
const model = parsed.data;
|
|
38387
38383
|
if (seen.has(model.id))
|
|
38388
|
-
|
|
38384
|
+
continue;
|
|
38389
38385
|
seen.add(model.id);
|
|
38390
|
-
|
|
38391
|
-
|
|
38386
|
+
retained.push(model);
|
|
38387
|
+
if (retained.length >= COMMUNITY_REASONING_MODELS_MAX)
|
|
38388
|
+
break;
|
|
38389
|
+
}
|
|
38390
|
+
return retained;
|
|
38392
38391
|
})
|
|
38393
38392
|
});
|
|
38394
38393
|
var CommunityMachineRuntimeSchema = exports_external.object({
|
|
@@ -39226,7 +39225,7 @@ function maxRowsPerInsert(paramsPerRow) {
|
|
|
39226
39225
|
|
|
39227
39226
|
// ../shared/src/db/queries/community/message.ts
|
|
39228
39227
|
var log = createLogger2({ service: "community-queries" });
|
|
39229
|
-
var
|
|
39228
|
+
var messageProjection = {
|
|
39230
39229
|
id: communityMessage.id,
|
|
39231
39230
|
authorId: communityMessage.authorId,
|
|
39232
39231
|
content: communityMessage.content,
|
|
@@ -39234,16 +39233,19 @@ var listedMessageProjection = {
|
|
|
39234
39233
|
mentionType: communityMessage.mentionType,
|
|
39235
39234
|
replyToId: communityMessage.replyToId,
|
|
39236
39235
|
embeds: communityMessage.embeds,
|
|
39237
|
-
seq: communityMessage.seq,
|
|
39238
39236
|
createdAt: communityMessage.createdAt,
|
|
39239
39237
|
channelId: communityMessage.channelId,
|
|
39240
|
-
friendshipId: communityMessage.friendshipId,
|
|
39241
|
-
clientNonce: communityMessage.clientNonce,
|
|
39242
39238
|
authorName: user.name,
|
|
39243
|
-
authorEmail: user.email,
|
|
39244
39239
|
authorImage: user.image,
|
|
39245
39240
|
authorAvatarVersion: user.avatarVersion
|
|
39246
39241
|
};
|
|
39242
|
+
var listedMessageProjection = {
|
|
39243
|
+
...messageProjection,
|
|
39244
|
+
seq: communityMessage.seq,
|
|
39245
|
+
friendshipId: communityMessage.friendshipId,
|
|
39246
|
+
clientNonce: communityMessage.clientNonce,
|
|
39247
|
+
authorEmail: user.email
|
|
39248
|
+
};
|
|
39247
39249
|
var wakeContextMessageProjection = {
|
|
39248
39250
|
id: communityMessage.id,
|
|
39249
39251
|
authorId: communityMessage.authorId,
|
|
@@ -39362,26 +39364,207 @@ var AGENT_UNREAD_CHANNEL_CHUNK_SIZE = maxInParams(13);
|
|
|
39362
39364
|
|
|
39363
39365
|
// ../shared/src/db/queries/community/mention.ts
|
|
39364
39366
|
var MENTION_INSERT_MAX_ROWS = maxRowsPerInsert(5);
|
|
39365
|
-
// ../shared/src/community-
|
|
39366
|
-
var
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
id: string4,
|
|
39372
|
-
name: string4,
|
|
39373
|
-
discriminator: string4,
|
|
39374
|
-
image: nullableString,
|
|
39367
|
+
// ../shared/src/community-friend-approval.ts
|
|
39368
|
+
var profile = exports_external.strictObject({
|
|
39369
|
+
id: exports_external.string(),
|
|
39370
|
+
name: exports_external.string(),
|
|
39371
|
+
discriminator: exports_external.string(),
|
|
39372
|
+
image: exports_external.string().nullable(),
|
|
39375
39373
|
avatarVersion: exports_external.number().int().nonnegative()
|
|
39376
39374
|
});
|
|
39377
39375
|
var FriendApprovalPayloadSchema = exports_external.strictObject({
|
|
39378
|
-
friendshipId:
|
|
39376
|
+
friendshipId: exports_external.string(),
|
|
39379
39377
|
status: exports_external.enum(["pending", "approved", "denied", "superseded", "cancelled"]),
|
|
39380
39378
|
waitingOn: exports_external.enum(["you", "other-owner", "addressee"]).nullable(),
|
|
39381
|
-
otherProfile:
|
|
39382
|
-
botProfile:
|
|
39383
|
-
waitingOnProfile:
|
|
39379
|
+
otherProfile: profile,
|
|
39380
|
+
botProfile: profile,
|
|
39381
|
+
waitingOnProfile: profile.nullable().optional()
|
|
39382
|
+
});
|
|
39383
|
+
|
|
39384
|
+
// ../shared/src/community-contract.ts
|
|
39385
|
+
var COMMUNITY_CONTRACT_VERSION = 2;
|
|
39386
|
+
|
|
39387
|
+
// ../shared/src/community-resources.ts
|
|
39388
|
+
var id2 = exports_external.string().min(1);
|
|
39389
|
+
var nullableId = id2.nullable();
|
|
39390
|
+
var legacyArchivedSchema = exports_external.union([exports_external.boolean(), exports_external.literal(0), exports_external.literal(1)]).transform((value) => value === true || value === 1);
|
|
39391
|
+
var CommunityChannelResourceSchema = exports_external.strictObject({
|
|
39392
|
+
id: id2,
|
|
39393
|
+
type: exports_external.enum(["text", "forum", "thread", "dm"]),
|
|
39394
|
+
serverId: nullableId,
|
|
39395
|
+
categoryId: nullableId,
|
|
39396
|
+
name: exports_external.string().nullable(),
|
|
39397
|
+
topic: exports_external.string(),
|
|
39398
|
+
parentChannelId: nullableId,
|
|
39399
|
+
parentMessageId: nullableId,
|
|
39400
|
+
creatorId: nullableId,
|
|
39401
|
+
position: exports_external.number(),
|
|
39402
|
+
archived: exports_external.boolean(),
|
|
39403
|
+
createdAt: exports_external.string(),
|
|
39404
|
+
lastMessageAt: exports_external.string().nullable(),
|
|
39405
|
+
messageCount: exports_external.number().int().nonnegative()
|
|
39406
|
+
});
|
|
39407
|
+
var CommunityChannelIdentitySchema = CommunityChannelResourceSchema.pick({
|
|
39408
|
+
id: true,
|
|
39409
|
+
type: true,
|
|
39410
|
+
serverId: true,
|
|
39411
|
+
name: true,
|
|
39412
|
+
parentChannelId: true,
|
|
39413
|
+
parentMessageId: true,
|
|
39414
|
+
creatorId: true,
|
|
39415
|
+
archived: true,
|
|
39416
|
+
lastMessageAt: true,
|
|
39417
|
+
createdAt: true
|
|
39418
|
+
}).partial({ createdAt: true }).strip();
|
|
39419
|
+
var legacyChannelIdentitySchema = CommunityChannelIdentitySchema.extend({
|
|
39420
|
+
archived: legacyArchivedSchema,
|
|
39421
|
+
parentChannelId: nullableId.default(null),
|
|
39422
|
+
parentMessageId: nullableId.default(null),
|
|
39423
|
+
creatorId: nullableId.default(null),
|
|
39424
|
+
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null)
|
|
39425
|
+
});
|
|
39426
|
+
var CommunityAccessDecisionSchema = exports_external.strictObject({
|
|
39427
|
+
channelId: id2,
|
|
39428
|
+
canRead: exports_external.boolean(),
|
|
39429
|
+
canSend: exports_external.boolean(),
|
|
39430
|
+
canCreateDiscussion: exports_external.boolean()
|
|
39431
|
+
});
|
|
39432
|
+
var CommunityMessageAttachmentSchema = exports_external.strictObject({
|
|
39433
|
+
kind: exports_external.enum(["image", "file"]),
|
|
39434
|
+
name: exports_external.string(),
|
|
39435
|
+
url: exports_external.string(),
|
|
39436
|
+
thumbnailUrl: exports_external.string().optional(),
|
|
39437
|
+
contentType: exports_external.string().optional(),
|
|
39438
|
+
size: exports_external.string().optional(),
|
|
39439
|
+
sizeBytes: exports_external.number().nonnegative().optional(),
|
|
39440
|
+
width: exports_external.number().nonnegative().optional(),
|
|
39441
|
+
height: exports_external.number().nonnegative().optional()
|
|
39442
|
+
});
|
|
39443
|
+
var CommunityMessageResourceSchema = exports_external.strictObject({
|
|
39444
|
+
id: id2,
|
|
39445
|
+
channelId: id2,
|
|
39446
|
+
seq: exports_external.number().int().nonnegative(),
|
|
39447
|
+
authorId: id2,
|
|
39448
|
+
createdAt: exports_external.string(),
|
|
39449
|
+
type: exports_external.enum(["chat", "system"]),
|
|
39450
|
+
content: exports_external.string(),
|
|
39451
|
+
replyToId: nullableId,
|
|
39452
|
+
clientNonce: exports_external.string().nullable(),
|
|
39453
|
+
attachments: exports_external.array(CommunityMessageAttachmentSchema),
|
|
39454
|
+
systemKind: exports_external.literal("thread").optional(),
|
|
39455
|
+
authorName: exports_external.string().optional(),
|
|
39456
|
+
authorAvatar: exports_external.string().optional(),
|
|
39457
|
+
authorAvatarVersion: exports_external.number().int().nonnegative().optional(),
|
|
39458
|
+
mentionType: exports_external.literal("everyone").nullable().optional(),
|
|
39459
|
+
replyTo: exports_external.strictObject({
|
|
39460
|
+
id: id2,
|
|
39461
|
+
authorId: id2.optional(),
|
|
39462
|
+
authorName: exports_external.string(),
|
|
39463
|
+
text: exports_external.string(),
|
|
39464
|
+
deleted: exports_external.boolean().optional()
|
|
39465
|
+
}).optional(),
|
|
39466
|
+
embeds: exports_external.array(exports_external.unknown()).optional(),
|
|
39467
|
+
reactions: exports_external.array(exports_external.strictObject({
|
|
39468
|
+
emoji: exports_external.string(),
|
|
39469
|
+
count: exports_external.number().int().nonnegative(),
|
|
39470
|
+
me: exports_external.boolean(),
|
|
39471
|
+
userIds: exports_external.array(id2)
|
|
39472
|
+
})).optional(),
|
|
39473
|
+
thread: exports_external.strictObject({
|
|
39474
|
+
id: id2,
|
|
39475
|
+
name: exports_external.string(),
|
|
39476
|
+
messageCount: exports_external.number().int().nonnegative(),
|
|
39477
|
+
lastReplyAt: exports_external.string().optional(),
|
|
39478
|
+
tags: exports_external.array(exports_external.string()).optional(),
|
|
39479
|
+
preview: exports_external.string().optional(),
|
|
39480
|
+
participants: exports_external.array(exports_external.strictObject({ id: id2, name: exports_external.string(), avatar: exports_external.string(), avatarVersion: exports_external.number().int().nonnegative() })).optional(),
|
|
39481
|
+
participantCount: exports_external.number().int().nonnegative().optional()
|
|
39482
|
+
}).optional(),
|
|
39483
|
+
approval: FriendApprovalPayloadSchema.optional()
|
|
39484
|
+
});
|
|
39485
|
+
var CommunityReadStateResourceSchema = exports_external.strictObject({
|
|
39486
|
+
channelId: id2,
|
|
39487
|
+
lastReadMessageId: nullableId,
|
|
39488
|
+
lastReadAt: exports_external.string().nullable(),
|
|
39489
|
+
lastReadSeq: exports_external.number().int().nonnegative()
|
|
39490
|
+
});
|
|
39491
|
+
var CommunityMemberRelationSchema = exports_external.strictObject({
|
|
39492
|
+
channelId: id2,
|
|
39493
|
+
userId: id2,
|
|
39494
|
+
relation: exports_external.enum(["access", "notify"]),
|
|
39495
|
+
source: exports_external.string(),
|
|
39496
|
+
isCreator: exports_external.boolean(),
|
|
39497
|
+
role: exports_external.string().nullable(),
|
|
39498
|
+
memberId: nullableId
|
|
39499
|
+
});
|
|
39500
|
+
var CommunityResourceProfileSchema = exports_external.strictObject({
|
|
39501
|
+
id: id2,
|
|
39502
|
+
name: exports_external.string(),
|
|
39503
|
+
discriminator: exports_external.string().nullable(),
|
|
39504
|
+
avatar: exports_external.string().nullable(),
|
|
39505
|
+
avatarVersion: exports_external.number().int().nonnegative(),
|
|
39506
|
+
statusEmoji: exports_external.string().nullable(),
|
|
39507
|
+
statusText: exports_external.string()
|
|
39508
|
+
});
|
|
39509
|
+
var CommunityPageSchema = exports_external.strictObject({
|
|
39510
|
+
olderCursor: exports_external.string().nullable(),
|
|
39511
|
+
newerCursor: exports_external.string().nullable(),
|
|
39512
|
+
hasMoreOlder: exports_external.boolean(),
|
|
39513
|
+
hasMoreNewer: exports_external.boolean(),
|
|
39514
|
+
latestSeq: exports_external.number().int().nonnegative()
|
|
39515
|
+
});
|
|
39516
|
+
var envelope = { contractVersion: exports_external.literal(COMMUNITY_CONTRACT_VERSION), channelId: id2 };
|
|
39517
|
+
var CommunityChannelReadSchema = exports_external.strictObject({ ...envelope, channel: CommunityChannelResourceSchema, access: CommunityAccessDecisionSchema });
|
|
39518
|
+
var CommunityMessagesReadSchema = exports_external.strictObject({
|
|
39519
|
+
...envelope,
|
|
39520
|
+
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
39521
|
+
page: CommunityPageSchema,
|
|
39522
|
+
surfaceReceipt: exports_external.strictObject({ channelId: id2, surfaceKind: exports_external.enum(["channel", "forum", "thread", "dm"]) })
|
|
39523
|
+
});
|
|
39524
|
+
var CommunityReadStateReadSchema = exports_external.strictObject({ ...envelope, readState: CommunityReadStateResourceSchema });
|
|
39525
|
+
var CommunityMembersReadSchema = exports_external.strictObject({ ...envelope, relation: exports_external.enum(["access", "notify"]), members: exports_external.array(CommunityMemberRelationSchema), profiles: exports_external.array(CommunityResourceProfileSchema) });
|
|
39526
|
+
var CommunityThreadsReadSchema = exports_external.strictObject({
|
|
39527
|
+
...envelope,
|
|
39528
|
+
channel: CommunityChannelResourceSchema,
|
|
39529
|
+
threads: exports_external.array(CommunityChannelResourceSchema),
|
|
39530
|
+
included: exports_external.strictObject({
|
|
39531
|
+
messages: exports_external.array(CommunityMessageResourceSchema),
|
|
39532
|
+
members: exports_external.array(CommunityMemberRelationSchema),
|
|
39533
|
+
profiles: exports_external.array(CommunityResourceProfileSchema),
|
|
39534
|
+
tags: exports_external.array(exports_external.strictObject({ messageId: id2, tag: exports_external.string() })),
|
|
39535
|
+
participantCounts: exports_external.array(exports_external.strictObject({ channelId: id2, count: exports_external.number().int().nonnegative() }))
|
|
39536
|
+
}),
|
|
39537
|
+
page: exports_external.strictObject({ nextCursor: exports_external.string().nullable(), hasMore: exports_external.boolean() })
|
|
39538
|
+
});
|
|
39539
|
+
var CommunityReadAdvanceSchema = exports_external.strictObject({ ...envelope, changed: exports_external.boolean(), targetSeq: exports_external.number().int().nonnegative(), revision: exports_external.number().int().nonnegative() });
|
|
39540
|
+
var CommunityReadErrorSchema = exports_external.strictObject({ contractVersion: exports_external.literal(COMMUNITY_CONTRACT_VERSION), error: exports_external.strictObject({
|
|
39541
|
+
code: exports_external.enum(["invalid_input", "invalid_reply_target", "unauthenticated", "not_found", "not_allowed", "blocked", "idempotency_conflict", "rate_limited", "temporarily_unavailable"]),
|
|
39542
|
+
message: exports_external.string(),
|
|
39543
|
+
retryable: exports_external.boolean()
|
|
39544
|
+
}) });
|
|
39545
|
+
var legacyChannelResourceSchema = CommunityChannelResourceSchema.strip().extend({
|
|
39546
|
+
topic: CommunityChannelResourceSchema.shape.topic.nullish().transform((value) => value ?? ""),
|
|
39547
|
+
position: CommunityChannelResourceSchema.shape.position.nullish().transform((value) => value ?? 0),
|
|
39548
|
+
messageCount: CommunityChannelResourceSchema.shape.messageCount.nullish().transform((value) => value ?? 0),
|
|
39549
|
+
categoryId: nullableId.default(null),
|
|
39550
|
+
parentChannelId: nullableId.default(null),
|
|
39551
|
+
parentMessageId: nullableId.default(null),
|
|
39552
|
+
creatorId: nullableId.default(null),
|
|
39553
|
+
lastMessageAt: CommunityChannelResourceSchema.shape.lastMessageAt.default(null),
|
|
39554
|
+
archived: legacyArchivedSchema
|
|
39555
|
+
});
|
|
39556
|
+
var legacyMessageResourceSchema = CommunityMessageResourceSchema.strip().extend({
|
|
39557
|
+
channelId: id2.optional(),
|
|
39558
|
+
replyToId: nullableId.optional(),
|
|
39559
|
+
clientNonce: CommunityMessageResourceSchema.shape.clientNonce.default(null),
|
|
39560
|
+
attachments: CommunityMessageResourceSchema.shape.attachments.default([]),
|
|
39561
|
+
embeds: CommunityMessageResourceSchema.shape.embeds.nullable().transform((value) => value ?? undefined)
|
|
39384
39562
|
});
|
|
39563
|
+
|
|
39564
|
+
// ../shared/src/community-ws-events.ts
|
|
39565
|
+
var string4 = exports_external.string();
|
|
39566
|
+
var nullableString = string4.nullable();
|
|
39567
|
+
var channelTypeSchema = CommunityChannelResourceSchema.shape.type.extract(["text", "forum"]);
|
|
39385
39568
|
var messageAttachmentSchema = exports_external.strictObject({
|
|
39386
39569
|
id: string4,
|
|
39387
39570
|
filename: string4,
|
|
@@ -39392,30 +39575,29 @@ var messageAttachmentSchema = exports_external.strictObject({
|
|
|
39392
39575
|
width: exports_external.number().nullable().optional(),
|
|
39393
39576
|
height: exports_external.number().nullable().optional()
|
|
39394
39577
|
});
|
|
39395
|
-
var messageSchema =
|
|
39578
|
+
var messageSchema = CommunityMessageResourceSchema.pick({
|
|
39579
|
+
content: true,
|
|
39580
|
+
type: true,
|
|
39581
|
+
systemKind: true,
|
|
39582
|
+
authorAvatar: true,
|
|
39583
|
+
authorAvatarVersion: true,
|
|
39584
|
+
mentionType: true,
|
|
39585
|
+
embeds: true,
|
|
39586
|
+
createdAt: true,
|
|
39587
|
+
approval: true
|
|
39588
|
+
}).extend({
|
|
39396
39589
|
id: string4,
|
|
39397
39590
|
seq: exports_external.number(),
|
|
39398
39591
|
authorId: string4,
|
|
39399
39592
|
authorName: string4,
|
|
39400
|
-
|
|
39401
|
-
authorAvatarVersion: exports_external.number().int().nonnegative(),
|
|
39402
|
-
content: string4,
|
|
39403
|
-
type: exports_external.enum(["chat", "system"]),
|
|
39404
|
-
systemKind: exports_external.literal("thread").optional(),
|
|
39405
|
-
mentionType: mentionTypeSchema.nullable().optional(),
|
|
39593
|
+
authorAvatarVersion: CommunityMessageResourceSchema.shape.authorAvatarVersion.unwrap(),
|
|
39406
39594
|
replyToId: nullableString.optional(),
|
|
39407
|
-
replyTo:
|
|
39595
|
+
replyTo: CommunityMessageResourceSchema.shape.replyTo.unwrap().extend({
|
|
39408
39596
|
id: string4,
|
|
39409
|
-
authorId: string4.optional()
|
|
39410
|
-
authorName: string4,
|
|
39411
|
-
text: string4,
|
|
39412
|
-
deleted: exports_external.boolean().optional()
|
|
39597
|
+
authorId: string4.optional()
|
|
39413
39598
|
}).optional(),
|
|
39414
|
-
embeds: exports_external.array(exports_external.unknown()).optional(),
|
|
39415
39599
|
attachments: exports_external.array(messageAttachmentSchema).optional(),
|
|
39416
|
-
|
|
39417
|
-
clientNonce: string4.optional(),
|
|
39418
|
-
approval: FriendApprovalPayloadSchema.optional()
|
|
39600
|
+
clientNonce: string4.optional()
|
|
39419
39601
|
});
|
|
39420
39602
|
var communityMessageCreateSchema = exports_external.strictObject({
|
|
39421
39603
|
type: exports_external.literal("community:message.create"),
|
|
@@ -39562,6 +39744,14 @@ var communityChannelMemberRemoveSchema = exports_external.strictObject({
|
|
|
39562
39744
|
channelId: string4,
|
|
39563
39745
|
userId: string4
|
|
39564
39746
|
});
|
|
39747
|
+
var communityChannelMembershipChangeSchema = exports_external.strictObject({
|
|
39748
|
+
type: exports_external.literal("community:channel.membership.change"),
|
|
39749
|
+
channelId: string4,
|
|
39750
|
+
serverId: string4.nullable(),
|
|
39751
|
+
userId: string4,
|
|
39752
|
+
relation: CommunityMemberRelationSchema.shape.relation,
|
|
39753
|
+
present: exports_external.boolean()
|
|
39754
|
+
});
|
|
39565
39755
|
var communityCategoryCreateSchema = exports_external.strictObject({
|
|
39566
39756
|
type: exports_external.literal("community:category.create"),
|
|
39567
39757
|
serverId: string4,
|
|
@@ -39646,7 +39836,8 @@ var communityFriendRemoveSchema = exports_external.strictObject({
|
|
|
39646
39836
|
});
|
|
39647
39837
|
var communityFriendBlockSchema = exports_external.strictObject({
|
|
39648
39838
|
type: exports_external.literal("community:friend.block"),
|
|
39649
|
-
userId: string4
|
|
39839
|
+
userId: string4,
|
|
39840
|
+
blockedByViewer: exports_external.boolean().optional()
|
|
39650
39841
|
});
|
|
39651
39842
|
var communityInviteCreateSchema = exports_external.strictObject({
|
|
39652
39843
|
type: exports_external.literal("community:invite.create"),
|
|
@@ -39789,6 +39980,7 @@ var CommunityWsEventDiscriminatedSchema = exports_external.discriminatedUnion("t
|
|
|
39789
39980
|
communityChannelReorderSchema,
|
|
39790
39981
|
communityChannelMemberAddSchema,
|
|
39791
39982
|
communityChannelMemberRemoveSchema,
|
|
39983
|
+
communityChannelMembershipChangeSchema,
|
|
39792
39984
|
communityCategoryCreateSchema,
|
|
39793
39985
|
communityCategoryUpdateSchema,
|
|
39794
39986
|
communityCategoryDeleteSchema,
|
|
@@ -39837,6 +40029,7 @@ var WS_EVENTS = {
|
|
|
39837
40029
|
CHANNEL_REORDER: "community:channel.reorder",
|
|
39838
40030
|
CHANNEL_MEMBER_ADD: "community:channel.member_add",
|
|
39839
40031
|
CHANNEL_MEMBER_REMOVE: "community:channel.member_remove",
|
|
40032
|
+
CHANNEL_MEMBERSHIP_CHANGE: "community:channel.membership.change",
|
|
39840
40033
|
CATEGORY_CREATE: "community:category.create",
|
|
39841
40034
|
CATEGORY_UPDATE: "community:category.update",
|
|
39842
40035
|
CATEGORY_DELETE: "community:category.delete",
|
|
@@ -39906,6 +40099,8 @@ var batchShape = exports_external.strictObject({
|
|
|
39906
40099
|
unreadMentionUserIds: targetList,
|
|
39907
40100
|
mentionUserIds: targetList,
|
|
39908
40101
|
memberAdded: memberAddedSchema.optional(),
|
|
40102
|
+
joinedParticipantUserIds: targetList.optional(),
|
|
40103
|
+
rosterRefreshUserId: target.optional(),
|
|
39909
40104
|
parentProjection: exports_external.unknown().optional(),
|
|
39910
40105
|
parentProjectionUserIds: targetList.optional()
|
|
39911
40106
|
});
|
|
@@ -42136,20 +42331,20 @@ async function detectRuntimes() {
|
|
|
42136
42331
|
const ids = listRuntimeIds();
|
|
42137
42332
|
const results = [];
|
|
42138
42333
|
const nowIso = new Date().toISOString();
|
|
42139
|
-
for (const
|
|
42334
|
+
for (const id3 of ids) {
|
|
42140
42335
|
try {
|
|
42141
|
-
const driver = getDriver(
|
|
42336
|
+
const driver = getDriver(id3);
|
|
42142
42337
|
const probe = await driver.probe();
|
|
42143
42338
|
if (probe.status === "healthy") {
|
|
42144
42339
|
results.push({
|
|
42145
|
-
id:
|
|
42340
|
+
id: id3,
|
|
42146
42341
|
status: "healthy",
|
|
42147
42342
|
version: probe.version,
|
|
42148
42343
|
reasoning: probe.reasoning
|
|
42149
42344
|
});
|
|
42150
42345
|
} else {
|
|
42151
42346
|
results.push({
|
|
42152
|
-
id:
|
|
42347
|
+
id: id3,
|
|
42153
42348
|
status: "unhealthy",
|
|
42154
42349
|
lastError: probe.error.code ?? "probe_failed",
|
|
42155
42350
|
lastErrorAt: nowIso
|
|
@@ -42157,7 +42352,7 @@ async function detectRuntimes() {
|
|
|
42157
42352
|
}
|
|
42158
42353
|
} catch (err) {
|
|
42159
42354
|
results.push({
|
|
42160
|
-
id:
|
|
42355
|
+
id: id3,
|
|
42161
42356
|
status: "unhealthy",
|
|
42162
42357
|
lastError: err?.code ?? "probe_threw",
|
|
42163
42358
|
lastErrorAt: nowIso
|
|
@@ -42857,7 +43052,7 @@ function appendRecentContextToPrompt(prompt, result) {
|
|
|
42857
43052
|
return lines.join(`
|
|
42858
43053
|
`);
|
|
42859
43054
|
}
|
|
42860
|
-
function createRecentContextPromptAppender(discover, recentSessionFilesTopK =
|
|
43055
|
+
function createRecentContextPromptAppender(discover, recentSessionFilesTopK = 20, recentProjectsTopK = 5) {
|
|
42861
43056
|
return async (prompt, runtimeConfig) => {
|
|
42862
43057
|
const selected = toAgentBackendSelection(runtimeConfig);
|
|
42863
43058
|
const command = selected.config.command;
|
|
@@ -42891,8 +43086,6 @@ var RUNTIME_RAW_TRACE_MAX_BYTES = 8 * 1024 * 1024;
|
|
|
42891
43086
|
var RUNTIME_RAW_TRACE_AGENT_IDS_ENV = "ALOOK_RUNTIME_RAW_TRACE_AGENT_IDS";
|
|
42892
43087
|
var STATUS_WRITE_INTERVAL_MS = 5000;
|
|
42893
43088
|
var TOKEN_USAGE_BACKENDS = new Set(["claude", "codex", "grok", "opencode", "pi", "antigravity"]);
|
|
42894
|
-
var ONBOARDING_RECENT_SESSION_FILES_TOP_K = 10;
|
|
42895
|
-
var ONBOARDING_RECENT_PROJECTS_TOP_K = 5;
|
|
42896
43089
|
function parseRuntimeRawTraceAgentIds(value) {
|
|
42897
43090
|
return new Set((value ?? "").split(",").map((agentId) => agentId.trim()).filter((agentId) => agentId.length > 0 && agentId !== "*"));
|
|
42898
43091
|
}
|
|
@@ -43027,7 +43220,7 @@ function createBuiltinDaemonSessionFactory(onRuntimeRawLine) {
|
|
|
43027
43220
|
async function createDaemon(opts) {
|
|
43028
43221
|
const log2 = opts.logger ?? createLogger({ header: "@alook/daemon" });
|
|
43029
43222
|
const recentContextSdk = createAgentDriverSdk();
|
|
43030
|
-
const appendRecentContext = createRecentContextPromptAppender((input2) => recentContextSdk.discoverRecentContext(input2)
|
|
43223
|
+
const appendRecentContext = createRecentContextPromptAppender((input2) => recentContextSdk.discoverRecentContext(input2));
|
|
43031
43224
|
const fallbackBase = (process.env.ALOOK_PROJECT_ROOT || `${homedir10()}/.alook`) + "/daemon";
|
|
43032
43225
|
const workingDirectoryBase = opts.workingDirectoryBase ?? fallbackBase;
|
|
43033
43226
|
const workdirFor = (agentId) => `${workingDirectoryBase}/${agentId}`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alook/daemon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.46",
|
|
4
4
|
"description": "Alook agent daemon — host-side runtime backend, process manager, credential proxy, and control plane.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://github.com/alookai/alook#readme",
|