@agent-team-foundation/first-tree-hub 0.11.1 → 0.11.3
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/{bootstrap-TJRy0B9m.mjs → bootstrap-D4rdqM2F.mjs} +5 -2
- package/dist/cli/index.mjs +44 -41
- package/dist/cli-fetch--tiwKm5S.mjs +167 -0
- package/dist/client-By1K4VVT-C5K7WZo6.mjs +4 -0
- package/dist/{client-BCaK653p-CZjDNcdM.mjs → client-CLdRbuml-BRtalKpQ.mjs} +12 -4
- package/dist/{dist-BkvrONSQ.mjs → dist-BAqGZkco.mjs} +99 -1
- package/dist/{dist-BLY7Bu-l.mjs → dist-BQtAQNRD.mjs} +1 -1
- package/dist/{feishu-AEMHwT6L.mjs → feishu-Th_-ivJ7.mjs} +4 -3
- package/dist/{getMachineId-bsd-DjLgZlll.mjs → getMachineId-bsd-DyySs8xz.mjs} +2 -2
- package/dist/{getMachineId-bsd-DR4-Dysy.mjs → getMachineId-bsd-c2VImogj.mjs} +2 -2
- package/dist/{getMachineId-darwin-CaD2juTg.mjs → getMachineId-darwin-Cl7TSzgO.mjs} +2 -2
- package/dist/{getMachineId-darwin-B6WCAhc4.mjs → getMachineId-darwin-DKgI8b1d.mjs} +2 -2
- package/dist/{getMachineId-linux-Dk3gWdQK.mjs → getMachineId-linux-1OIMWfdh.mjs} +1 -1
- package/dist/{getMachineId-linux-BeWHG1gK.mjs → getMachineId-linux-cT7EbP10.mjs} +1 -1
- package/dist/{getMachineId-unsupported-BMJQItvF.mjs → getMachineId-unsupported-CkX-YOG1.mjs} +1 -1
- package/dist/{getMachineId-unsupported-Bgz_Je1J.mjs → getMachineId-unsupported-CmVlhzIo.mjs} +1 -1
- package/dist/{getMachineId-win-vJ6VfDRI.mjs → getMachineId-win-C2cM60YT.mjs} +2 -2
- package/dist/{getMachineId-win-CdgcrzCW.mjs → getMachineId-win-Chl03TYe.mjs} +2 -2
- package/dist/index.mjs +10 -9
- package/dist/invitation-DWlyNb8x-D3zjZSwI.mjs +4 -0
- package/dist/{invitation-Dnn5gGGX-Ce7zbZpn.mjs → invitation-Dnn5gGGX-DXryyvRG.mjs} +1 -1
- package/dist/{multipart-parser-BIksYTkk.mjs → multipart-parser-QRu3OKK4.mjs} +1 -1
- package/dist/{observability-C3nY6Jcz-Dpsi3eFk.mjs → observability-BAScT_5S-gw1ODB_o.mjs} +140 -17
- package/dist/observability-CYsdAcoF.mjs +5 -0
- package/dist/{saas-connect-Bd0g0v_b.mjs → saas-connect-gcT6Q10z.mjs} +919 -168
- package/dist/{src-uVZSbShB.mjs → src-DFlbpJfU.mjs} +3 -3
- package/dist/web/assets/index-43trJLR8.js +388 -0
- package/dist/web/assets/{index-Dbwa40_B.js → index-CD7rTdqm.js} +1 -1
- package/dist/web/assets/index-fNb_M0nL.css +1 -0
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/client-m1OM4Iag-HKWgB3Yk.mjs +0 -4
- package/dist/invitation-DWlyNb8x-DZTW9I26.mjs +0 -4
- package/dist/observability-Co8OO0og.mjs +0 -5
- package/dist/web/assets/index-7RvlJjJ9.css +0 -1
- package/dist/web/assets/index-cpdSFHAJ.js +0 -383
- /package/dist/{errors-BmyRwN0Y-CIZZ_sDc.mjs → errors-BmyRwN0Y-Dad3eV8F.mjs} +0 -0
- /package/dist/{esm-iadMkGbV.mjs → esm-Ci8E1Gtj.mjs} +0 -0
- /package/dist/{execAsync-pImxPKN5.mjs → execAsync-DUfRkc4a.mjs} +0 -0
- /package/dist/{execAsync-CCyouKZM.mjs → execAsync-YbEZSOYd.mjs} +0 -0
- /package/dist/{from-CaD373S1.mjs → from-DQ7eNRwu.mjs} +0 -0
- /package/dist/{src-DNBS5Yjj.mjs → src-aJMV60mR.mjs} +0 -0
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { r as __exportAll } from "./chunk-BSw8zbkd.mjs";
|
|
2
2
|
import { o as logFormatSchema, s as logLevelSchema } from "./logger-core-BTmvdflj-DjW8FM4T.mjs";
|
|
3
|
+
import { t as cliFetch } from "./cli-fetch--tiwKm5S.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
import { dirname, join } from "node:path";
|
|
5
6
|
import { homedir } from "node:os";
|
|
@@ -569,10 +570,11 @@ const serverConfigSchema = defineConfig({
|
|
|
569
570
|
connectTokenExpiry: field(z.string().default("10m"), { env: "FIRST_TREE_HUB_AUTH_CONNECT_TOKEN_EXPIRY" })
|
|
570
571
|
},
|
|
571
572
|
contextTree: optional({
|
|
572
|
-
repo: field(z.string(), {
|
|
573
|
+
repo: field(z.string().optional(), {
|
|
573
574
|
env: "FIRST_TREE_HUB_CONTEXT_TREE_REPO",
|
|
574
575
|
prompt: { message: "Context Tree repo URL (e.g. https://github.com/org/first-tree):" }
|
|
575
576
|
}),
|
|
577
|
+
localPath: field(z.string().optional(), { env: "FIRST_TREE_HUB_CONTEXT_TREE_PATH" }),
|
|
576
578
|
branch: field(z.string().default("main"))
|
|
577
579
|
}),
|
|
578
580
|
github: {
|
|
@@ -595,6 +597,7 @@ const serverConfigSchema = defineConfig({
|
|
|
595
597
|
max: field(z.number().default(100), { env: "FIRST_TREE_HUB_RATE_LIMIT_MAX" }),
|
|
596
598
|
loginMax: field(z.number().default(5), { env: "FIRST_TREE_HUB_RATE_LIMIT_LOGIN_MAX" }),
|
|
597
599
|
webhookMax: field(z.number().default(60), { env: "FIRST_TREE_HUB_RATE_LIMIT_WEBHOOK_MAX" }),
|
|
600
|
+
contextTreeSnapshotMax: field(z.number().default(6), { env: "FIRST_TREE_HUB_RATE_LIMIT_CONTEXT_TREE_SNAPSHOT_MAX" }),
|
|
598
601
|
agentMessageMax: field(z.number().default(30), { env: "FIRST_TREE_HUB_RATE_LIMIT_AGENT_MESSAGE_MAX" })
|
|
599
602
|
}),
|
|
600
603
|
ws: optional({ maxPayload: field(z.number().int().min(1024).default(262144), { env: "FIRST_TREE_HUB_WS_MAX_PAYLOAD" }) }),
|
|
@@ -782,7 +785,7 @@ async function ensureFreshAccessToken(opts) {
|
|
|
782
785
|
if (!isTokenStale(creds.accessToken, minValidityMs)) return creds.accessToken;
|
|
783
786
|
if (inflightRefresh) return inflightRefresh;
|
|
784
787
|
inflightRefresh = (async () => {
|
|
785
|
-
const res = await
|
|
788
|
+
const res = await cliFetch(`${creds.serverUrl}/api/v1/auth/refresh`, {
|
|
786
789
|
method: "POST",
|
|
787
790
|
headers: { "Content-Type": "application/json" },
|
|
788
791
|
body: JSON.stringify({ refreshToken: creds.refreshToken }),
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import "../observability-
|
|
3
|
-
import { $ as
|
|
2
|
+
import "../observability-BAScT_5S-gw1ODB_o.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 success, b as onboardCreate, c as detectInstallMode, ct as FirstTreeHubSDK, d as startServer, dt as cleanWorkspaces, et as removeLocalAgent, f as reconcileLocalRuntimeProviders, ft as probeCapabilities, g as promptMissingFields, h as promptAddAgent, i as createExecuteUpdate, it as fail, j as checkNodeVersion, k as checkDatabase, l as fetchLatestVersion, lt as SdkError, m as isInteractive, mt as configureClientLoggerForService, o as promptUpdate, ot as ClientOrgMismatchError, p as uploadClientCapabilities, pt as applyClientLoggerConfig, r as registerSaaSConnectCommand, rt as resolveReplyToFromEnv, s as PACKAGE_NAME, st as ClientUserMismatchError, tt as createOwner, u as installGlobalLatest, ut as SessionRegistry, v as loadOnboardState, w as migrateLocalAgentDirs, x as saveOnboardState, y as onboardCheck, z as installClientService } from "../saas-connect-gcT6Q10z.mjs";
|
|
4
4
|
import "../logger-core-BTmvdflj-DjW8FM4T.mjs";
|
|
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, u as saveCredentials, v as initConfig, w as resolveConfigReadonly, x as readConfigFile, y as loadAgents } from "../bootstrap-
|
|
6
|
-
import "../
|
|
7
|
-
import
|
|
8
|
-
import "../
|
|
9
|
-
import "../
|
|
10
|
-
import "../
|
|
11
|
-
import "../
|
|
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, u as saveCredentials, v as initConfig, w as resolveConfigReadonly, x as readConfigFile, y as loadAgents } from "../bootstrap-D4rdqM2F.mjs";
|
|
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-BAqGZkco.mjs";
|
|
8
|
+
import { n as bindFeishuUser, t as bindFeishuBot } from "../feishu-Th_-ivJ7.mjs";
|
|
9
|
+
import "../errors-BmyRwN0Y-Dad3eV8F.mjs";
|
|
10
|
+
import "../client-CLdRbuml-BRtalKpQ.mjs";
|
|
11
|
+
import "../src-aJMV60mR.mjs";
|
|
12
|
+
import "../invitation-Dnn5gGGX-DXryyvRG.mjs";
|
|
12
13
|
import { join } from "node:path";
|
|
13
14
|
import { existsSync, mkdirSync, readFileSync, readdirSync } from "node:fs";
|
|
14
15
|
import * as semver from "semver";
|
|
@@ -16,7 +17,7 @@ import { Command } from "commander";
|
|
|
16
17
|
import { confirm, input, password, select } from "@inquirer/prompts";
|
|
17
18
|
//#region src/commands/agent-config.ts
|
|
18
19
|
async function resolveAgentRecord(serverUrl, adminToken, agentName) {
|
|
19
|
-
const res = await
|
|
20
|
+
const res = await cliFetch(`${serverUrl}/api/v1/me/managed-agents`, {
|
|
20
21
|
headers: { Authorization: `Bearer ${adminToken}` },
|
|
21
22
|
signal: AbortSignal.timeout(1e4)
|
|
22
23
|
});
|
|
@@ -27,7 +28,7 @@ async function resolveAgentRecord(serverUrl, adminToken, agentName) {
|
|
|
27
28
|
}
|
|
28
29
|
async function adminFetch(url, init) {
|
|
29
30
|
const { adminToken, headers, ...rest } = init;
|
|
30
|
-
const res = await
|
|
31
|
+
const res = await cliFetch(url, {
|
|
31
32
|
...rest,
|
|
32
33
|
headers: {
|
|
33
34
|
Authorization: `Bearer ${adminToken}`,
|
|
@@ -240,7 +241,8 @@ function createSdk(agentName) {
|
|
|
240
241
|
return new FirstTreeHubSDK({
|
|
241
242
|
serverUrl,
|
|
242
243
|
getAccessToken: (opts) => ensureFreshAccessToken(opts),
|
|
243
|
-
agentId
|
|
244
|
+
agentId,
|
|
245
|
+
userAgent: CLI_USER_AGENT
|
|
244
246
|
});
|
|
245
247
|
}
|
|
246
248
|
function handleSdkError(error) {
|
|
@@ -276,7 +278,7 @@ function readStdin() {
|
|
|
276
278
|
});
|
|
277
279
|
}
|
|
278
280
|
async function resolveAgent(serverUrl, adminToken, agentName) {
|
|
279
|
-
const res = await
|
|
281
|
+
const res = await cliFetch(`${serverUrl}/api/v1/me/managed-agents`, {
|
|
280
282
|
headers: { Authorization: `Bearer ${adminToken}` },
|
|
281
283
|
signal: AbortSignal.timeout(1e4)
|
|
282
284
|
});
|
|
@@ -339,7 +341,8 @@ function registerAgentCommands(program) {
|
|
|
339
341
|
const clientId = readClientId();
|
|
340
342
|
const sdk = new FirstTreeHubSDK({
|
|
341
343
|
serverUrl,
|
|
342
|
-
getAccessToken: (opts) => ensureFreshAccessToken(opts)
|
|
344
|
+
getAccessToken: (opts) => ensureFreshAccessToken(opts),
|
|
345
|
+
userAgent: CLI_USER_AGENT
|
|
343
346
|
});
|
|
344
347
|
const stale = await findStaleAliases({
|
|
345
348
|
clientId,
|
|
@@ -406,7 +409,7 @@ function registerAgentCommands(program) {
|
|
|
406
409
|
try {
|
|
407
410
|
const serverUrl = resolveServerUrl(options.server);
|
|
408
411
|
const token = await ensureFreshAccessToken();
|
|
409
|
-
const res = await
|
|
412
|
+
const res = await cliFetch(`${serverUrl}/api/v1/me/managed-agents`, {
|
|
410
413
|
headers: { Authorization: `Bearer ${token}` },
|
|
411
414
|
signal: AbortSignal.timeout(1e4)
|
|
412
415
|
});
|
|
@@ -433,7 +436,7 @@ function registerAgentCommands(program) {
|
|
|
433
436
|
Authorization: `Bearer ${adminToken}`,
|
|
434
437
|
"Content-Type": "application/json"
|
|
435
438
|
};
|
|
436
|
-
const meRes = await
|
|
439
|
+
const meRes = await cliFetch(`${serverUrl}/api/v1/me`, {
|
|
437
440
|
headers: { Authorization: `Bearer ${adminToken}` },
|
|
438
441
|
signal: AbortSignal.timeout(1e4)
|
|
439
442
|
});
|
|
@@ -456,7 +459,7 @@ function registerAgentCommands(program) {
|
|
|
456
459
|
runtimeProvider: options.runtime
|
|
457
460
|
};
|
|
458
461
|
if (options.displayName) createBody.displayName = options.displayName;
|
|
459
|
-
const createRes = await
|
|
462
|
+
const createRes = await cliFetch(`${serverUrl}/api/v1/orgs/${encodeURIComponent(orgId)}/agents`, {
|
|
460
463
|
method: "POST",
|
|
461
464
|
headers,
|
|
462
465
|
body: JSON.stringify(createBody),
|
|
@@ -476,14 +479,14 @@ function registerAgentCommands(program) {
|
|
|
476
479
|
try {
|
|
477
480
|
const serverUrl = resolveServerUrl(options.server);
|
|
478
481
|
const accessToken = await ensureFreshAccessToken();
|
|
479
|
-
const meRes = await
|
|
482
|
+
const meRes = await cliFetch(`${serverUrl}/api/v1/me`, {
|
|
480
483
|
headers: { Authorization: `Bearer ${accessToken}` },
|
|
481
484
|
signal: AbortSignal.timeout(1e4)
|
|
482
485
|
});
|
|
483
486
|
if (!meRes.ok) fail("ME_ERROR", `Failed to fetch current member (HTTP ${meRes.status})`, 1);
|
|
484
487
|
const me = await meRes.json();
|
|
485
488
|
const target = await resolveAgent(serverUrl, accessToken, agentName);
|
|
486
|
-
const patchRes = await
|
|
489
|
+
const patchRes = await cliFetch(`${serverUrl}/api/v1/agents/${target.uuid}`, {
|
|
487
490
|
method: "PATCH",
|
|
488
491
|
headers: {
|
|
489
492
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -526,7 +529,7 @@ function registerAgentCommands(program) {
|
|
|
526
529
|
const serverUrl = resolveServerUrl(options.server);
|
|
527
530
|
const accessToken = await ensureFreshAccessToken();
|
|
528
531
|
const target = await resolveAgent(serverUrl, accessToken, agentName);
|
|
529
|
-
const patchRes = await
|
|
532
|
+
const patchRes = await cliFetch(`${serverUrl}/api/v1/agents/${target.uuid}`, {
|
|
530
533
|
method: "PATCH",
|
|
531
534
|
headers: {
|
|
532
535
|
Authorization: `Bearer ${accessToken}`,
|
|
@@ -636,7 +639,7 @@ function registerAgentCommands(program) {
|
|
|
636
639
|
try {
|
|
637
640
|
const serverUrl = resolveServerUrl(options?.server);
|
|
638
641
|
const accessToken = await ensureFreshAccessToken();
|
|
639
|
-
const meRes = await
|
|
642
|
+
const meRes = await cliFetch(`${serverUrl}/api/v1/me`, {
|
|
640
643
|
headers: { Authorization: `Bearer ${accessToken}` },
|
|
641
644
|
signal: AbortSignal.timeout(1e4)
|
|
642
645
|
});
|
|
@@ -655,7 +658,7 @@ function registerAgentCommands(program) {
|
|
|
655
658
|
agents: []
|
|
656
659
|
};
|
|
657
660
|
for (const m of me.memberships) {
|
|
658
|
-
const r = await
|
|
661
|
+
const r = await cliFetch(`${serverUrl}/api/v1/orgs/${encodeURIComponent(m.organizationId)}/activity`, {
|
|
659
662
|
headers: { Authorization: `Bearer ${accessToken}` },
|
|
660
663
|
signal: AbortSignal.timeout(1e4)
|
|
661
664
|
});
|
|
@@ -704,8 +707,7 @@ function registerAgentCommands(program) {
|
|
|
704
707
|
});
|
|
705
708
|
agent.command("reset <name>").description("Reset agent error state to idle").option("--server <url>", "Hub server URL").action(async (name, options) => {
|
|
706
709
|
try {
|
|
707
|
-
const
|
|
708
|
-
const response = await fetch(`${serverUrl}/api/v1/agents/${name}/reset-activity`, {
|
|
710
|
+
const response = await cliFetch(`${resolveServerUrl(options.server)}/api/v1/agents/${name}/reset-activity`, {
|
|
709
711
|
method: "POST",
|
|
710
712
|
headers: { Authorization: `Bearer ${await ensureFreshAccessToken()}` },
|
|
711
713
|
signal: AbortSignal.timeout(1e4)
|
|
@@ -721,8 +723,7 @@ function registerAgentCommands(program) {
|
|
|
721
723
|
const serverUrl = resolveServerUrl(options.server);
|
|
722
724
|
const adminToken = await ensureFreshAccessToken();
|
|
723
725
|
const agentId = (await resolveAgent(serverUrl, adminToken, agentName)).uuid;
|
|
724
|
-
const
|
|
725
|
-
const response = await fetch(`${serverUrl}/api/v1/agents/${agentId}/sessions${qs}`, {
|
|
726
|
+
const response = await cliFetch(`${serverUrl}/api/v1/agents/${agentId}/sessions${options.state ? `?state=${options.state}` : ""}`, {
|
|
726
727
|
headers: { Authorization: `Bearer ${adminToken}` },
|
|
727
728
|
signal: AbortSignal.timeout(1e4)
|
|
728
729
|
});
|
|
@@ -751,7 +752,7 @@ function registerAgentCommands(program) {
|
|
|
751
752
|
const serverUrl = resolveServerUrl(options.server);
|
|
752
753
|
const adminToken = await ensureFreshAccessToken();
|
|
753
754
|
const agentId = (await resolveAgent(serverUrl, adminToken, agentName)).uuid;
|
|
754
|
-
const response = await
|
|
755
|
+
const response = await cliFetch(`${serverUrl}/api/v1/agents/${agentId}/sessions/${chatId}/${cmd}`, {
|
|
755
756
|
method: "POST",
|
|
756
757
|
headers: { Authorization: `Bearer ${adminToken}` },
|
|
757
758
|
signal: AbortSignal.timeout(1e4)
|
|
@@ -774,7 +775,7 @@ function registerAgentCommands(program) {
|
|
|
774
775
|
"Content-Type": "application/json"
|
|
775
776
|
};
|
|
776
777
|
const targetAgent = await resolveAgent(serverUrl, adminToken, agentName);
|
|
777
|
-
const dmRes = await
|
|
778
|
+
const dmRes = await cliFetch(`${serverUrl}/api/v1/agents/${targetAgent.uuid}/chats`, {
|
|
778
779
|
method: "POST",
|
|
779
780
|
headers,
|
|
780
781
|
signal: AbortSignal.timeout(1e4)
|
|
@@ -796,7 +797,7 @@ function registerAgentCommands(program) {
|
|
|
796
797
|
const pollMessages = async () => {
|
|
797
798
|
try {
|
|
798
799
|
const qs = lastSeenAt ? `?limit=50` : `?limit=10`;
|
|
799
|
-
const msgRes = await
|
|
800
|
+
const msgRes = await cliFetch(`${serverUrl}/api/v1/chats/${dm.id}/messages${qs}`, {
|
|
800
801
|
headers,
|
|
801
802
|
signal: AbortSignal.timeout(1e4)
|
|
802
803
|
});
|
|
@@ -827,7 +828,7 @@ function registerAgentCommands(program) {
|
|
|
827
828
|
return;
|
|
828
829
|
}
|
|
829
830
|
try {
|
|
830
|
-
const sendRes = await
|
|
831
|
+
const sendRes = await cliFetch(`${serverUrl}/api/v1/chats/${dm.id}/messages`, {
|
|
831
832
|
method: "POST",
|
|
832
833
|
headers,
|
|
833
834
|
body: JSON.stringify({
|
|
@@ -963,7 +964,7 @@ function printIsolationGuide(newServerUrl) {
|
|
|
963
964
|
* Authenticate via connect token — exchange for full JWT credentials.
|
|
964
965
|
*/
|
|
965
966
|
async function authenticateWithToken(url, token) {
|
|
966
|
-
const res = await
|
|
967
|
+
const res = await cliFetch(`${url}/api/v1/auth/connect-token`, {
|
|
967
968
|
method: "POST",
|
|
968
969
|
headers: { "Content-Type": "application/json" },
|
|
969
970
|
body: JSON.stringify({ token }),
|
|
@@ -979,7 +980,7 @@ async function authenticateInteractive(url) {
|
|
|
979
980
|
print.line("\n Log in to Hub:\n");
|
|
980
981
|
const username = await input({ message: " Username:" });
|
|
981
982
|
const pw = await password({ message: " Password:" });
|
|
982
|
-
const loginRes = await
|
|
983
|
+
const loginRes = await cliFetch(`${url}/api/v1/auth/login`, {
|
|
983
984
|
method: "POST",
|
|
984
985
|
headers: { "Content-Type": "application/json" },
|
|
985
986
|
body: JSON.stringify({
|
|
@@ -1270,7 +1271,8 @@ function registerClientCommands(program) {
|
|
|
1270
1271
|
});
|
|
1271
1272
|
const sdk = new FirstTreeHubSDK({
|
|
1272
1273
|
serverUrl,
|
|
1273
|
-
getAccessToken: (opts) => ensureFreshAccessToken(opts)
|
|
1274
|
+
getAccessToken: (opts) => ensureFreshAccessToken(opts),
|
|
1275
|
+
userAgent: CLI_USER_AGENT
|
|
1274
1276
|
});
|
|
1275
1277
|
agentCheck = await reconcileAgentConfigs({
|
|
1276
1278
|
clientId: cfg.client.id,
|
|
@@ -1396,7 +1398,7 @@ function registerClientCommands(program) {
|
|
|
1396
1398
|
try {
|
|
1397
1399
|
const serverUrl = resolveServerUrl(options.server);
|
|
1398
1400
|
const token = await ensureFreshAccessToken();
|
|
1399
|
-
const meRes = await
|
|
1401
|
+
const meRes = await cliFetch(`${serverUrl}/api/v1/me`, {
|
|
1400
1402
|
headers: { Authorization: `Bearer ${token}` },
|
|
1401
1403
|
signal: AbortSignal.timeout(1e4)
|
|
1402
1404
|
});
|
|
@@ -1404,7 +1406,7 @@ function registerClientCommands(program) {
|
|
|
1404
1406
|
const adminOrgs = (await meRes.json()).memberships.filter((m) => m.role === "admin");
|
|
1405
1407
|
const clients = [];
|
|
1406
1408
|
for (const m of adminOrgs) {
|
|
1407
|
-
const r = await
|
|
1409
|
+
const r = await cliFetch(`${serverUrl}/api/v1/orgs/${encodeURIComponent(m.organizationId)}/clients`, {
|
|
1408
1410
|
headers: { Authorization: `Bearer ${token}` },
|
|
1409
1411
|
signal: AbortSignal.timeout(1e4)
|
|
1410
1412
|
});
|
|
@@ -1453,7 +1455,7 @@ function registerClientCommands(program) {
|
|
|
1453
1455
|
}
|
|
1454
1456
|
}
|
|
1455
1457
|
const token = await ensureFreshAccessToken();
|
|
1456
|
-
const response = await
|
|
1458
|
+
const response = await cliFetch(`${serverUrl}/api/v1/clients/${encodeURIComponent(clientId)}/claim`, {
|
|
1457
1459
|
method: "POST",
|
|
1458
1460
|
headers: {
|
|
1459
1461
|
Authorization: `Bearer ${token}`,
|
|
@@ -1471,7 +1473,8 @@ function registerClientCommands(program) {
|
|
|
1471
1473
|
try {
|
|
1472
1474
|
const sdk = new FirstTreeHubSDK({
|
|
1473
1475
|
serverUrl,
|
|
1474
|
-
getAccessToken: (opts) => ensureFreshAccessToken(opts)
|
|
1476
|
+
getAccessToken: (opts) => ensureFreshAccessToken(opts),
|
|
1477
|
+
userAgent: CLI_USER_AGENT
|
|
1475
1478
|
});
|
|
1476
1479
|
const stale = await findStaleAliases({
|
|
1477
1480
|
clientId,
|
|
@@ -1520,7 +1523,7 @@ function registerClientCommands(program) {
|
|
|
1520
1523
|
try {
|
|
1521
1524
|
const serverUrl = resolveServerUrl(options.server);
|
|
1522
1525
|
const token = await ensureFreshAccessToken();
|
|
1523
|
-
const response = await
|
|
1526
|
+
const response = await cliFetch(`${serverUrl}/api/v1/clients/${encodeURIComponent(clientId)}/disconnect`, {
|
|
1524
1527
|
method: "POST",
|
|
1525
1528
|
headers: { Authorization: `Bearer ${token}` },
|
|
1526
1529
|
signal: AbortSignal.timeout(1e4)
|
|
@@ -1667,13 +1670,13 @@ function isSecretField(schema, dotPath) {
|
|
|
1667
1670
|
//#region src/commands/onboard.ts
|
|
1668
1671
|
async function promptMissing(args) {
|
|
1669
1672
|
if (!args.server) try {
|
|
1670
|
-
const { resolveServerUrl } = await import("../bootstrap-
|
|
1673
|
+
const { resolveServerUrl } = await import("../bootstrap-D4rdqM2F.mjs").then((n) => n.r);
|
|
1671
1674
|
resolveServerUrl();
|
|
1672
1675
|
} catch {
|
|
1673
1676
|
args.server = await input({ message: "Hub server URL:" });
|
|
1674
1677
|
saveOnboardState(args);
|
|
1675
1678
|
}
|
|
1676
|
-
const { loadCredentials } = await import("../bootstrap-
|
|
1679
|
+
const { loadCredentials } = await import("../bootstrap-D4rdqM2F.mjs").then((n) => n.r);
|
|
1677
1680
|
if (!loadCredentials()) throw new Error("No saved credentials. Run `first-tree-hub client connect <server-url>` before onboarding.");
|
|
1678
1681
|
if (!args.id) {
|
|
1679
1682
|
args.id = await input({ message: "Agent ID:" });
|
|
@@ -1833,7 +1836,7 @@ function registerServerCommands(program) {
|
|
|
1833
1836
|
server.command("status").description("Show server health and status").action(async () => {
|
|
1834
1837
|
const url = process.env.FIRST_TREE_HUB_SERVER_URL ?? "http://localhost:8000";
|
|
1835
1838
|
try {
|
|
1836
|
-
const res = await
|
|
1839
|
+
const res = await cliFetch(`${url}/api/v1/health`);
|
|
1837
1840
|
if (res.ok) {
|
|
1838
1841
|
const data = await res.json();
|
|
1839
1842
|
process.stdout.write(`${JSON.stringify(data, null, 2)}\n`);
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { dirname, resolve } from "node:path";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
//#region src/core/output.ts
|
|
5
|
+
/**
|
|
6
|
+
* Print layer — the only place CLI code should write to stdout/stderr.
|
|
7
|
+
*
|
|
8
|
+
* Contract:
|
|
9
|
+
* - `print.result(data)` / `print.fail(...)` emit machine-readable JSON on
|
|
10
|
+
* stdout / stderr respectively. Scripts pipe into `jq` and expect a clean
|
|
11
|
+
* envelope, so nothing else may touch stdout.
|
|
12
|
+
* - `print.status` / `print.check` / `print.blank` / `print.line` are
|
|
13
|
+
* human-friendly and go to stderr so they never pollute a redirected stdout.
|
|
14
|
+
* In `--json` mode they are silenced — scripted consumers only care about
|
|
15
|
+
* the envelope.
|
|
16
|
+
*/
|
|
17
|
+
let jsonMode = false;
|
|
18
|
+
function setJsonMode(enabled) {
|
|
19
|
+
jsonMode = enabled;
|
|
20
|
+
}
|
|
21
|
+
function result(data) {
|
|
22
|
+
process.stdout.write(`${JSON.stringify({
|
|
23
|
+
ok: true,
|
|
24
|
+
data
|
|
25
|
+
})}\n`);
|
|
26
|
+
}
|
|
27
|
+
function fail(code, message, exitCode = 1) {
|
|
28
|
+
process.stderr.write(`${JSON.stringify({
|
|
29
|
+
ok: false,
|
|
30
|
+
error: {
|
|
31
|
+
code,
|
|
32
|
+
message
|
|
33
|
+
}
|
|
34
|
+
})}\n`);
|
|
35
|
+
process.exit(exitCode);
|
|
36
|
+
}
|
|
37
|
+
function status(label, message) {
|
|
38
|
+
if (jsonMode) return;
|
|
39
|
+
process.stderr.write(` ${label.padEnd(20)} ${message}\n`);
|
|
40
|
+
}
|
|
41
|
+
function check(pass, label, detail = "") {
|
|
42
|
+
if (jsonMode) return;
|
|
43
|
+
const icon = pass ? "✓" : "✗";
|
|
44
|
+
const tail = detail ? ` ${detail}` : "";
|
|
45
|
+
process.stderr.write(` ${icon} ${label.padEnd(22)}${tail}\n`);
|
|
46
|
+
}
|
|
47
|
+
function blank() {
|
|
48
|
+
if (jsonMode) return;
|
|
49
|
+
process.stderr.write("\n");
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Generic stderr writer for pre-formatted human text (multi-line tables,
|
|
53
|
+
* interactive prompts). Prefer `status` / `check` when the text fits; this
|
|
54
|
+
* exists so the `--json` mode gate can silence arbitrary human chatter.
|
|
55
|
+
*/
|
|
56
|
+
function line(text) {
|
|
57
|
+
if (jsonMode) return;
|
|
58
|
+
process.stderr.write(text);
|
|
59
|
+
}
|
|
60
|
+
const print = {
|
|
61
|
+
result,
|
|
62
|
+
fail,
|
|
63
|
+
status,
|
|
64
|
+
check,
|
|
65
|
+
blank,
|
|
66
|
+
line
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
//#region src/core/version.ts
|
|
70
|
+
/**
|
|
71
|
+
* Version of the consumer-facing `@agent-team-foundation/first-tree-hub`
|
|
72
|
+
* package. Read once at module load so the CLI, client runtime, and server
|
|
73
|
+
* bootstrap all quote the same string.
|
|
74
|
+
*
|
|
75
|
+
* Path-based lookups (`require("../../package.json")`) do not survive the
|
|
76
|
+
* tsdown bundle: the source lives at `src/core/version.ts` but every
|
|
77
|
+
* emitted chunk lands in `dist/` — shifting the relative depth by one and
|
|
78
|
+
* pointing at `packages/package.json` instead of our own manifest (the
|
|
79
|
+
* v0.9.1 "Cannot find module ../../package.json" crash). Walk up from this
|
|
80
|
+
* module's URL and accept the first `package.json` whose `name` matches, so
|
|
81
|
+
* dev runs (`tsx src/cli/index.ts`) and the published bundle
|
|
82
|
+
* (`dist/cli/index.mjs`) both resolve the same file.
|
|
83
|
+
*/
|
|
84
|
+
const PACKAGE_NAME = "@agent-team-foundation/first-tree-hub";
|
|
85
|
+
/**
|
|
86
|
+
* Sentinel returned when the walker exhausts every parent directory without
|
|
87
|
+
* finding our manifest. Deliberately NOT valid SemVer so the client-side
|
|
88
|
+
* `UpdateManager` drops into its `semver.valid(current) === false` warn-and-
|
|
89
|
+
* skip branch instead of treating it as `< target` and triggering a spurious
|
|
90
|
+
* self-update loop (the scenario where the startup crash this module fixes
|
|
91
|
+
* would otherwise quietly reincarnate as repeated `npm install -g @latest`).
|
|
92
|
+
*/
|
|
93
|
+
const UNRESOLVED_VERSION = "unknown";
|
|
94
|
+
/**
|
|
95
|
+
* Exported for tests. Walks up from `moduleUrl`'s directory looking for a
|
|
96
|
+
* `package.json` whose `name` field equals {@link PACKAGE_NAME}. Returns
|
|
97
|
+
* {@link UNRESOLVED_VERSION} as a last-resort fallback so the CLI never
|
|
98
|
+
* crashes on a missing manifest.
|
|
99
|
+
*/
|
|
100
|
+
function resolveCommandVersion(moduleUrl = import.meta.url) {
|
|
101
|
+
let dir = dirname(fileURLToPath(moduleUrl));
|
|
102
|
+
for (let i = 0; i < 10; i++) {
|
|
103
|
+
try {
|
|
104
|
+
const pkg = JSON.parse(readFileSync(resolve(dir, "package.json"), "utf8"));
|
|
105
|
+
if (pkg.name === PACKAGE_NAME && typeof pkg.version === "string" && pkg.version.length > 0) return pkg.version;
|
|
106
|
+
} catch (err) {
|
|
107
|
+
const code = err.code;
|
|
108
|
+
if (code !== "ENOENT" && code !== "ENOTDIR") {
|
|
109
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
110
|
+
print.line(`[first-tree-hub] warning: could not read ${dir}/package.json: ${message}\n`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
const parent = dirname(dir);
|
|
114
|
+
if (parent === dir) break;
|
|
115
|
+
dir = parent;
|
|
116
|
+
}
|
|
117
|
+
return UNRESOLVED_VERSION;
|
|
118
|
+
}
|
|
119
|
+
const COMMAND_VERSION = resolveCommandVersion();
|
|
120
|
+
/**
|
|
121
|
+
* `User-Agent` string sent on every CLI-originated HTTP request (SDK fetches,
|
|
122
|
+
* `/auth/refresh`, etc.). Without this Node defaults to `User-Agent: node`,
|
|
123
|
+
* which hides install / version / platform context from server-side trace
|
|
124
|
+
* backends — see issue #246. The format follows RFC 7231 §5.5.3 conventions
|
|
125
|
+
* (`product/version (comment)`).
|
|
126
|
+
*/
|
|
127
|
+
const CLI_USER_AGENT = `first-tree-hub-cli/${COMMAND_VERSION} (${process.platform} ${process.arch})`;
|
|
128
|
+
//#endregion
|
|
129
|
+
//#region src/core/cli-fetch.ts
|
|
130
|
+
/**
|
|
131
|
+
* Drop-in `fetch` wrapper that stamps `User-Agent: first-tree-hub-cli/<version> (<platform> <arch>)`
|
|
132
|
+
* on every request.
|
|
133
|
+
*
|
|
134
|
+
* Issue #246: every CLI-originated HTTP request must carry a stable
|
|
135
|
+
* `User-Agent` so trace backends can group failures (401 / 429 / 5xx) by
|
|
136
|
+
* install. Plain `globalThis.fetch` defaults to `User-Agent: node`, which
|
|
137
|
+
* collapses every install into a single bucket. Centralising the header
|
|
138
|
+
* here means new direct-fetch sites pick the right UA up automatically —
|
|
139
|
+
* no need to remember at each call site.
|
|
140
|
+
*
|
|
141
|
+
* SDK-routed requests stamp UA via {@link FirstTreeHubSDK} (see
|
|
142
|
+
* `packages/client/src/sdk.ts`). This helper is for the
|
|
143
|
+
* direct-`fetch` paths the SDK doesn't cover (auth bootstrap,
|
|
144
|
+
* doctor probes, raw admin calls).
|
|
145
|
+
*
|
|
146
|
+
* Header precedence: caller-provided `User-Agent` in `init.headers` wins,
|
|
147
|
+
* so callers can override (e.g. tests injecting a deterministic UA).
|
|
148
|
+
*/
|
|
149
|
+
function cliFetch(input, init) {
|
|
150
|
+
const merged = mergeHeaders(init?.headers);
|
|
151
|
+
return fetch(input, {
|
|
152
|
+
...init,
|
|
153
|
+
headers: merged
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
function mergeHeaders(provided) {
|
|
157
|
+
const out = {};
|
|
158
|
+
if (provided) if (provided instanceof Headers) provided.forEach((v, k) => {
|
|
159
|
+
out[k] = v;
|
|
160
|
+
});
|
|
161
|
+
else if (Array.isArray(provided)) for (const [k, v] of provided) out[k] = v;
|
|
162
|
+
else Object.assign(out, provided);
|
|
163
|
+
if (!Object.keys(out).some((k) => k.toLowerCase() === "user-agent")) out["User-Agent"] = CLI_USER_AGENT;
|
|
164
|
+
return out;
|
|
165
|
+
}
|
|
166
|
+
//#endregion
|
|
167
|
+
export { print as a, blank as i, CLI_USER_AGENT as n, setJsonMode as o, COMMAND_VERSION as r, status as s, cliFetch as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { C as clientCapabilitiesSchema } from "./dist-
|
|
2
|
-
import { a as ConflictError, i as ClientUserMismatchError, l as organizations, n as BadRequestError, s as NotFoundError, u as users } from "./errors-BmyRwN0Y-
|
|
1
|
+
import { C as clientCapabilitiesSchema } from "./dist-BAqGZkco.mjs";
|
|
2
|
+
import { a as ConflictError, i as ClientUserMismatchError, l as organizations, n as BadRequestError, s as NotFoundError, u as users } from "./errors-BmyRwN0Y-Dad3eV8F.mjs";
|
|
3
3
|
import { and, eq, inArray, ne, sql } from "drizzle-orm";
|
|
4
4
|
import { index, integer, jsonb, pgTable, text, timestamp, unique } from "drizzle-orm/pg-core";
|
|
5
|
-
//#region ../server/dist/client-
|
|
5
|
+
//#region ../server/dist/client-CLdRbuml.mjs
|
|
6
6
|
/**
|
|
7
7
|
* Client connections. A client is a single SDK process (AgentRuntime) that may
|
|
8
8
|
* host multiple agents. From the unified-user-token milestone on, a client is
|
|
@@ -400,6 +400,14 @@ async function updateClientCapabilities(db, clientId, capabilities) {
|
|
|
400
400
|
await db.update(clients).set({ metadata: merged }).where(eq(clients.id, clientId));
|
|
401
401
|
}
|
|
402
402
|
/**
|
|
403
|
+
* Scope-aware client listing. Returns the caller's own clients (cross-org —
|
|
404
|
+
* a client is owned by a user, not an org). The admin route adds a separate
|
|
405
|
+
* `?organizationId=` cross-user view via {@link listClientsForOrgAdmin}.
|
|
406
|
+
*/
|
|
407
|
+
async function listClients(db, scope) {
|
|
408
|
+
return attachAgentCounts(db, await db.select().from(clients).where(eq(clients.userId, scope.userId)));
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
403
411
|
* Admin-only cross-user listing: every client owned by an active member of
|
|
404
412
|
* `orgId`. Joining `clients → members.user_id` instead of `clients.organization_id`
|
|
405
413
|
* keeps the read path consistent with the rule that connection has no
|
|
@@ -513,4 +521,4 @@ async function cleanupStaleClients(db, staleSeconds = 60) {
|
|
|
513
521
|
return result.length;
|
|
514
522
|
}
|
|
515
523
|
//#endregion
|
|
516
|
-
export {
|
|
524
|
+
export { retireClient as C, touchAgent as D, setRuntimeState as E, unbindAgent as O, registerClient as S, setOffline as T, listClients as _, claimClient as a, markStaleAgents as b, clients as c, getClient as d, getOnlineCount as f, listActiveAgentsPinnedToClient as g, heartbeatInstance as h, bindAgent as i, updateClientCapabilities as k, deriveAuthState as l, heartbeatClient as m, agents as n, cleanupStaleClients as o, getPresence as p, assertClientOwner as r, cleanupStalePresence as s, agentPresence as t, disconnectClient as u, listClientsForOrgAdmin as v, serverInstances as w, members as x, listMyPinnedAgents as y };
|
|
@@ -679,6 +679,104 @@ const paginationQuerySchema = z.object({
|
|
|
679
679
|
limit: z.coerce.number().int().min(1).max(100).default(20),
|
|
680
680
|
cursor: z.string().optional()
|
|
681
681
|
});
|
|
682
|
+
const contextTreeSnapshotStatusSchema = z.enum([
|
|
683
|
+
"active",
|
|
684
|
+
"stale",
|
|
685
|
+
"unavailable"
|
|
686
|
+
]);
|
|
687
|
+
const contextTreeStatusSeveritySchema = z.enum([
|
|
688
|
+
"ok",
|
|
689
|
+
"warning",
|
|
690
|
+
"error"
|
|
691
|
+
]);
|
|
692
|
+
const contextTreeStatusSchema = z.object({
|
|
693
|
+
label: z.string(),
|
|
694
|
+
detail: z.string().nullable(),
|
|
695
|
+
severity: contextTreeStatusSeveritySchema
|
|
696
|
+
});
|
|
697
|
+
const contextTreeNodeKindSchema = z.enum([
|
|
698
|
+
"root",
|
|
699
|
+
"domain",
|
|
700
|
+
"subdomain",
|
|
701
|
+
"leaf"
|
|
702
|
+
]);
|
|
703
|
+
const contextTreeChangeTypeSchema = z.enum([
|
|
704
|
+
"added",
|
|
705
|
+
"edited",
|
|
706
|
+
"removed"
|
|
707
|
+
]);
|
|
708
|
+
const contextTreeEdgeKindSchema = z.enum([
|
|
709
|
+
"parent",
|
|
710
|
+
"soft_link",
|
|
711
|
+
"markdown_link"
|
|
712
|
+
]);
|
|
713
|
+
const contextTreeRiskLevelSchema = z.enum([
|
|
714
|
+
"low",
|
|
715
|
+
"medium",
|
|
716
|
+
"high"
|
|
717
|
+
]);
|
|
718
|
+
const contextTreeNodeSchema = z.object({
|
|
719
|
+
id: z.string(),
|
|
720
|
+
path: z.string(),
|
|
721
|
+
sourcePath: z.string().nullable(),
|
|
722
|
+
title: z.string(),
|
|
723
|
+
kind: contextTreeNodeKindSchema,
|
|
724
|
+
owners: z.array(z.string()),
|
|
725
|
+
parentId: z.string().nullable(),
|
|
726
|
+
preview: z.string().nullable(),
|
|
727
|
+
relatedNodeIds: z.array(z.string()),
|
|
728
|
+
affectedContextArea: z.string(),
|
|
729
|
+
changeType: contextTreeChangeTypeSchema.nullable(),
|
|
730
|
+
changedAtCommit: z.string().nullable()
|
|
731
|
+
});
|
|
732
|
+
const contextTreeEdgeSchema = z.object({
|
|
733
|
+
source: z.string(),
|
|
734
|
+
target: z.string(),
|
|
735
|
+
kind: contextTreeEdgeKindSchema
|
|
736
|
+
});
|
|
737
|
+
const contextTreeChangeSchema = z.object({
|
|
738
|
+
path: z.string(),
|
|
739
|
+
nodeId: z.string().nullable(),
|
|
740
|
+
type: contextTreeChangeTypeSchema,
|
|
741
|
+
commit: z.string().nullable(),
|
|
742
|
+
changedAt: z.string().nullable(),
|
|
743
|
+
changedBy: z.string().nullable(),
|
|
744
|
+
summary: z.string().nullable()
|
|
745
|
+
});
|
|
746
|
+
const contextTreeUpdateSchema = z.object({
|
|
747
|
+
id: z.string(),
|
|
748
|
+
nodeId: z.string().nullable(),
|
|
749
|
+
path: z.string(),
|
|
750
|
+
title: z.string(),
|
|
751
|
+
changeType: contextTreeChangeTypeSchema,
|
|
752
|
+
affectedContextArea: z.string(),
|
|
753
|
+
reason: z.string(),
|
|
754
|
+
summary: z.string(),
|
|
755
|
+
changedBy: z.string().nullable(),
|
|
756
|
+
owners: z.array(z.string()),
|
|
757
|
+
relatedNodeIds: z.array(z.string()),
|
|
758
|
+
sourceCommit: z.string().nullable(),
|
|
759
|
+
riskLevel: contextTreeRiskLevelSchema
|
|
760
|
+
});
|
|
761
|
+
const contextTreeSummarySchema = z.object({
|
|
762
|
+
addedCount: z.number().int().nonnegative(),
|
|
763
|
+
editedCount: z.number().int().nonnegative(),
|
|
764
|
+
removedCount: z.number().int().nonnegative(),
|
|
765
|
+
changedNodeCount: z.number().int().nonnegative()
|
|
766
|
+
});
|
|
767
|
+
const contextTreeSnapshotSchema = z.object({
|
|
768
|
+
repo: z.string().nullable(),
|
|
769
|
+
branch: z.string().nullable(),
|
|
770
|
+
headCommit: z.string().nullable(),
|
|
771
|
+
syncedAt: z.string().nullable(),
|
|
772
|
+
snapshotStatus: contextTreeSnapshotStatusSchema,
|
|
773
|
+
contextStatus: contextTreeStatusSchema,
|
|
774
|
+
summary: contextTreeSummarySchema,
|
|
775
|
+
updates: z.array(contextTreeUpdateSchema),
|
|
776
|
+
nodes: z.array(contextTreeNodeSchema),
|
|
777
|
+
edges: z.array(contextTreeEdgeSchema),
|
|
778
|
+
changes: z.array(contextTreeChangeSchema)
|
|
779
|
+
});
|
|
682
780
|
const supportedImageMimeSchema = z.enum([
|
|
683
781
|
"image/png",
|
|
684
782
|
"image/jpeg",
|
|
@@ -1369,4 +1467,4 @@ z.object({
|
|
|
1369
1467
|
capabilities: serverCapabilitiesSchema.optional()
|
|
1370
1468
|
}).passthrough();
|
|
1371
1469
|
//#endregion
|
|
1372
|
-
export {
|
|
1470
|
+
export { notificationQuerySchema as $, createChatSchema as A, githubDevCallbackQuerySchema as B, clientCapabilitiesSchema as C, updateTaskStatusSchema as Ct, createAdapterConfigSchema as D, contextTreeSnapshotSchema as E, defaultRuntimeConfigPayload as F, inboxPollQuerySchema as G, imageInlineContentSchema as H, delegateFeishuUserSchema as I, joinByInvitationSchema as J, isRedactedEnvValue as K, dryRunAgentRuntimeConfigSchema as L, createMemberSchema as M, createOrgFromMeSchema as N, createAdapterMappingSchema as O, createTaskSchema as P, messageSourceSchema as Q, extractMentions as R, agentTypeSchema as S, updateOrganizationSchema as St, connectTokenExchangeSchema as T, inboxAckFrameSchema as U, githubStartQuerySchema as V, inboxDeliverFrameSchema as W, listMeChatsQuerySchema as X, linkTaskChatSchema as Y, loginSchema as Z, adminCreateTaskSchema as _, updateAgentRuntimeConfigSchema as _t, AGENT_STATUSES as a, scanMentionTokens as at, agentPinnedMessageSchema as b, updateClientCapabilitiesSchema as bt, DEFAULT_RUNTIME_PROVIDER as c, sendToAgentSchema as ct, TASK_HEALTH_SIGNALS as d, sessionEventSchema as dt, paginationQuerySchema as et, TASK_STATUSES as f, sessionReconcileRequestSchema as ft, addParticipantSchema as g, updateAdapterConfigSchema as gt, addMeChatParticipantsSchema as h, taskListQuerySchema as ht, AGENT_SOURCES as i, safeRedirectPath as it, createMeChatSchema as j, createAgentSchema as k, MENTION_REGEX as l, sessionCompletionMessageSchema as lt, WS_AUTH_FRAME_TIMEOUT_MS as m, stripCode as mt, AGENT_NAME_REGEX as n, refreshTokenSchema as nt, AGENT_TYPES as o, selfServiceFeishuBotSchema as ot, TASK_TERMINAL_STATUSES as p, sessionStateMessageSchema as pt, isReservedAgentName as q, AGENT_SELECTOR_HEADER as r, runtimeStateMessageSchema as rt, AGENT_VISIBILITY as s, sendMessageSchema as st, AGENT_BIND_REJECT_REASONS as t, rebindAgentSchema as tt, TASK_CREATOR_TYPES as u, sessionEventMessageSchema as ut, adminUpdateTaskSchema as v, updateAgentSchema as vt, clientRegisterSchema as w, wsAuthFrameSchema as wt, agentRuntimeConfigPayloadSchema as x, updateMemberSchema as xt, agentBindRequestSchema as y, updateChatSchema as yt, githubCallbackQuerySchema as z };
|