@agent-team-foundation/first-tree-hub 0.14.3 → 0.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +4 -4
- package/dist/{client-BSfCc0pJ-BP_1f21y.mjs → client-BPRIfrOT-CoV_2o7e.mjs} +50 -8
- package/dist/{client-q1EYQD1n-ypjoumIO.mjs → client-CEdYVnoj-BGiGcJbH.mjs} +2 -2
- package/dist/{dist-CwsiHGX7.mjs → dist-CrdnqZjv.mjs} +2 -1
- package/dist/{feishu-DHSy6WDD.mjs → feishu-DNoBroKK.mjs} +1 -1
- package/dist/index.mjs +4 -4
- package/dist/{invitation-C9m2gQx4-BSErdb8x.mjs → invitation-C9m2gQx4-C_4f5VTs.mjs} +1 -1
- package/dist/{saas-connect-ChxZv2YQ.mjs → saas-connect-Da55XxRX.mjs} +51 -23
- package/dist/web/assets/index-9wK0udbH.js +416 -0
- package/dist/web/assets/{index-B76SVAz8.js → index-C7x7O7dG.js} +1 -1
- package/dist/web/index.html +1 -1
- package/package.json +1 -1
- package/dist/web/assets/index-DAAemCLz.js +0 -416
package/dist/cli/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import "../observability-BAScT_5S-BcW9HgkG.mjs";
|
|
3
|
-
import { $ as formatStaleReason, A as checkDocker, B as isServiceSupported, C as createApiNameResolver, D as checkBackgroundService, E as checkAgentConfigs, F as checkWebSocket, H as restartClientService, I as printResults, J as stopPostgres, L as reconcileAgentConfigs, M as checkServerConfig, N as checkServerHealth, O as checkClientConfig, P as checkServerReachable, Q as findStaleAliases, R as getClientServiceStatus, S as runHomeMigration, T as runMigrations, U as startClientService, W as stopClientService, X as handleClientOrgMismatch, Y as ClientRuntime, _ as formatCheckReport, a as declineUpdate, at as fail, b as onboardCreate, c as detectInstallMode, ct as ClientUserMismatchError, d as startServer, dt as SessionRegistry, et as removeLocalAgent, f as reconcileLocalRuntimeProviders, ft as cleanWorkspaces, g as promptMissingFields, h as promptAddAgent, ht as configureClientLoggerForService, i as createExecuteUpdate, it as resolveSenderName, j as checkNodeVersion, k as checkDatabase, l as fetchLatestVersion, lt as FirstTreeHubSDK, m as isInteractive, mt as applyClientLoggerConfig, o as promptUpdate, ot as success, p as uploadClientCapabilities, pt as probeCapabilities, r as registerSaaSConnectCommand, rt as resolveReplyToFromEnv, s as PACKAGE_NAME, st as ClientOrgMismatchError, tt as createOwner, u as installGlobalLatest, ut as SdkError, v as loadOnboardState, w as migrateLocalAgentDirs, x as saveOnboardState, y as onboardCheck, z as installClientService } from "../saas-connect-
|
|
3
|
+
import { $ as formatStaleReason, A as checkDocker, B as isServiceSupported, C as createApiNameResolver, D as checkBackgroundService, E as checkAgentConfigs, F as checkWebSocket, H as restartClientService, I as printResults, J as stopPostgres, L as reconcileAgentConfigs, M as checkServerConfig, N as checkServerHealth, O as checkClientConfig, P as checkServerReachable, Q as findStaleAliases, R as getClientServiceStatus, S as runHomeMigration, T as runMigrations, U as startClientService, W as stopClientService, X as handleClientOrgMismatch, Y as ClientRuntime, _ as formatCheckReport, a as declineUpdate, at as fail, b as onboardCreate, c as detectInstallMode, ct as ClientUserMismatchError, d as startServer, dt as SessionRegistry, et as removeLocalAgent, f as reconcileLocalRuntimeProviders, ft as cleanWorkspaces, g as promptMissingFields, h as promptAddAgent, ht as configureClientLoggerForService, i as createExecuteUpdate, it as resolveSenderName, j as checkNodeVersion, k as checkDatabase, l as fetchLatestVersion, lt as FirstTreeHubSDK, m as isInteractive, mt as applyClientLoggerConfig, o as promptUpdate, ot as success, p as uploadClientCapabilities, pt as probeCapabilities, r as registerSaaSConnectCommand, rt as resolveReplyToFromEnv, s as PACKAGE_NAME, st as ClientOrgMismatchError, tt as createOwner, u as installGlobalLatest, ut as SdkError, v as loadOnboardState, w as migrateLocalAgentDirs, x as saveOnboardState, y as onboardCheck, z as installClientService } from "../saas-connect-Da55XxRX.mjs";
|
|
4
4
|
import "../logger-core-BTmvdflj-DjW8FM4T.mjs";
|
|
5
5
|
import { C as resetConfigMeta, E as setConfigValue, S as resetConfig, T as serverConfigSchema, _ as getConfigValue, a as ensureFreshAdminToken, c as resolveServerUrl, d as DEFAULT_CONFIG_DIR, f as DEFAULT_DATA_DIR, h as clientConfigSchema, i as ensureFreshAccessToken, l as saveAgentConfig, m as agentConfigSchema, o as loadCredentials, p as DEFAULT_HOME_DIR, v as initConfig, w as resolveConfigReadonly, x as readConfigFile, y as loadAgents } from "../bootstrap-CQQGgIx1.mjs";
|
|
6
6
|
import { a as print, n as CLI_USER_AGENT, o as setJsonMode, r as COMMAND_VERSION, t as cliFetch } from "../cli-fetch--tiwKm5S.mjs";
|
|
7
|
-
import "../dist-
|
|
8
|
-
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-
|
|
7
|
+
import "../dist-CrdnqZjv.mjs";
|
|
8
|
+
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-DNoBroKK.mjs";
|
|
9
9
|
import "../uuid-DbS_4vFh-iFghv4zA.mjs";
|
|
10
10
|
import "../src-DNBS5Yjj.mjs";
|
|
11
|
-
import "../client-
|
|
11
|
+
import "../client-BPRIfrOT-CoV_2o7e.mjs";
|
|
12
12
|
import "../invitation-D_ENPHyj-5ETiae5r.mjs";
|
|
13
13
|
import { join } from "node:path";
|
|
14
14
|
import { existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { A as FIRST_TREE_HUB_ATTR, O as withSpan, f as messageAttrs, s as createLogger } from "./observability-BAScT_5S-BcW9HgkG.mjs";
|
|
2
|
-
import { L as extractMentions, N as defaultParticipantMode, P as defaultRuntimeConfigPayload, S as clientCapabilitiesSchema, St as stripCode, Z as isReservedAgentName, a as AGENT_TYPES, b as agentTypeSchema, ct as questionAnswerMessageContentSchema, d as MENTION_REGEX, i as AGENT_STATUSES, l as GITHUB_ENTITY_TYPES, lt as questionMessageContentSchema, mt as scanMentionTokens, n as AGENT_NAME_REGEX, nt as messageSourceSchema, o as AGENT_VISIBILITY, s as CHAT_ENGAGEMENT_STATUSES } from "./dist-
|
|
2
|
+
import { L as extractMentions, N as defaultParticipantMode, P as defaultRuntimeConfigPayload, S as clientCapabilitiesSchema, St as stripCode, Z as isReservedAgentName, a as AGENT_TYPES, b as agentTypeSchema, ct as questionAnswerMessageContentSchema, d as MENTION_REGEX, i as AGENT_STATUSES, l as GITHUB_ENTITY_TYPES, lt as questionMessageContentSchema, mt as scanMentionTokens, n as AGENT_NAME_REGEX, nt as messageSourceSchema, o as AGENT_VISIBILITY, s as CHAT_ENGAGEMENT_STATUSES } from "./dist-CrdnqZjv.mjs";
|
|
3
3
|
import { a as ClientUserMismatchError, c as NotFoundError, d as users, f as uuidv7, o as ConflictError, r as BadRequestError, s as ForbiddenError, t as AgentSendNonMemberError, u as organizations } from "./uuid-DbS_4vFh-iFghv4zA.mjs";
|
|
4
4
|
import { randomUUID } from "node:crypto";
|
|
5
5
|
import { and, asc, count, desc, eq, gt, gte, inArray, isNotNull, lt, ne, or, sql } from "drizzle-orm";
|
|
6
6
|
import { bigserial, boolean, customType, index, integer, jsonb, pgTable, primaryKey, serial, text, timestamp, unique } from "drizzle-orm/pg-core";
|
|
7
|
-
//#region ../server/dist/client-
|
|
7
|
+
//#region ../server/dist/client-BPRIfrOT.mjs
|
|
8
8
|
/**
|
|
9
9
|
* Client connections. A client is a single SDK process (AgentRuntime) that may
|
|
10
10
|
* host multiple agents. From the unified-user-token milestone on, a client is
|
|
@@ -725,8 +725,10 @@ async function listAgentsManagedByUser(db, userId) {
|
|
|
725
725
|
inboxId: agents.inboxId,
|
|
726
726
|
visibility: agents.visibility,
|
|
727
727
|
runtimeProvider: agents.runtimeProvider,
|
|
728
|
-
clientId: agents.clientId
|
|
729
|
-
|
|
728
|
+
clientId: agents.clientId,
|
|
729
|
+
avatarImageUpdatedAt: agents.avatarImageUpdatedAt,
|
|
730
|
+
userAvatarUrl: users.avatarUrl
|
|
731
|
+
}).from(agents).innerJoin(members, eq(agents.managerId, members.id)).leftJoin(users, eq(users.id, members.userId)).where(and(eq(members.userId, userId), eq(members.status, "active"), ne(agents.status, AGENT_STATUSES.DELETED)));
|
|
730
732
|
}
|
|
731
733
|
/**
|
|
732
734
|
* Resolve the UUID of the "default" organization. Internal use only —
|
|
@@ -1166,6 +1168,36 @@ function agentAvatarImageUrl(uuid, updatedAt) {
|
|
|
1166
1168
|
return `/api/v1/agents/${uuid}/avatar?v=${updatedAt.getTime()}`;
|
|
1167
1169
|
}
|
|
1168
1170
|
/**
|
|
1171
|
+
* Resolve the public avatar image URL for an agent, considering both the
|
|
1172
|
+
* manager-uploaded image and — for human agents — the user's external
|
|
1173
|
+
* avatar URL (e.g. GitHub `users.avatar_url` injected by OAuth). Returns
|
|
1174
|
+
* `null` when neither source is available; the renderer then falls back
|
|
1175
|
+
* to color + initial.
|
|
1176
|
+
*
|
|
1177
|
+
* Priority: uploaded image > human user's avatar > null. The "upload
|
|
1178
|
+
* wins" rule gives users explicit control: once they upload a custom
|
|
1179
|
+
* avatar for their human agent it always shows, regardless of any later
|
|
1180
|
+
* GitHub avatar change.
|
|
1181
|
+
*/
|
|
1182
|
+
function resolveAvatarImageUrl(args) {
|
|
1183
|
+
const uploaded = agentAvatarImageUrl(args.uuid, args.avatarImageUpdatedAt);
|
|
1184
|
+
if (uploaded) return uploaded;
|
|
1185
|
+
if (args.type === AGENT_TYPES.HUMAN && args.userAvatarUrl) return args.userAvatarUrl;
|
|
1186
|
+
return null;
|
|
1187
|
+
}
|
|
1188
|
+
/**
|
|
1189
|
+
* Look up the external user-avatar URL backing a human agent via the
|
|
1190
|
+
* `members.agent_id → members.user_id → users.avatar_url` path. Returns
|
|
1191
|
+
* `null` for non-human agents or when the user has no avatar URL
|
|
1192
|
+
* captured (e.g. signed in without GitHub OAuth). Used by single-agent
|
|
1193
|
+
* API responses; list endpoints inline the join in their SELECT.
|
|
1194
|
+
*/
|
|
1195
|
+
async function fetchUserAvatarForHumanAgent(db, agent) {
|
|
1196
|
+
if (agent.type !== AGENT_TYPES.HUMAN) return null;
|
|
1197
|
+
const [row] = await db.select({ avatarUrl: users.avatarUrl }).from(members).innerJoin(users, eq(members.userId, users.id)).where(eq(members.agentId, agent.uuid)).limit(1);
|
|
1198
|
+
return row?.avatarUrl ?? null;
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1169
1201
|
* True iff `clients.metadata.capabilities` is a non-empty object — i.e. the
|
|
1170
1202
|
* client has reported at least one runtime probe result. Used to distinguish
|
|
1171
1203
|
* "we don't know what's installed yet" (empty / never reported) from
|
|
@@ -1426,13 +1458,14 @@ async function listAgentsForAdmin(db, scope, limit, cursor) {
|
|
|
1426
1458
|
runtimeProvider: agents.runtimeProvider,
|
|
1427
1459
|
avatarColorToken: agents.avatarColorToken,
|
|
1428
1460
|
avatarImageUpdatedAt: agents.avatarImageUpdatedAt,
|
|
1461
|
+
userAvatarUrl: users.avatarUrl,
|
|
1429
1462
|
createdAt: agents.createdAt,
|
|
1430
1463
|
updatedAt: agents.updatedAt,
|
|
1431
1464
|
presenceStatus: agentPresence.status,
|
|
1432
1465
|
runtimeType: agentPresence.runtimeType,
|
|
1433
1466
|
runtimeState: agentPresence.runtimeState,
|
|
1434
1467
|
activeSessions: agentPresence.activeSessions
|
|
1435
|
-
}).from(agents).leftJoin(agentPresence, eq(agents.uuid, agentPresence.agentId)).where(where).orderBy(desc(agents.createdAt)).limit(limit + 1);
|
|
1468
|
+
}).from(agents).leftJoin(agentPresence, eq(agents.uuid, agentPresence.agentId)).leftJoin(members, eq(members.agentId, agents.uuid)).leftJoin(users, eq(users.id, members.userId)).where(where).orderBy(desc(agents.createdAt)).limit(limit + 1);
|
|
1436
1469
|
const hasMore = rows.length > limit;
|
|
1437
1470
|
const items = hasMore ? rows.slice(0, limit) : rows;
|
|
1438
1471
|
const last = items[items.length - 1];
|
|
@@ -1466,13 +1499,14 @@ async function listAgentsForMember(db, scope, limit, cursor, type) {
|
|
|
1466
1499
|
runtimeProvider: agents.runtimeProvider,
|
|
1467
1500
|
avatarColorToken: agents.avatarColorToken,
|
|
1468
1501
|
avatarImageUpdatedAt: agents.avatarImageUpdatedAt,
|
|
1502
|
+
userAvatarUrl: users.avatarUrl,
|
|
1469
1503
|
createdAt: agents.createdAt,
|
|
1470
1504
|
updatedAt: agents.updatedAt,
|
|
1471
1505
|
presenceStatus: agentPresence.status,
|
|
1472
1506
|
runtimeType: agentPresence.runtimeType,
|
|
1473
1507
|
runtimeState: agentPresence.runtimeState,
|
|
1474
1508
|
activeSessions: agentPresence.activeSessions
|
|
1475
|
-
}).from(agents).leftJoin(agentPresence, eq(agents.uuid, agentPresence.agentId)).where(where).orderBy(desc(agents.createdAt)).limit(limit + 1);
|
|
1509
|
+
}).from(agents).leftJoin(agentPresence, eq(agents.uuid, agentPresence.agentId)).leftJoin(members, eq(members.agentId, agents.uuid)).leftJoin(users, eq(users.id, members.userId)).where(where).orderBy(desc(agents.createdAt)).limit(limit + 1);
|
|
1476
1510
|
const hasMore = rows.length > limit;
|
|
1477
1511
|
const items = hasMore ? rows.slice(0, limit) : rows;
|
|
1478
1512
|
const last = items[items.length - 1];
|
|
@@ -3491,13 +3525,21 @@ async function getChatDetail(db, chatId, selfAgentId = null) {
|
|
|
3491
3525
|
displayName: p.displayName,
|
|
3492
3526
|
type: p.type
|
|
3493
3527
|
}));
|
|
3528
|
+
const viewerMembershipKind = await resolveViewerMembershipKind(db, chatId, selfAgentId);
|
|
3494
3529
|
return {
|
|
3495
3530
|
...chat,
|
|
3496
3531
|
participants,
|
|
3497
3532
|
title,
|
|
3498
|
-
firstMessagePreview
|
|
3533
|
+
firstMessagePreview,
|
|
3534
|
+
viewerMembershipKind
|
|
3499
3535
|
};
|
|
3500
3536
|
}
|
|
3537
|
+
async function resolveViewerMembershipKind(db, chatId, viewerAgentId) {
|
|
3538
|
+
if (!viewerAgentId) return null;
|
|
3539
|
+
const [row] = await db.select({ accessMode: chatMembership.accessMode }).from(chatMembership).where(and(eq(chatMembership.chatId, chatId), eq(chatMembership.agentId, viewerAgentId))).limit(1);
|
|
3540
|
+
if (!row) return null;
|
|
3541
|
+
return row.accessMode === "speaker" ? "participant" : "watching";
|
|
3542
|
+
}
|
|
3501
3543
|
async function listChats(db, agentId, limit, cursor) {
|
|
3502
3544
|
const chatIds = (await db.select({ chatId: chatMembership.chatId }).from(chatMembership).where(and(eq(chatMembership.agentId, agentId), eq(chatMembership.accessMode, "speaker")))).map((r) => r.chatId);
|
|
3503
3545
|
if (chatIds.length === 0) return {
|
|
@@ -4185,4 +4227,4 @@ async function cleanupStaleClients(db, staleSeconds = 60) {
|
|
|
4185
4227
|
return result.length;
|
|
4186
4228
|
}
|
|
4187
4229
|
//#endregion
|
|
4188
|
-
export {
|
|
4230
|
+
export { getSession as $, suspendSession as $t, createChat as A, pollInbox as At, fetchUserAvatarForHumanAgent as B, resolveAvatarImageUrl as Bt, claimBacklogForPush as C, markMeChatRead as Ct, clearAgentAvatarImage as D, messages as Dt, cleanupStalePresence as E, members as Et, disconnectClient as F, registerChatMessageDispatcher as Ft, getAgentAvatarImage as G, sendToAgent as Gt, findOrCreateDirectChat as H, resolveDefaultOrgId as Ht, editMessage as I, registerClient as It, getChatDetail as J, setChatEngagement as Jt, getCachedAudience as K, serverInstances as Kt, ensureDefaultOrganization as L, removeParticipant as Lt, createNotifier as M, reactivateAgent as Mt, deleteAgent as N, rebindAgent as Nt, clients as O, notifyRecipients as Ot, deriveAuthState as P, recomputeWatchersForMember as Pt, getPresence as Q, suspendAgent as Qt, ensureParticipant as R, resetActivity as Rt, claimAndBuildForPush as S, listMyPinnedAgents as St, cleanupStaleClients as T, markStaleAgents as Tt, getActivityOverview as U, retireClient as Ut, filterSessionsByParticipant as V, resolveChatTitle as Vt, getAgent as W, sendMessage as Wt, getOnlineCount as X, setRuntimeState as Xt, getClient as Y, setOffline as Yt, getOrganization as Z, submitAnswer as Zt, bindAgent as _, listClients as _t, adapterConfigs as a, upsertSessionState as an, leaveChat as at, chats as b, listMeChats as bt, addParticipant as c, listAgentSessions as ct, agentConfigs as d, listAgentsManagedByUser as dt, touchAgent as en, heartbeatClient as et, agentPresence as f, listAgentsWithRuntime as ft, assertParticipant as g, listChatsForMember as gt, assertClientOwner as h, listChats as ht, adapterAgentMappings as i, updateOrganization as in, joinMeChat as it, createMeChat as j, pruneStaleSilentEntries as jt, createAgent as k, pendingQuestions as kt, agentAvatarImageUrl as l, listAgentsForAdmin as lt, archiveSession as m, listChatParticipantsWithNames as mt, SUPPORTED_AVATAR_IMAGE_MIMES as n, updateAgent as nn, inboxEntries as nt, addChatParticipants as o, leaveMeChat as ot, agents as p, listAllSessions as pt, getCallerEngagement as q, setAgentAvatarImage as qt, ackEntryByIdForBoundAgents as r, updateClientCapabilities as rn, joinChat as rt, addMeChatParticipants as s, listActiveAgentsPinnedToClient as st, MAX_AVATAR_IMAGE_BYTES as t, unbindAgent as tn, heartbeatInstance as tt, agentChatSessions as u, listAgentsForMember as ut, chatMembership as v, listClientsForOrgAdmin as vt, claimClient as w, markMeChatUnread as wt, checkAgentNameAvailability as x, listMessages as xt, chatUserState as y, listMeChatSourceCounts as yt, extractSummary as z, resetTimedOutEntries as zt };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "./observability-BAScT_5S-BcW9HgkG.mjs";
|
|
2
2
|
import "./logger-core-BTmvdflj-DjW8FM4T.mjs";
|
|
3
|
-
import "./dist-
|
|
3
|
+
import "./dist-CrdnqZjv.mjs";
|
|
4
4
|
import "./uuid-DbS_4vFh-iFghv4zA.mjs";
|
|
5
5
|
import "./src-DNBS5Yjj.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { St as listMyPinnedAgents } from "./client-BPRIfrOT-CoV_2o7e.mjs";
|
|
7
7
|
export { listMyPinnedAgents };
|
|
@@ -756,7 +756,8 @@ z.object({
|
|
|
756
756
|
participants: z.array(chatParticipantDetailSchema),
|
|
757
757
|
title: z.string(),
|
|
758
758
|
firstMessagePreview: z.string().nullable(),
|
|
759
|
-
engagementStatus: chatEngagementStatusSchema
|
|
759
|
+
engagementStatus: chatEngagementStatusSchema,
|
|
760
|
+
viewerMembershipKind: z.enum(["participant", "watching"]).nullable()
|
|
760
761
|
});
|
|
761
762
|
const updateChatSchema = z.object({ topic: z.string().trim().max(500).nullable() });
|
|
762
763
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-BSw8zbkd.mjs";
|
|
2
2
|
import { t as cliFetch } from "./cli-fetch--tiwKm5S.mjs";
|
|
3
|
-
import { r as AGENT_SELECTOR_HEADER } from "./dist-
|
|
3
|
+
import { r as AGENT_SELECTOR_HEADER } from "./dist-CrdnqZjv.mjs";
|
|
4
4
|
//#region src/core/feishu.ts
|
|
5
5
|
var feishu_exports = /* @__PURE__ */ __exportAll({
|
|
6
6
|
bindFeishuBot: () => bindFeishuBot,
|
package/dist/index.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./observability-BAScT_5S-BcW9HgkG.mjs";
|
|
2
|
-
import { A as checkDocker, B as isServiceSupported, E as checkAgentConfigs, F as checkWebSocket, G as uninstallClientService, H as restartClientService, I as printResults, J as stopPostgres, K as ensurePostgres, M as checkServerConfig, N as checkServerHealth, O as checkClientConfig, P as checkServerReachable, R as getClientServiceStatus, S as runHomeMigration, T as runMigrations, U as startClientService, V as resolveCliInvocation, W as stopClientService, X as handleClientOrgMismatch, Y as ClientRuntime, Z as rotateClientIdWithBackup, _ as formatCheckReport, b as onboardCreate, d as startServer, g as promptMissingFields, h as promptAddAgent, j as checkNodeVersion, k as checkDatabase, lt as FirstTreeHubSDK, m as isInteractive, n as deriveHubUrlFromToken, nt as hasUser, q as isDockerAvailable, t as HubUrlDerivationError, tt as createOwner, ut as SdkError, y as onboardCheck, z as installClientService } from "./saas-connect-
|
|
2
|
+
import { A as checkDocker, B as isServiceSupported, E as checkAgentConfigs, F as checkWebSocket, G as uninstallClientService, H as restartClientService, I as printResults, J as stopPostgres, K as ensurePostgres, M as checkServerConfig, N as checkServerHealth, O as checkClientConfig, P as checkServerReachable, R as getClientServiceStatus, S as runHomeMigration, T as runMigrations, U as startClientService, V as resolveCliInvocation, W as stopClientService, X as handleClientOrgMismatch, Y as ClientRuntime, Z as rotateClientIdWithBackup, _ as formatCheckReport, b as onboardCreate, d as startServer, g as promptMissingFields, h as promptAddAgent, j as checkNodeVersion, k as checkDatabase, lt as FirstTreeHubSDK, m as isInteractive, n as deriveHubUrlFromToken, nt as hasUser, q as isDockerAvailable, t as HubUrlDerivationError, tt as createOwner, ut as SdkError, y as onboardCheck, z as installClientService } from "./saas-connect-Da55XxRX.mjs";
|
|
3
3
|
import "./logger-core-BTmvdflj-DjW8FM4T.mjs";
|
|
4
4
|
import { a as ensureFreshAdminToken, c as resolveServerUrl, i as ensureFreshAccessToken, n as AuthRefreshRateLimitedError, s as resolveAccessToken, t as AuthRefreshFailedError } from "./bootstrap-CQQGgIx1.mjs";
|
|
5
5
|
import { i as blank, s as status } from "./cli-fetch--tiwKm5S.mjs";
|
|
6
|
-
import "./dist-
|
|
7
|
-
import { n as bindFeishuUser, t as bindFeishuBot } from "./feishu-
|
|
6
|
+
import "./dist-CrdnqZjv.mjs";
|
|
7
|
+
import { n as bindFeishuUser, t as bindFeishuBot } from "./feishu-DNoBroKK.mjs";
|
|
8
8
|
import "./uuid-DbS_4vFh-iFghv4zA.mjs";
|
|
9
9
|
import "./src-DNBS5Yjj.mjs";
|
|
10
|
-
import "./client-
|
|
10
|
+
import "./client-BPRIfrOT-CoV_2o7e.mjs";
|
|
11
11
|
import "./invitation-D_ENPHyj-5ETiae5r.mjs";
|
|
12
12
|
export { AuthRefreshFailedError, AuthRefreshRateLimitedError, ClientRuntime, FirstTreeHubSDK, HubUrlDerivationError, SdkError, bindFeishuBot, bindFeishuUser, blank, checkAgentConfigs, checkClientConfig, checkDatabase, checkDocker, checkNodeVersion, checkServerConfig, checkServerHealth, checkServerReachable, checkWebSocket, createOwner, deriveHubUrlFromToken, ensureFreshAccessToken, ensureFreshAdminToken, ensurePostgres, formatCheckReport, getClientServiceStatus, handleClientOrgMismatch, hasUser, installClientService, isDockerAvailable, isInteractive, isServiceSupported, onboardCheck, onboardCreate, printResults, promptAddAgent, promptMissingFields, resolveAccessToken, resolveCliInvocation, resolveServerUrl, restartClientService, rotateClientIdWithBackup, runHomeMigration, runMigrations, startClientService, startServer, status, stopClientService, stopPostgres, uninstallClientService };
|
|
@@ -2,10 +2,10 @@ import { a as __toCommonJS, o as __toESM, t as __commonJSMin } from "./chunk-BSw
|
|
|
2
2
|
import { A as FIRST_TREE_HUB_ATTR, C as stampOrgScope, D as untrustedAttrs, E as startWsConnectionSpan, M as require_pino, O as withSpan, S as stampChatResource, _ as rootLogger$1, a as buildRateLimitError, c as currentTraceId, g as reportErrorToRoot, i as bodyCaptureOnSendHook, j as redactUrl, k as withWsMessageSpan, l as decodeJwtForTrace, m as observabilityPlugin, n as applyLoggerConfig, o as classifyJoseError, r as attachRequestContext, s as createLogger$1, t as adapterAttrs, u as endWsConnectionSpan, x as stampAgentResource, y as setWsConnectionAttrs } from "./observability-BAScT_5S-BcW9HgkG.mjs";
|
|
3
3
|
import { C as resetConfigMeta, E as setConfigValue, S as resetConfig, T as serverConfigSchema, b as migrateLegacyHome, c as resolveServerUrl, d as DEFAULT_CONFIG_DIR, f as DEFAULT_DATA_DIR$1, g as collectMissingPrompts, h as clientConfigSchema, i as ensureFreshAccessToken, l as saveAgentConfig, m as agentConfigSchema, o as loadCredentials, p as DEFAULT_HOME_DIR$1, u as saveCredentials, v as initConfig, w as resolveConfigReadonly, y as loadAgents } from "./bootstrap-CQQGgIx1.mjs";
|
|
4
4
|
import { a as print, i as blank, n as CLI_USER_AGENT, r as COMMAND_VERSION, s as status, t as cliFetch } from "./cli-fetch--tiwKm5S.mjs";
|
|
5
|
-
import { $ as listMeChatSourceCountsQuerySchema, A as createMeChatSchema, At as updateOrganizationSchema, B as githubAppInstallationClaimBodySchema, C as clientRegisterSchema, Ct as submitQuestionAnswerSchema, D as createAdapterMappingSchema, Dt as updateChatSchema, E as createAdapterConfigSchema, Et as updateAgentSchema, F as delegateFeishuUserSchema, G as imageInlineContentSchema, H as githubCallbackQuerySchema, I as dryRunAgentRuntimeConfigSchema, J as inboxPollQuerySchema, K as inboxAckFrameSchema, M as createOrgFromMeSchema, O as createAgentSchema, Ot as updateClientCapabilitiesSchema, Q as joinByInvitationSchema, R as getMeDocResponseSchema, T as contextTreeSnapshotSchema, Tt as updateAgentRuntimeConfigSchema, U as githubDevCallbackQuerySchema, V as githubAppInstallationPermissionsSchema$1, W as githubStartQuerySchema, X as isRedactedEnvValue, Y as isOrgSettingNamespace, _ as agentBindRequestSchema, _t as sendToAgentSchema, at as paginationQuerySchema, b as agentTypeSchema$1, bt as sessionReconcileRequestSchema, dt as refreshTokenSchema, et as listMeChatsQuerySchema, f as NOTIFICATION_TYPES, ft as runtimeStateMessageSchema, g as addParticipantSchema, gt as sendMessageSchema, h as addMeChatParticipantsSchema, ht as selfServiceFeishuBotSchema, i as AGENT_STATUSES, it as onboardingEventSchema, j as createMemberSchema, jt as wsAuthFrameSchema, k as createChatSchema, kt as updateMemberSchema, m as WS_AUTH_FRAME_TIMEOUT_MS, o as AGENT_VISIBILITY, ot as patchChatEngagementSchema, p as ORG_SETTINGS_NAMESPACES$1, pt as safeRedirectPath, q as inboxDeliverFrameSchema$1, r as AGENT_SELECTOR_HEADER$1, rt as notificationQuerySchema, s as CHAT_ENGAGEMENT_STATUSES, st as patchOnboardingSchema, t as AGENT_BIND_REJECT_REASONS, tt as loginSchema, ut as rebindAgentSchema, v as agentPinnedMessageSchema$1, vt as sessionEventMessageSchema, w as connectTokenExchangeSchema, wt as updateAdapterConfigSchema, x as chatMetadataSchema$1, xt as sessionStateMessageSchema, y as agentRuntimeConfigPayloadSchema$1, yt as sessionEventSchema$1, z as getMeDocSchema } from "./dist-
|
|
5
|
+
import { $ as listMeChatSourceCountsQuerySchema, A as createMeChatSchema, At as updateOrganizationSchema, B as githubAppInstallationClaimBodySchema, C as clientRegisterSchema, Ct as submitQuestionAnswerSchema, D as createAdapterMappingSchema, Dt as updateChatSchema, E as createAdapterConfigSchema, Et as updateAgentSchema, F as delegateFeishuUserSchema, G as imageInlineContentSchema, H as githubCallbackQuerySchema, I as dryRunAgentRuntimeConfigSchema, J as inboxPollQuerySchema, K as inboxAckFrameSchema, M as createOrgFromMeSchema, O as createAgentSchema, Ot as updateClientCapabilitiesSchema, Q as joinByInvitationSchema, R as getMeDocResponseSchema, T as contextTreeSnapshotSchema, Tt as updateAgentRuntimeConfigSchema, U as githubDevCallbackQuerySchema, V as githubAppInstallationPermissionsSchema$1, W as githubStartQuerySchema, X as isRedactedEnvValue, Y as isOrgSettingNamespace, _ as agentBindRequestSchema, _t as sendToAgentSchema, at as paginationQuerySchema, b as agentTypeSchema$1, bt as sessionReconcileRequestSchema, dt as refreshTokenSchema, et as listMeChatsQuerySchema, f as NOTIFICATION_TYPES, ft as runtimeStateMessageSchema, g as addParticipantSchema, gt as sendMessageSchema, h as addMeChatParticipantsSchema, ht as selfServiceFeishuBotSchema, i as AGENT_STATUSES, it as onboardingEventSchema, j as createMemberSchema, jt as wsAuthFrameSchema, k as createChatSchema, kt as updateMemberSchema, m as WS_AUTH_FRAME_TIMEOUT_MS, o as AGENT_VISIBILITY, ot as patchChatEngagementSchema, p as ORG_SETTINGS_NAMESPACES$1, pt as safeRedirectPath, q as inboxDeliverFrameSchema$1, r as AGENT_SELECTOR_HEADER$1, rt as notificationQuerySchema, s as CHAT_ENGAGEMENT_STATUSES, st as patchOnboardingSchema, t as AGENT_BIND_REJECT_REASONS, tt as loginSchema, ut as rebindAgentSchema, v as agentPinnedMessageSchema$1, vt as sessionEventMessageSchema, w as connectTokenExchangeSchema, wt as updateAdapterConfigSchema, x as chatMetadataSchema$1, xt as sessionStateMessageSchema, y as agentRuntimeConfigPayloadSchema$1, yt as sessionEventSchema$1, z as getMeDocSchema } from "./dist-CrdnqZjv.mjs";
|
|
6
6
|
import { a as ClientUserMismatchError$1, c as NotFoundError, d as users, f as uuidv7, i as ClientOrgMismatchError$1, l as UnauthorizedError, n as AppError, o as ConflictError, r as BadRequestError, s as ForbiddenError, u as organizations } from "./uuid-DbS_4vFh-iFghv4zA.mjs";
|
|
7
7
|
import { n as init_esm, r as trace, t as esm_exports } from "./esm-iadMkGbV.mjs";
|
|
8
|
-
import { $ as
|
|
8
|
+
import { $ as getSession, $t as suspendSession, A as createChat, At as pollInbox, B as fetchUserAvatarForHumanAgent, Bt as resolveAvatarImageUrl, C as claimBacklogForPush, Ct as markMeChatRead, D as clearAgentAvatarImage, Dt as messages, E as cleanupStalePresence, Et as members, F as disconnectClient, Ft as registerChatMessageDispatcher, G as getAgentAvatarImage, Gt as sendToAgent$1, H as findOrCreateDirectChat, Ht as resolveDefaultOrgId$1, I as editMessage, It as registerClient, J as getChatDetail, Jt as setChatEngagement, K as getCachedAudience, Kt as serverInstances, L as ensureDefaultOrganization, Lt as removeParticipant, M as createNotifier, Mt as reactivateAgent, N as deleteAgent, Nt as rebindAgent, O as clients, Ot as notifyRecipients, P as deriveAuthState, Pt as recomputeWatchersForMember, Q as getPresence, Qt as suspendAgent, R as ensureParticipant, Rt as resetActivity, S as claimAndBuildForPush, T as cleanupStaleClients, Tt as markStaleAgents, U as getActivityOverview, Ut as retireClient, V as filterSessionsByParticipant, Vt as resolveChatTitle, W as getAgent, Wt as sendMessage, X as getOnlineCount, Xt as setRuntimeState, Y as getClient, Yt as setOffline, Z as getOrganization, Zt as submitAnswer, _ as bindAgent, _t as listClients, a as adapterConfigs, an as upsertSessionState, at as leaveChat, b as chats, bt as listMeChats, c as addParticipant, ct as listAgentSessions, d as agentConfigs, dt as listAgentsManagedByUser, en as touchAgent, et as heartbeatClient, f as agentPresence, ft as listAgentsWithRuntime, g as assertParticipant, gt as listChatsForMember, h as assertClientOwner, ht as listChats, i as adapterAgentMappings, in as updateOrganization, it as joinMeChat, j as createMeChat, jt as pruneStaleSilentEntries, k as createAgent, kt as pendingQuestions, l as agentAvatarImageUrl, lt as listAgentsForAdmin, m as archiveSession, mt as listChatParticipantsWithNames, n as SUPPORTED_AVATAR_IMAGE_MIMES, nn as updateAgent, nt as inboxEntries, o as addChatParticipants, ot as leaveMeChat, p as agents, pt as listAllSessions, q as getCallerEngagement, qt as setAgentAvatarImage, r as ackEntryByIdForBoundAgents, rn as updateClientCapabilities, rt as joinChat, s as addMeChatParticipants, st as listActiveAgentsPinnedToClient, t as MAX_AVATAR_IMAGE_BYTES, tn as unbindAgent, tt as heartbeatInstance, u as agentChatSessions, ut as listAgentsForMember, v as chatMembership, vt as listClientsForOrgAdmin, w as claimClient, wt as markMeChatUnread, x as checkAgentNameAvailability, xt as listMessages, y as chatUserState, yt as listMeChatSourceCounts, z as extractSummary, zt as resetTimedOutEntries } from "./client-BPRIfrOT-CoV_2o7e.mjs";
|
|
9
9
|
import { a as invitationRedemptions, c as recordRedemption, i as getActiveInvitation, l as rotateInvitation, n as ensureActiveInvitation, o as invitations, r as findActiveByToken, t as buildInviteUrl } from "./invitation-D_ENPHyj-5ETiae5r.mjs";
|
|
10
10
|
import { createRequire } from "node:module";
|
|
11
11
|
import { ZodError, z } from "zod";
|
|
@@ -850,7 +850,8 @@ z.object({
|
|
|
850
850
|
participants: z.array(chatParticipantDetailSchema),
|
|
851
851
|
title: z.string(),
|
|
852
852
|
firstMessagePreview: z.string().nullable(),
|
|
853
|
-
engagementStatus: chatEngagementStatusSchema
|
|
853
|
+
engagementStatus: chatEngagementStatusSchema,
|
|
854
|
+
viewerMembershipKind: z.enum(["participant", "watching"]).nullable()
|
|
854
855
|
});
|
|
855
856
|
z.object({ topic: z.string().trim().max(500).nullable() });
|
|
856
857
|
z.object({ agentId: z.string().min(1) });
|
|
@@ -9762,7 +9763,7 @@ async function onboardCreate(args) {
|
|
|
9762
9763
|
}
|
|
9763
9764
|
const runtimeAgent = args.type === "human" ? args.assistant : args.id;
|
|
9764
9765
|
if (args.feishuBotAppId && args.feishuBotAppSecret) {
|
|
9765
|
-
const { bindFeishuBot } = await import("./feishu-
|
|
9766
|
+
const { bindFeishuBot } = await import("./feishu-DNoBroKK.mjs").then((n) => n.r);
|
|
9766
9767
|
const targetAgentUuid = args.type === "human" ? assistantUuid : primary.uuid;
|
|
9767
9768
|
if (!targetAgentUuid) print.line(`Warning: Cannot bind Feishu bot — no runtime agent available for "${args.id}".\n`);
|
|
9768
9769
|
else {
|
|
@@ -10975,7 +10976,7 @@ function createFeedbackHandler(config) {
|
|
|
10975
10976
|
return { handle };
|
|
10976
10977
|
}
|
|
10977
10978
|
//#endregion
|
|
10978
|
-
//#region ../server/dist/app-
|
|
10979
|
+
//#region ../server/dist/app-D4mz6WSP.mjs
|
|
10979
10980
|
var import_fastify_opentelemetry = /* @__PURE__ */ __toESM(require_fastify_opentelemetry(), 1);
|
|
10980
10981
|
init_esm();
|
|
10981
10982
|
var __defProp = Object.defineProperty;
|
|
@@ -13134,17 +13135,23 @@ async function agentActivityRoutes(app) {
|
|
|
13134
13135
|
/**
|
|
13135
13136
|
* Project a DB agent row into its wire shape. Strips the inline image
|
|
13136
13137
|
* `avatarImageData` (large bytea, only meant for the image-serve route)
|
|
13137
|
-
* and synthesises the public `avatarImageUrl`
|
|
13138
|
-
*
|
|
13139
|
-
*
|
|
13138
|
+
* and synthesises the public `avatarImageUrl` via {@link resolveAvatarImageUrl}
|
|
13139
|
+
* so human agents fall back to the backing user's external avatar URL
|
|
13140
|
+
* (e.g. GitHub) when no upload exists. `createdAt`/`updatedAt` are
|
|
13141
|
+
* coerced to ISO strings so the response is pure JSON.
|
|
13140
13142
|
*/
|
|
13141
|
-
function serializeAgent(agent) {
|
|
13143
|
+
function serializeAgent(agent, userAvatarUrl) {
|
|
13142
13144
|
const { avatarImageData: _data, avatarImageMime: _mime, avatarImageUpdatedAt, createdAt, updatedAt, ...rest } = agent;
|
|
13143
13145
|
return {
|
|
13144
13146
|
...rest,
|
|
13145
13147
|
createdAt: createdAt.toISOString(),
|
|
13146
13148
|
updatedAt: updatedAt.toISOString(),
|
|
13147
|
-
avatarImageUrl:
|
|
13149
|
+
avatarImageUrl: resolveAvatarImageUrl({
|
|
13150
|
+
uuid: agent.uuid,
|
|
13151
|
+
type: agent.type,
|
|
13152
|
+
avatarImageUpdatedAt,
|
|
13153
|
+
userAvatarUrl
|
|
13154
|
+
})
|
|
13148
13155
|
};
|
|
13149
13156
|
}
|
|
13150
13157
|
/**
|
|
@@ -13176,7 +13183,7 @@ async function agentRoutes(app) {
|
|
|
13176
13183
|
}
|
|
13177
13184
|
app.get("/:uuid", async (request) => {
|
|
13178
13185
|
const { agent } = await requireAgentAccess(request, app.db, "visible");
|
|
13179
|
-
return serializeAgent(agent);
|
|
13186
|
+
return serializeAgent(agent, await fetchUserAvatarForHumanAgent(app.db, agent));
|
|
13180
13187
|
});
|
|
13181
13188
|
app.patch("/:uuid", { config: { otelRecordBody: true } }, async (request) => {
|
|
13182
13189
|
const { scope } = await requireAgentAccess(request, app.db, "manage");
|
|
@@ -13185,14 +13192,14 @@ async function agentRoutes(app) {
|
|
|
13185
13192
|
const before = body.clientId !== void 0 ? await getAgent(app.db, request.params.uuid) : null;
|
|
13186
13193
|
const agent = await updateAgent(app.db, request.params.uuid, body);
|
|
13187
13194
|
if (before && before.clientId === null && agent.clientId !== null) notifyClientAgentPinned(agent);
|
|
13188
|
-
return serializeAgent(agent);
|
|
13195
|
+
return serializeAgent(agent, await fetchUserAvatarForHumanAgent(app.db, agent));
|
|
13189
13196
|
});
|
|
13190
13197
|
app.patch("/:uuid/rebind", { config: { otelRecordBody: true } }, async (request) => {
|
|
13191
13198
|
await requireAgentAccess(request, app.db, "manage");
|
|
13192
13199
|
const body = rebindAgentSchema.parse(request.body);
|
|
13193
13200
|
const agent = await rebindAgent(app.db, request.params.uuid, body);
|
|
13194
13201
|
notifyClientAgentPinned(agent);
|
|
13195
|
-
return serializeAgent(agent);
|
|
13202
|
+
return serializeAgent(agent, await fetchUserAvatarForHumanAgent(app.db, agent));
|
|
13196
13203
|
});
|
|
13197
13204
|
app.post("/:uuid/disconnect", async (request, reply) => {
|
|
13198
13205
|
await requireAgentAccess(request, app.db, "manage");
|
|
@@ -13202,11 +13209,13 @@ async function agentRoutes(app) {
|
|
|
13202
13209
|
});
|
|
13203
13210
|
app.post("/:uuid/suspend", async (request) => {
|
|
13204
13211
|
await requireAgentAccess(request, app.db, "manage");
|
|
13205
|
-
|
|
13212
|
+
const agent = await suspendAgent(app.db, request.params.uuid);
|
|
13213
|
+
return serializeAgent(agent, await fetchUserAvatarForHumanAgent(app.db, agent));
|
|
13206
13214
|
});
|
|
13207
13215
|
app.post("/:uuid/reactivate", async (request) => {
|
|
13208
13216
|
await requireAgentAccess(request, app.db, "manage");
|
|
13209
|
-
|
|
13217
|
+
const agent = await reactivateAgent(app.db, request.params.uuid);
|
|
13218
|
+
return serializeAgent(agent, await fetchUserAvatarForHumanAgent(app.db, agent));
|
|
13210
13219
|
});
|
|
13211
13220
|
app.delete("/:uuid", async (request, reply) => {
|
|
13212
13221
|
await requireAgentAccess(request, app.db, "manage");
|
|
@@ -14999,11 +15008,14 @@ async function chatRoutes(app) {
|
|
|
14999
15008
|
}));
|
|
15000
15009
|
const title = resolveChatTitle(chat.topic, firstMessagePreview, participantsForTitle, scope.humanAgentId);
|
|
15001
15010
|
const engagementStatus = await getCallerEngagement(app.db, chat.id, scope.humanAgentId);
|
|
15011
|
+
const [callerMembership] = await app.db.select({ accessMode: chatMembership.accessMode }).from(chatMembership).where(and(eq(chatMembership.chatId, chat.id), eq(chatMembership.agentId, scope.humanAgentId))).limit(1);
|
|
15012
|
+
const viewerMembershipKind = callerMembership ? callerMembership.accessMode === "speaker" ? "participant" : "watching" : null;
|
|
15002
15013
|
return {
|
|
15003
15014
|
...chat,
|
|
15004
15015
|
title,
|
|
15005
15016
|
firstMessagePreview,
|
|
15006
15017
|
engagementStatus,
|
|
15018
|
+
viewerMembershipKind,
|
|
15007
15019
|
createdAt: chat.createdAt.toISOString(),
|
|
15008
15020
|
updatedAt: chat.updatedAt.toISOString(),
|
|
15009
15021
|
participants: participants.map((p) => ({
|
|
@@ -16605,7 +16617,7 @@ async function healthzRoutes(app) {
|
|
|
16605
16617
|
* `api/orgs/invitations.ts` (Class B, admin-gated).
|
|
16606
16618
|
*/
|
|
16607
16619
|
async function publicInvitationRoutes(app) {
|
|
16608
|
-
const { previewInvitation } = await import("./invitation-C9m2gQx4-
|
|
16620
|
+
const { previewInvitation } = await import("./invitation-C9m2gQx4-C_4f5VTs.mjs");
|
|
16609
16621
|
app.get("/:token/preview", async (request, reply) => {
|
|
16610
16622
|
if (!request.params.token) throw new UnauthorizedError("Token required");
|
|
16611
16623
|
const preview = await previewInvitation(app.db, request.params.token);
|
|
@@ -16884,7 +16896,13 @@ async function meRoutes(app) {
|
|
|
16884
16896
|
inboxId: r.inboxId,
|
|
16885
16897
|
visibility: r.visibility,
|
|
16886
16898
|
runtimeProvider: r.runtimeProvider,
|
|
16887
|
-
clientId: r.clientId
|
|
16899
|
+
clientId: r.clientId,
|
|
16900
|
+
avatarImageUrl: resolveAvatarImageUrl({
|
|
16901
|
+
uuid: r.uuid,
|
|
16902
|
+
type: r.type,
|
|
16903
|
+
avatarImageUpdatedAt: r.avatarImageUpdatedAt,
|
|
16904
|
+
userAvatarUrl: r.userAvatarUrl
|
|
16905
|
+
})
|
|
16888
16906
|
}));
|
|
16889
16907
|
});
|
|
16890
16908
|
/**
|
|
@@ -16894,7 +16912,7 @@ async function meRoutes(app) {
|
|
|
16894
16912
|
*/
|
|
16895
16913
|
app.get("/me/pinned-agents", async (request) => {
|
|
16896
16914
|
const { userId } = requireUser(request);
|
|
16897
|
-
const { listMyPinnedAgents } = await import("./client-
|
|
16915
|
+
const { listMyPinnedAgents } = await import("./client-CEdYVnoj-BGiGcJbH.mjs");
|
|
16898
16916
|
return listMyPinnedAgents(app.db, { userId });
|
|
16899
16917
|
});
|
|
16900
16918
|
/**
|
|
@@ -17278,7 +17296,7 @@ async function orgAgentRoutes(app) {
|
|
|
17278
17296
|
const { type } = listAgentsFilterSchema.parse(request.query);
|
|
17279
17297
|
const result = await listAgentsForMember(app.db, scope, query.limit, query.cursor, type);
|
|
17280
17298
|
return {
|
|
17281
|
-
items: result.items.map(({ avatarImageUpdatedAt, ...a }) => ({
|
|
17299
|
+
items: result.items.map(({ avatarImageUpdatedAt, userAvatarUrl, ...a }) => ({
|
|
17282
17300
|
...a,
|
|
17283
17301
|
managerId: a.managerId ?? null,
|
|
17284
17302
|
presenceStatus: a.presenceStatus ?? "offline",
|
|
@@ -17288,7 +17306,12 @@ async function orgAgentRoutes(app) {
|
|
|
17288
17306
|
runtimeType: a.runtimeType ?? null,
|
|
17289
17307
|
runtimeState: a.runtimeState ?? null,
|
|
17290
17308
|
activeSessions: a.activeSessions ?? null,
|
|
17291
|
-
avatarImageUrl:
|
|
17309
|
+
avatarImageUrl: resolveAvatarImageUrl({
|
|
17310
|
+
uuid: a.uuid,
|
|
17311
|
+
type: a.type,
|
|
17312
|
+
avatarImageUpdatedAt,
|
|
17313
|
+
userAvatarUrl
|
|
17314
|
+
})
|
|
17292
17315
|
})),
|
|
17293
17316
|
nextCursor: result.nextCursor
|
|
17294
17317
|
};
|
|
@@ -17304,7 +17327,7 @@ async function orgAgentRoutes(app) {
|
|
|
17304
17327
|
const query = paginationQuerySchema.parse(request.query);
|
|
17305
17328
|
const result = await listAgentsForAdmin(app.db, scope, query.limit, query.cursor);
|
|
17306
17329
|
return {
|
|
17307
|
-
items: result.items.map(({ avatarImageUpdatedAt, ...a }) => ({
|
|
17330
|
+
items: result.items.map(({ avatarImageUpdatedAt, userAvatarUrl, ...a }) => ({
|
|
17308
17331
|
...a,
|
|
17309
17332
|
managerId: a.managerId ?? null,
|
|
17310
17333
|
presenceStatus: a.presenceStatus ?? "offline",
|
|
@@ -17314,7 +17337,12 @@ async function orgAgentRoutes(app) {
|
|
|
17314
17337
|
runtimeType: a.runtimeType ?? null,
|
|
17315
17338
|
runtimeState: a.runtimeState ?? null,
|
|
17316
17339
|
activeSessions: a.activeSessions ?? null,
|
|
17317
|
-
avatarImageUrl:
|
|
17340
|
+
avatarImageUrl: resolveAvatarImageUrl({
|
|
17341
|
+
uuid: a.uuid,
|
|
17342
|
+
type: a.type,
|
|
17343
|
+
avatarImageUpdatedAt,
|
|
17344
|
+
userAvatarUrl
|
|
17345
|
+
})
|
|
17318
17346
|
})),
|
|
17319
17347
|
nextCursor: result.nextCursor
|
|
17320
17348
|
};
|
|
@@ -21232,7 +21260,7 @@ function detectInstallMode(argv1 = process.argv[1] ?? "") {
|
|
|
21232
21260
|
resolvedArgv1 = argv1;
|
|
21233
21261
|
}
|
|
21234
21262
|
const start = dirname(resolve(resolvedArgv1));
|
|
21235
|
-
{
|
|
21263
|
+
if (!/(?:^|[\\/])node_modules[\\/]/.test(resolvedArgv1)) {
|
|
21236
21264
|
let dir = start;
|
|
21237
21265
|
for (let i = 0; i < 10; i++) {
|
|
21238
21266
|
if (existsSync(resolve(dir, ".git"))) return "source";
|