@agent-team-foundation/first-tree-hub 0.12.10 → 0.13.0

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.
@@ -1,10 +1,10 @@
1
1
  import { O as withSpan, f as messageAttrs, s as createLogger } from "./observability-BAScT_5S-BcW9HgkG.mjs";
2
- import { F as extractMentions, b as clientCapabilitiesSchema, i as AGENT_STATUSES, it as questionMessageContentSchema, j as defaultParticipantMode, lt as scanMentionTokens, o as AGENT_VISIBILITY, rt as questionAnswerMessageContentSchema, s as CHAT_ENGAGEMENT_STATUSES, v as agentTypeSchema } from "./dist-B1GHzMLc.mjs";
3
- import { a as ConflictError, i as ClientUserMismatchError, l as organizations, n as BadRequestError, o as ForbiddenError, s as NotFoundError, u as users } from "./errors-CF5evtJt-B0NTIVPt.mjs";
2
+ import { I as extractMentions, M as defaultParticipantMode, at as questionMessageContentSchema, i as AGENT_STATUSES, it as questionAnswerMessageContentSchema, o as AGENT_VISIBILITY, s as CHAT_ENGAGEMENT_STATUSES, ut as scanMentionTokens, x as clientCapabilitiesSchema, y as agentTypeSchema } from "./dist-C8yStx2L.mjs";
3
+ import { a as ConflictError, i as ClientUserMismatchError, l as organizations, n as BadRequestError, o as ForbiddenError, s as NotFoundError, u as users } from "./errors-LPcARA4K-Dbrptiyz.mjs";
4
4
  import { randomUUID } from "node:crypto";
5
5
  import { and, desc, eq, inArray, isNotNull, lt, ne, or, sql } from "drizzle-orm";
6
6
  import { bigserial, boolean, index, integer, jsonb, pgTable, primaryKey, text, timestamp, unique } from "drizzle-orm/pg-core";
7
- //#region ../server/dist/client-BViGcaUC.mjs
7
+ //#region ../server/dist/client-BH4CmUL0.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
@@ -1306,6 +1306,7 @@ const pendingQuestions = pgTable("pending_questions", {
1306
1306
  const INBOX_CHANNEL = "inbox_notifications";
1307
1307
  const CONFIG_CHANNEL = "config_changes";
1308
1308
  const SESSION_STATE_CHANNEL = "session_state_changes";
1309
+ const SESSION_EVENT_CHANNEL = "session_event_changes";
1309
1310
  const RUNTIME_STATE_CHANNEL = "runtime_state_changes";
1310
1311
  /**
1311
1312
  * Chat-first workspace cross-process kick. Carries `<chatId>:<messageId>`.
@@ -1326,12 +1327,14 @@ function createNotifier(listenClient) {
1326
1327
  const subscriptions = /* @__PURE__ */ new Map();
1327
1328
  const configChangeHandlers = [];
1328
1329
  const sessionStateChangeHandlers = [];
1330
+ const sessionEventHandlers = [];
1329
1331
  const runtimeStateChangeHandlers = [];
1330
1332
  const chatMessageHandlers = [];
1331
1333
  const adminBroadcastHandlers = [];
1332
1334
  let unlistenInboxFn = null;
1333
1335
  let unlistenConfigFn = null;
1334
1336
  let unlistenSessionStateFn = null;
1337
+ let unlistenSessionEventFn = null;
1335
1338
  let unlistenRuntimeStateFn = null;
1336
1339
  let unlistenChatMessageFn = null;
1337
1340
  let unlistenAdminBroadcastFn = null;
@@ -1384,6 +1387,11 @@ function createNotifier(listenClient) {
1384
1387
  await listenClient`SELECT pg_notify(${SESSION_STATE_CHANNEL}, ${`${agentId}:${chatId}:${state}:${organizationId}`})`;
1385
1388
  } catch {}
1386
1389
  },
1390
+ async notifySessionEvent(agentId, chatId, kind, organizationId) {
1391
+ try {
1392
+ await listenClient`SELECT pg_notify(${SESSION_EVENT_CHANNEL}, ${`${agentId}:${chatId}:${kind}:${organizationId}`})`;
1393
+ } catch {}
1394
+ },
1387
1395
  async notifyRuntimeStateChange(agentId, state, organizationId) {
1388
1396
  try {
1389
1397
  await listenClient`SELECT pg_notify(${RUNTIME_STATE_CHANNEL}, ${`${agentId}:${state}:${organizationId}`})`;
@@ -1432,6 +1440,9 @@ function createNotifier(listenClient) {
1432
1440
  onSessionStateChange(handler) {
1433
1441
  sessionStateChangeHandlers.push(handler);
1434
1442
  },
1443
+ onSessionEvent(handler) {
1444
+ sessionEventHandlers.push(handler);
1445
+ },
1435
1446
  onRuntimeStateChange(handler) {
1436
1447
  runtimeStateChangeHandlers.push(handler);
1437
1448
  },
@@ -1467,6 +1478,27 @@ function createNotifier(listenClient) {
1467
1478
  }
1468
1479
  }
1469
1480
  })).unlisten;
1481
+ unlistenSessionEventFn = (await listenClient.listen(SESSION_EVENT_CHANNEL, (payload) => {
1482
+ if (payload) {
1483
+ const firstSep = payload.indexOf(":");
1484
+ const secondSep = payload.indexOf(":", firstSep + 1);
1485
+ const thirdSep = payload.indexOf(":", secondSep + 1);
1486
+ if (firstSep > 0 && secondSep > firstSep && thirdSep > secondSep) {
1487
+ const agentId = payload.slice(0, firstSep);
1488
+ const chatId = payload.slice(firstSep + 1, secondSep);
1489
+ const kind = payload.slice(secondSep + 1, thirdSep);
1490
+ const organizationId = payload.slice(thirdSep + 1);
1491
+ for (const handler of sessionEventHandlers) try {
1492
+ handler({
1493
+ agentId,
1494
+ chatId,
1495
+ kind,
1496
+ organizationId
1497
+ });
1498
+ } catch {}
1499
+ }
1500
+ }
1501
+ })).unlisten;
1470
1502
  unlistenRuntimeStateFn = (await listenClient.listen(RUNTIME_STATE_CHANNEL, (payload) => {
1471
1503
  if (payload) {
1472
1504
  const firstSep = payload.indexOf(":");
@@ -1524,6 +1556,10 @@ function createNotifier(listenClient) {
1524
1556
  await unlistenSessionStateFn();
1525
1557
  unlistenSessionStateFn = null;
1526
1558
  }
1559
+ if (unlistenSessionEventFn) {
1560
+ await unlistenSessionEventFn();
1561
+ unlistenSessionEventFn = null;
1562
+ }
1527
1563
  if (unlistenRuntimeStateFn) {
1528
1564
  await unlistenRuntimeStateFn();
1529
1565
  unlistenRuntimeStateFn = null;
@@ -1748,7 +1784,7 @@ async function sendMessageInner(db, chatId, senderId, data, options) {
1748
1784
  } : incomingMeta;
1749
1785
  const dmAutoProjection = chatType === "direct" ? [...new Set([...mergedMentions, ...participants.filter((p) => p.agentId !== senderId).map((p) => p.agentId)])] : mergedMentions;
1750
1786
  if (options.enforceGroupMention && chatType === "group") {
1751
- if (mergedMentions.filter((id) => id !== senderId).length === 0) throw new BadRequestError("Sending to a group chat requires an explicit @mention. Use `agent send <name>` to message a single agent, or @<name> in the content to address one or more group members.");
1787
+ if (mergedMentions.filter((id) => id !== senderId).length === 0) throw new BadRequestError("Sending to a group chat requires an explicit @mention. Use `first-tree-hub chat send <name>` to message a single agent, or @<name> in the content to address one or more group members.");
1752
1788
  }
1753
1789
  let outboundContent = data.content;
1754
1790
  if (options.normalizeMentionsInContent && typeof outboundContent === "string") {
@@ -1933,7 +1969,7 @@ async function sendToAgent(db, senderUuid, targetName, data) {
1933
1969
  }).from(agents).where(eq(agents.uuid, senderUuid)).limit(1);
1934
1970
  if (!sender) throw new NotFoundError(`Agent "${senderUuid}" not found`);
1935
1971
  const [target] = await db.select({ uuid: agents.uuid }).from(agents).where(and(eq(agents.organizationId, sender.organizationId), eq(agents.name, targetName), ne(agents.status, "deleted"))).limit(1);
1936
- if (!target) throw new NotFoundError(`Agent "${targetName}" not found${/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(targetName) ? " — `agent send` expects an agent NAME, not a uuid. Run `first-tree-hub agent list` to see available names." : ""}`);
1972
+ if (!target) throw new NotFoundError(`Agent "${targetName}" not found${/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(targetName) ? " — `first-tree-hub chat send` expects an agent NAME, not a uuid. Run `first-tree-hub agent list` to see available names." : ""}`);
1937
1973
  const incomingMeta = data.metadata ?? {};
1938
1974
  const existingMentionsRaw = incomingMeta.mentions;
1939
1975
  const existingMentions = Array.isArray(existingMentionsRaw) ? existingMentionsRaw.filter((m) => typeof m === "string") : [];
@@ -1,7 +1,7 @@
1
1
  import "./observability-BAScT_5S-BcW9HgkG.mjs";
2
2
  import "./logger-core-BTmvdflj-DjW8FM4T.mjs";
3
- import "./dist-B1GHzMLc.mjs";
4
- import "./errors-CF5evtJt-B0NTIVPt.mjs";
3
+ import "./dist-C8yStx2L.mjs";
4
+ import "./errors-LPcARA4K-Dbrptiyz.mjs";
5
5
  import "./src-DNBS5Yjj.mjs";
6
- import { J as listMyPinnedAgents } from "./client-BViGcaUC-CZb2Svgh.mjs";
6
+ import { J as listMyPinnedAgents } from "./client-BH4CmUL0-CybE3kuP.mjs";
7
7
  export { listMyPinnedAgents };
@@ -185,6 +185,7 @@ z.object({
185
185
  const PROMPT_APPEND_MAX_LENGTH = 32e3;
186
186
  const MCP_NAME_PATTERN = /^[a-z0-9][a-z0-9_-]{0,63}$/i;
187
187
  const ENV_KEY_PATTERN = /^[A-Z][A-Z0-9_]*$/;
188
+ const WINDOWS_DRIVE_PATH_PATTERN = /^[A-Za-z]:/;
188
189
  const promptConfigSchema = z.object({ append: z.string().max(PROMPT_APPEND_MAX_LENGTH).default("") });
189
190
  const mcpStdioServerSchema = z.object({
190
191
  name: z.string().regex(MCP_NAME_PATTERN, "MCP name must match /^[a-z0-9][a-z0-9_-]{0,63}$/i"),
@@ -214,10 +215,38 @@ const envEntrySchema = z.object({
214
215
  value: z.string(),
215
216
  sensitive: z.boolean().default(false)
216
217
  });
218
+ function hasControlCharacters(value) {
219
+ for (let idx = 0; idx < value.length; idx++) {
220
+ const code = value.charCodeAt(idx);
221
+ if (code <= 31 || code === 127) return true;
222
+ }
223
+ return false;
224
+ }
225
+ function getRepoLocalPathSafetyError(localPath) {
226
+ if (localPath.length === 0) return "Git repo local path must not be empty";
227
+ if (localPath.trim() !== localPath) return "Git repo local path must not have leading or trailing whitespace";
228
+ if (hasControlCharacters(localPath)) return "Git repo local path must not contain control characters";
229
+ if (localPath.includes("\\")) return "Git repo local path must use forward slashes";
230
+ if (localPath.startsWith("/") || WINDOWS_DRIVE_PATH_PATTERN.test(localPath)) return "Git repo local path must be relative";
231
+ const segments = localPath.split("/");
232
+ for (const segment of segments) {
233
+ if (!segment) return "Git repo local path must not contain empty path segments";
234
+ if (segment === "." || segment === "..") return "Git repo local path must not contain dot segments";
235
+ if (segment.trim() !== segment) return "Git repo local path segments must not have leading or trailing whitespace";
236
+ }
237
+ return null;
238
+ }
217
239
  const gitRepoSchema = z.object({
218
240
  url: z.string().min(1),
219
241
  ref: z.string().min(1).optional(),
220
- localPath: z.string().min(1).optional()
242
+ localPath: z.string().min(1).superRefine((localPath, ctx) => {
243
+ const safetyError = getRepoLocalPathSafetyError(localPath);
244
+ if (!safetyError) return;
245
+ ctx.addIssue({
246
+ code: z.ZodIssueCode.custom,
247
+ message: safetyError
248
+ });
249
+ }).optional()
221
250
  });
222
251
  /**
223
252
  * Untagged base shape — 5 user-tunable fields, no `kind` discriminator.
@@ -1168,6 +1197,28 @@ const meChatParticipantSchema = z.object({
1168
1197
  displayName: z.string(),
1169
1198
  type: z.string()
1170
1199
  });
1200
+ /**
1201
+ * Live activity hint surfaced in the conversation row's time slot. Derived
1202
+ * server-side from the latest `session_events` row for the chat. See
1203
+ * `MeChatRow.liveActivity` for the lifecycle rules.
1204
+ *
1205
+ * `kind` is intentionally narrower than the full `sessionEventKind` enum:
1206
+ * `turn_end` / `error` produce `liveActivity: null` rather than a live
1207
+ * indicator.
1208
+ */
1209
+ const liveActivityKindSchema = z.enum([
1210
+ "tool_call",
1211
+ "thinking",
1212
+ "assistant_text"
1213
+ ]);
1214
+ const liveActivitySchema = z.object({
1215
+ agentId: z.string(),
1216
+ kind: liveActivityKindSchema,
1217
+ label: z.string(),
1218
+ startedAt: z.string()
1219
+ });
1220
+ /** Stale threshold (ms) past which a `session_events` row stops driving liveActivity. */
1221
+ const LIVE_ACTIVITY_STALE_MS = 6e4;
1171
1222
  const meChatRowSchema = z.object({
1172
1223
  chatId: z.string(),
1173
1224
  type: z.string(),
@@ -1181,7 +1232,8 @@ const meChatRowSchema = z.object({
1181
1232
  unreadMentionCount: z.number().int(),
1182
1233
  canReply: z.boolean(),
1183
1234
  engagementStatus: chatEngagementStatusSchema,
1184
- workingAgentIds: z.array(z.string())
1235
+ engagedAgentIds: z.array(z.string()),
1236
+ liveActivity: liveActivitySchema.nullable()
1185
1237
  });
1186
1238
  z.object({
1187
1239
  rows: z.array(meChatRowSchema),
@@ -1826,4 +1878,4 @@ z.object({
1826
1878
  capabilities: serverCapabilitiesSchema.optional()
1827
1879
  }).passthrough();
1828
1880
  //#endregion
1829
- export { onboardingEventSchema as $, createOrgFromMeSchema as A, githubStartQuerySchema as B, contextTreeSnapshotSchema as C, updateClientCapabilitiesSchema as Ct, createChatSchema as D, createAgentSchema as E, wsAuthFrameSchema as Et, extractMentions as F, isOrgSettingNamespace as G, inboxAckFrameSchema as H, githubAppInstallationClaimBodySchema as I, joinByInvitationSchema as J, isRedactedEnvValue as K, githubAppInstallationPermissionsSchema as L, defaultRuntimeConfigPayload as M, delegateFeishuUserSchema as N, createMeChatSchema as O, dryRunAgentRuntimeConfigSchema as P, notificationQuerySchema as Q, githubCallbackQuerySchema as R, connectTokenExchangeSchema as S, updateChatSchema as St, createAdapterMappingSchema as T, updateOrganizationSchema as Tt, inboxDeliverFrameSchema as U, imageInlineContentSchema as V, inboxPollQuerySchema as W, loginSchema as X, listMeChatsQuerySchema as Y, messageSourceSchema as Z, agentRuntimeConfigPayloadSchema as _, stripCode as _t, AGENT_TYPES as a, rebindAgentSchema as at, clientCapabilitiesSchema as b, updateAgentRuntimeConfigSchema as bt, DEFAULT_RUNTIME_PROVIDER as c, safeRedirectPath as ct, ORG_SETTINGS_NAMESPACES as d, sendMessageSchema as dt, paginationQuerySchema as et, WS_AUTH_FRAME_TIMEOUT_MS as f, sendToAgentSchema as ft, agentPinnedMessageSchema as g, sessionStateMessageSchema as gt, agentBindRequestSchema as h, sessionReconcileRequestSchema as ht, AGENT_STATUSES as i, questionMessageContentSchema as it, defaultParticipantMode as j, createMemberSchema as k, MENTION_REGEX as l, scanMentionTokens as lt, addParticipantSchema as m, sessionEventSchema as mt, AGENT_NAME_REGEX as n, patchOnboardingSchema as nt, AGENT_VISIBILITY as o, refreshTokenSchema as ot, addMeChatParticipantsSchema as p, sessionEventMessageSchema as pt, isReservedAgentName as q, AGENT_SELECTOR_HEADER as r, questionAnswerMessageContentSchema as rt, CHAT_ENGAGEMENT_STATUSES as s, runtimeStateMessageSchema as st, AGENT_BIND_REJECT_REASONS as t, patchChatEngagementSchema as tt, NOTIFICATION_TYPES as u, selfServiceFeishuBotSchema as ut, agentTypeSchema as v, submitQuestionAnswerSchema as vt, createAdapterConfigSchema as w, updateMemberSchema as wt, clientRegisterSchema as x, updateAgentSchema as xt, chatMetadataSchema as y, updateAdapterConfigSchema as yt, githubDevCallbackQuerySchema as z };
1881
+ export { notificationQuerySchema as $, createMemberSchema as A, githubDevCallbackQuerySchema as B, connectTokenExchangeSchema as C, updateChatSchema as Ct, createAgentSchema as D, wsAuthFrameSchema as Dt, createAdapterMappingSchema as E, updateOrganizationSchema as Et, dryRunAgentRuntimeConfigSchema as F, inboxPollQuerySchema as G, imageInlineContentSchema as H, extractMentions as I, isReservedAgentName as J, isOrgSettingNamespace as K, githubAppInstallationClaimBodySchema as L, defaultParticipantMode as M, defaultRuntimeConfigPayload as N, createChatSchema as O, delegateFeishuUserSchema as P, messageSourceSchema as Q, githubAppInstallationPermissionsSchema as R, clientRegisterSchema as S, updateAgentSchema as St, createAdapterConfigSchema as T, updateMemberSchema as Tt, inboxAckFrameSchema as U, githubStartQuerySchema as V, inboxDeliverFrameSchema as W, listMeChatsQuerySchema as X, joinByInvitationSchema as Y, loginSchema as Z, agentPinnedMessageSchema as _, sessionStateMessageSchema as _t, AGENT_TYPES as a, questionMessageContentSchema as at, chatMetadataSchema as b, updateAdapterConfigSchema as bt, DEFAULT_RUNTIME_PROVIDER as c, runtimeStateMessageSchema as ct, NOTIFICATION_TYPES as d, selfServiceFeishuBotSchema as dt, onboardingEventSchema as et, ORG_SETTINGS_NAMESPACES as f, sendMessageSchema as ft, agentBindRequestSchema as g, sessionReconcileRequestSchema as gt, addParticipantSchema as h, sessionEventSchema as ht, AGENT_STATUSES as i, questionAnswerMessageContentSchema as it, createOrgFromMeSchema as j, createMeChatSchema as k, LIVE_ACTIVITY_STALE_MS as l, safeRedirectPath as lt, addMeChatParticipantsSchema as m, sessionEventMessageSchema as mt, AGENT_NAME_REGEX as n, patchChatEngagementSchema as nt, AGENT_VISIBILITY as o, rebindAgentSchema as ot, WS_AUTH_FRAME_TIMEOUT_MS as p, sendToAgentSchema as pt, isRedactedEnvValue as q, AGENT_SELECTOR_HEADER as r, patchOnboardingSchema as rt, CHAT_ENGAGEMENT_STATUSES as s, refreshTokenSchema as st, AGENT_BIND_REJECT_REASONS as t, paginationQuerySchema as tt, MENTION_REGEX as u, scanMentionTokens as ut, agentRuntimeConfigPayloadSchema as v, stripCode as vt, contextTreeSnapshotSchema as w, updateClientCapabilitiesSchema as wt, clientCapabilitiesSchema as x, updateAgentRuntimeConfigSchema as xt, agentTypeSchema as y, submitQuestionAnswerSchema as yt, githubCallbackQuerySchema as z };
@@ -0,0 +1,32 @@
1
+ -- Onboarding terminal-state stamp. Distinct from `onboarding_dismissed_at`:
2
+ --
3
+ -- * `onboarding_dismissed_at` means "the user clicked ✕ on the stepper" —
4
+ -- a UI hide, not a setup-complete signal. The user can resume the
5
+ -- wizard from Settings → Onboarding to land back on whichever step is
6
+ -- still incomplete.
7
+ --
8
+ -- * `onboarding_completed_at` means "the user actually walked Step 3 to
9
+ -- success" (admin Continue, invitee Confirm/Continue). Once set, the
10
+ -- Settings → Onboarding entry point and Resume button disappear
11
+ -- permanently. Subsequent tree / source-repo edits go through Settings
12
+ -- → Team and /agents/:uuid.
13
+ --
14
+ -- The two stamps are intentionally orthogonal: `inferOnboardingStep()`
15
+ -- keeps its existing "infer from current resources" semantics and never
16
+ -- consults this column. This field is UI-gate only.
17
+ --
18
+ -- Backfill: every already-dismissed user is treated as completed. The pre-
19
+ -- column population (mid-2025) had no terminal-state concept, so the only
20
+ -- signal we have is "they hid the stepper" — and the alternative (showing
21
+ -- the Onboarding sidebar entry to every legacy user forever) is worse than
22
+ -- the off-by-one risk that a few users dismissed-without-finishing and
23
+ -- will lose their Resume affordance.
24
+
25
+ ALTER TABLE "users"
26
+ ADD COLUMN IF NOT EXISTS "onboarding_completed_at" timestamp with time zone;
27
+
28
+ --> statement-breakpoint
29
+ UPDATE "users"
30
+ SET "onboarding_completed_at" = "onboarding_dismissed_at"
31
+ WHERE "onboarding_dismissed_at" IS NOT NULL
32
+ AND "onboarding_completed_at" IS NULL;
@@ -302,6 +302,13 @@
302
302
  "when": 1779408000000,
303
303
  "tag": "0042_notifications_drop_legacy_types",
304
304
  "breakpoints": true
305
+ },
306
+ {
307
+ "idx": 43,
308
+ "version": "7",
309
+ "when": 1779494400000,
310
+ "tag": "0043_onboarding_completed_at",
311
+ "breakpoints": true
305
312
  }
306
313
  ]
307
314
  }
@@ -1,5 +1,5 @@
1
1
  import { integer, jsonb, pgTable, text, timestamp } from "drizzle-orm/pg-core";
2
- //#region ../server/dist/errors-CF5evtJt.mjs
2
+ //#region ../server/dist/errors-LPcARA4K.mjs
3
3
  /** Organization entity. Agents and chats belong to exactly one organization. */
4
4
  const organizations = pgTable("organizations", {
5
5
  id: text("id").primaryKey(),
@@ -20,6 +20,7 @@ const users = pgTable("users", {
20
20
  avatarUrl: text("avatar_url"),
21
21
  status: text("status").notNull().default("active"),
22
22
  onboardingDismissedAt: timestamp("onboarding_dismissed_at", { withTimezone: true }),
23
+ onboardingCompletedAt: timestamp("onboarding_completed_at", { withTimezone: true }),
23
24
  createdAt: timestamp("created_at", { withTimezone: true }).notNull().defaultNow(),
24
25
  updatedAt: timestamp("updated_at", { withTimezone: true }).notNull().defaultNow()
25
26
  });
@@ -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-B1GHzMLc.mjs";
3
+ import { r as AGENT_SELECTOR_HEADER } from "./dist-C8yStx2L.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-Fgnnnola.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-Bb5LR4y6.mjs";
3
3
  import "./logger-core-BTmvdflj-DjW8FM4T.mjs";
4
- import { a as ensureFreshAdminToken, c as resolveServerUrl, i as ensureFreshAccessToken, n as AuthRefreshRateLimitedError, s as resolveAccessToken, t as AuthRefreshFailedError } from "./bootstrap-CW73oEYn.mjs";
4
+ import { a as ensureFreshAdminToken, c as resolveServerUrl, i as ensureFreshAccessToken, n as AuthRefreshRateLimitedError, s as resolveAccessToken, t as AuthRefreshFailedError } from "./bootstrap-Cya2OoHz.mjs";
5
5
  import { i as blank, s as status } from "./cli-fetch--tiwKm5S.mjs";
6
- import "./dist-B1GHzMLc.mjs";
7
- import { n as bindFeishuUser, t as bindFeishuBot } from "./feishu-30vUx69l.mjs";
8
- import "./errors-CF5evtJt-B0NTIVPt.mjs";
6
+ import "./dist-C8yStx2L.mjs";
7
+ import { n as bindFeishuUser, t as bindFeishuBot } from "./feishu-D_vnqC6a.mjs";
8
+ import "./errors-LPcARA4K-Dbrptiyz.mjs";
9
9
  import "./src-DNBS5Yjj.mjs";
10
- import "./client-BViGcaUC-CZb2Svgh.mjs";
11
- import "./invitation-Bg0TRiyx-BsZH4GCS.mjs";
10
+ import "./client-BH4CmUL0-CybE3kuP.mjs";
11
+ import "./invitation-DZO4NX3P-BPxTeHf-.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 };
@@ -0,0 +1,4 @@
1
+ import "./dist-C8yStx2L.mjs";
2
+ import "./errors-LPcARA4K-Dbrptiyz.mjs";
3
+ import { s as previewInvitation } from "./invitation-DZO4NX3P-BPxTeHf-.mjs";
4
+ export { previewInvitation };
@@ -1,8 +1,8 @@
1
- import { l as organizations, s as NotFoundError, u as users } from "./errors-CF5evtJt-B0NTIVPt.mjs";
1
+ import { l as organizations, s as NotFoundError, u as users } from "./errors-LPcARA4K-Dbrptiyz.mjs";
2
2
  import { randomBytes } from "node:crypto";
3
3
  import { and, desc, eq, gt, isNull, or } from "drizzle-orm";
4
4
  import { index, pgTable, text, timestamp } from "drizzle-orm/pg-core";
5
- //#region ../server/dist/invitation-Bg0TRiyx.mjs
5
+ //#region ../server/dist/invitation-DZO4NX3P.mjs
6
6
  /** Generate a UUID v7 (time-ordered). No external dependency. */
7
7
  function uuidv7() {
8
8
  const now = BigInt(Date.now());