@autohq/cli 0.1.130 → 0.1.131
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/agent-bridge.js +2 -21
- package/dist/index.js +27 -204
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -20993,7 +20993,6 @@ var SecretDeleteResponseSchema = external_exports.object({
|
|
|
20993
20993
|
});
|
|
20994
20994
|
|
|
20995
20995
|
// ../../packages/schemas/src/tools.ts
|
|
20996
|
-
var RESOURCE_KIND_TOOL = "tool";
|
|
20997
20996
|
var REMOTE_MCP_TRANSPORTS = ["streamable_http"];
|
|
20998
20997
|
var LOCAL_TOOL_IMPLEMENTATIONS = ["auto", "chat", "ping"];
|
|
20999
20998
|
var SecretReferenceSchema = external_exports.object({
|
|
@@ -21124,12 +21123,6 @@ var ToolConnectCompleteResponseSchema = external_exports.object({
|
|
|
21124
21123
|
connection: ResourceNameSchema,
|
|
21125
21124
|
projectId: ProjectIdSchema
|
|
21126
21125
|
});
|
|
21127
|
-
var ReferencedSessionToolRefSchema = external_exports.object({
|
|
21128
|
-
ref: ResourceNameSchema
|
|
21129
|
-
}).strict();
|
|
21130
|
-
var ReferencedSessionToolRefsSchema = external_exports.object({
|
|
21131
|
-
refs: external_exports.array(ResourceNameSchema).min(1)
|
|
21132
|
-
}).strict();
|
|
21133
21126
|
var InlineSessionToolSchema = RemoteMcpToolSchema.extend({
|
|
21134
21127
|
disabled: external_exports.boolean().optional()
|
|
21135
21128
|
}).or(
|
|
@@ -21143,9 +21136,7 @@ var InlineSessionToolSchema = RemoteMcpToolSchema.extend({
|
|
|
21143
21136
|
disabled: external_exports.boolean().optional()
|
|
21144
21137
|
})
|
|
21145
21138
|
);
|
|
21146
|
-
var SessionToolRefSchema = InlineSessionToolSchema
|
|
21147
|
-
ReferencedSessionToolRefSchema
|
|
21148
|
-
).or(ReferencedSessionToolRefsSchema);
|
|
21139
|
+
var SessionToolRefSchema = InlineSessionToolSchema;
|
|
21149
21140
|
var SessionToolsSchema = external_exports.record(
|
|
21150
21141
|
ToolAliasSchema,
|
|
21151
21142
|
SessionToolRefSchema
|
|
@@ -21904,10 +21895,6 @@ var IdentityApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
|
21904
21895
|
RESOURCE_KIND_IDENTITY,
|
|
21905
21896
|
IdentityApplyRequestSchema.shape.spec
|
|
21906
21897
|
);
|
|
21907
|
-
var ToolApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
21908
|
-
RESOURCE_KIND_TOOL,
|
|
21909
|
-
ToolApplyRequestSchema.shape.spec
|
|
21910
|
-
);
|
|
21911
21898
|
var SessionApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
21912
21899
|
RESOURCE_KIND_SESSION,
|
|
21913
21900
|
SessionApplyRequestSchema.shape.spec
|
|
@@ -21915,13 +21902,11 @@ var SessionApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
|
21915
21902
|
var ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
21916
21903
|
EnvironmentApplyDocumentSchema,
|
|
21917
21904
|
IdentityApplyDocumentSchema,
|
|
21918
|
-
ToolApplyDocumentSchema,
|
|
21919
21905
|
SessionApplyDocumentSchema
|
|
21920
21906
|
]);
|
|
21921
21907
|
var PROJECT_RESOURCE_APPLY_ORDER = [
|
|
21922
21908
|
RESOURCE_KIND_ENVIRONMENT,
|
|
21923
21909
|
RESOURCE_KIND_IDENTITY,
|
|
21924
|
-
RESOURCE_KIND_TOOL,
|
|
21925
21910
|
RESOURCE_KIND_SESSION
|
|
21926
21911
|
];
|
|
21927
21912
|
var PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
|
|
@@ -21967,7 +21952,6 @@ var ProjectApplySystemConfigSchema = external_exports.object({
|
|
|
21967
21952
|
var ProjectAppliedResourceSchema = external_exports.union([
|
|
21968
21953
|
EnvironmentResourceSchema,
|
|
21969
21954
|
IdentityResourceSchema,
|
|
21970
|
-
ToolResourceSchema,
|
|
21971
21955
|
SessionResourceSchema
|
|
21972
21956
|
]);
|
|
21973
21957
|
var ProjectApplyDiagnosticSchema = external_exports.object({
|
|
@@ -21979,7 +21963,6 @@ var ProjectApplyDiagnosticSchema = external_exports.object({
|
|
|
21979
21963
|
kind: external_exports.enum([
|
|
21980
21964
|
RESOURCE_KIND_ENVIRONMENT,
|
|
21981
21965
|
RESOURCE_KIND_IDENTITY,
|
|
21982
|
-
RESOURCE_KIND_TOOL,
|
|
21983
21966
|
RESOURCE_KIND_SESSION
|
|
21984
21967
|
]),
|
|
21985
21968
|
name: external_exports.string().min(1)
|
|
@@ -21995,7 +21978,6 @@ var ProjectApplyResponseSchema = external_exports.object({
|
|
|
21995
21978
|
kind: external_exports.enum([
|
|
21996
21979
|
RESOURCE_KIND_ENVIRONMENT,
|
|
21997
21980
|
RESOURCE_KIND_IDENTITY,
|
|
21998
|
-
RESOURCE_KIND_TOOL,
|
|
21999
21981
|
RESOURCE_KIND_SESSION
|
|
22000
21982
|
]),
|
|
22001
21983
|
name: external_exports.string().min(1),
|
|
@@ -22007,7 +21989,6 @@ var ProjectApplyResponseSchema = external_exports.object({
|
|
|
22007
21989
|
kind: external_exports.enum([
|
|
22008
21990
|
RESOURCE_KIND_ENVIRONMENT,
|
|
22009
21991
|
RESOURCE_KIND_IDENTITY,
|
|
22010
|
-
RESOURCE_KIND_TOOL,
|
|
22011
21992
|
RESOURCE_KIND_SESSION
|
|
22012
21993
|
]),
|
|
22013
21994
|
name: external_exports.string().min(1),
|
|
@@ -26283,7 +26264,7 @@ Object.assign(lookup, {
|
|
|
26283
26264
|
// package.json
|
|
26284
26265
|
var package_default = {
|
|
26285
26266
|
name: "@autohq/cli",
|
|
26286
|
-
version: "0.1.
|
|
26267
|
+
version: "0.1.131",
|
|
26287
26268
|
license: "SEE LICENSE IN README.md",
|
|
26288
26269
|
publishConfig: {
|
|
26289
26270
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -17603,7 +17603,7 @@ function remoteMcpToolSchema(input) {
|
|
|
17603
17603
|
]).default({ kind: "none" })
|
|
17604
17604
|
});
|
|
17605
17605
|
}
|
|
17606
|
-
var
|
|
17606
|
+
var REMOTE_MCP_TRANSPORTS, LOCAL_TOOL_IMPLEMENTATIONS, SecretReferenceSchema, NoToolAuthSchema, McpOAuthToolAuthSchema, ConnectionToolAuthSchema, ConnectionsToolAuthSchema, ToolAliasSchema, RemoteMcpToolSchema, LocalAutoToolSchema, LocalPingToolSchema, LocalChatToolSchema, LocalToolSchema, GithubToolSchema, ToolSpecSchema, ToolResourceSchema, ToolApplyRequestSchema, ToolConnectRequestSchema, ToolConnectResponseSchema, ToolConnectCompleteResponseSchema, InlineSessionToolSchema, SessionToolRefSchema, SessionToolsSchema;
|
|
17607
17607
|
var init_tools = __esm({
|
|
17608
17608
|
"../../packages/schemas/src/tools.ts"() {
|
|
17609
17609
|
"use strict";
|
|
@@ -17612,7 +17612,6 @@ var init_tools = __esm({
|
|
|
17612
17612
|
init_github_mcp_catalog();
|
|
17613
17613
|
init_ids();
|
|
17614
17614
|
init_resources();
|
|
17615
|
-
RESOURCE_KIND_TOOL = "tool";
|
|
17616
17615
|
REMOTE_MCP_TRANSPORTS = ["streamable_http"];
|
|
17617
17616
|
LOCAL_TOOL_IMPLEMENTATIONS = ["auto", "chat", "ping"];
|
|
17618
17617
|
SecretReferenceSchema = external_exports.object({
|
|
@@ -17707,12 +17706,6 @@ var init_tools = __esm({
|
|
|
17707
17706
|
connection: ResourceNameSchema,
|
|
17708
17707
|
projectId: ProjectIdSchema
|
|
17709
17708
|
});
|
|
17710
|
-
ReferencedSessionToolRefSchema = external_exports.object({
|
|
17711
|
-
ref: ResourceNameSchema
|
|
17712
|
-
}).strict();
|
|
17713
|
-
ReferencedSessionToolRefsSchema = external_exports.object({
|
|
17714
|
-
refs: external_exports.array(ResourceNameSchema).min(1)
|
|
17715
|
-
}).strict();
|
|
17716
17709
|
InlineSessionToolSchema = RemoteMcpToolSchema.extend({
|
|
17717
17710
|
disabled: external_exports.boolean().optional()
|
|
17718
17711
|
}).or(
|
|
@@ -17726,9 +17719,7 @@ var init_tools = __esm({
|
|
|
17726
17719
|
disabled: external_exports.boolean().optional()
|
|
17727
17720
|
})
|
|
17728
17721
|
);
|
|
17729
|
-
SessionToolRefSchema = InlineSessionToolSchema
|
|
17730
|
-
ReferencedSessionToolRefSchema
|
|
17731
|
-
).or(ReferencedSessionToolRefsSchema);
|
|
17722
|
+
SessionToolRefSchema = InlineSessionToolSchema;
|
|
17732
17723
|
SessionToolsSchema = external_exports.record(
|
|
17733
17724
|
ToolAliasSchema,
|
|
17734
17725
|
SessionToolRefSchema
|
|
@@ -18594,7 +18585,7 @@ var init_project_service_accounts = __esm({
|
|
|
18594
18585
|
});
|
|
18595
18586
|
|
|
18596
18587
|
// ../../packages/schemas/src/project-resources.ts
|
|
18597
|
-
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema,
|
|
18588
|
+
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseSchema;
|
|
18598
18589
|
var init_project_resources = __esm({
|
|
18599
18590
|
"../../packages/schemas/src/project-resources.ts"() {
|
|
18600
18591
|
"use strict";
|
|
@@ -18603,7 +18594,6 @@ var init_project_resources = __esm({
|
|
|
18603
18594
|
init_identities();
|
|
18604
18595
|
init_resources();
|
|
18605
18596
|
init_sessions();
|
|
18606
|
-
init_tools();
|
|
18607
18597
|
EnvironmentApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
18608
18598
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18609
18599
|
EnvironmentApplyRequestSchema.shape.spec
|
|
@@ -18612,10 +18602,6 @@ var init_project_resources = __esm({
|
|
|
18612
18602
|
RESOURCE_KIND_IDENTITY,
|
|
18613
18603
|
IdentityApplyRequestSchema.shape.spec
|
|
18614
18604
|
);
|
|
18615
|
-
ToolApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
18616
|
-
RESOURCE_KIND_TOOL,
|
|
18617
|
-
ToolApplyRequestSchema.shape.spec
|
|
18618
|
-
);
|
|
18619
18605
|
SessionApplyDocumentSchema = resourceApplyDocumentSchema(
|
|
18620
18606
|
RESOURCE_KIND_SESSION,
|
|
18621
18607
|
SessionApplyRequestSchema.shape.spec
|
|
@@ -18623,13 +18609,11 @@ var init_project_resources = __esm({
|
|
|
18623
18609
|
ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
|
|
18624
18610
|
EnvironmentApplyDocumentSchema,
|
|
18625
18611
|
IdentityApplyDocumentSchema,
|
|
18626
|
-
ToolApplyDocumentSchema,
|
|
18627
18612
|
SessionApplyDocumentSchema
|
|
18628
18613
|
]);
|
|
18629
18614
|
PROJECT_RESOURCE_APPLY_ORDER = [
|
|
18630
18615
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18631
18616
|
RESOURCE_KIND_IDENTITY,
|
|
18632
|
-
RESOURCE_KIND_TOOL,
|
|
18633
18617
|
RESOURCE_KIND_SESSION
|
|
18634
18618
|
];
|
|
18635
18619
|
PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
|
|
@@ -18675,7 +18659,6 @@ var init_project_resources = __esm({
|
|
|
18675
18659
|
ProjectAppliedResourceSchema = external_exports.union([
|
|
18676
18660
|
EnvironmentResourceSchema,
|
|
18677
18661
|
IdentityResourceSchema,
|
|
18678
|
-
ToolResourceSchema,
|
|
18679
18662
|
SessionResourceSchema
|
|
18680
18663
|
]);
|
|
18681
18664
|
ProjectApplyDiagnosticSchema = external_exports.object({
|
|
@@ -18687,7 +18670,6 @@ var init_project_resources = __esm({
|
|
|
18687
18670
|
kind: external_exports.enum([
|
|
18688
18671
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18689
18672
|
RESOURCE_KIND_IDENTITY,
|
|
18690
|
-
RESOURCE_KIND_TOOL,
|
|
18691
18673
|
RESOURCE_KIND_SESSION
|
|
18692
18674
|
]),
|
|
18693
18675
|
name: external_exports.string().min(1)
|
|
@@ -18703,7 +18685,6 @@ var init_project_resources = __esm({
|
|
|
18703
18685
|
kind: external_exports.enum([
|
|
18704
18686
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18705
18687
|
RESOURCE_KIND_IDENTITY,
|
|
18706
|
-
RESOURCE_KIND_TOOL,
|
|
18707
18688
|
RESOURCE_KIND_SESSION
|
|
18708
18689
|
]),
|
|
18709
18690
|
name: external_exports.string().min(1),
|
|
@@ -18715,7 +18696,6 @@ var init_project_resources = __esm({
|
|
|
18715
18696
|
kind: external_exports.enum([
|
|
18716
18697
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18717
18698
|
RESOURCE_KIND_IDENTITY,
|
|
18718
|
-
RESOURCE_KIND_TOOL,
|
|
18719
18699
|
RESOURCE_KIND_SESSION
|
|
18720
18700
|
]),
|
|
18721
18701
|
name: external_exports.string().min(1),
|
|
@@ -21225,7 +21205,7 @@ var init_package = __esm({
|
|
|
21225
21205
|
"package.json"() {
|
|
21226
21206
|
package_default = {
|
|
21227
21207
|
name: "@autohq/cli",
|
|
21228
|
-
version: "0.1.
|
|
21208
|
+
version: "0.1.131",
|
|
21229
21209
|
license: "SEE LICENSE IN README.md",
|
|
21230
21210
|
publishConfig: {
|
|
21231
21211
|
access: "public"
|
|
@@ -21580,30 +21560,14 @@ function appliedResourceKind(request, response, index) {
|
|
|
21580
21560
|
return kind;
|
|
21581
21561
|
}
|
|
21582
21562
|
function mcpOAuthToolConnectionsFromApplyRequest(request) {
|
|
21583
|
-
return request.resources.filter((resource) => resource.kind ===
|
|
21584
|
-
|
|
21585
|
-
return [];
|
|
21586
|
-
}
|
|
21587
|
-
return [
|
|
21588
|
-
{
|
|
21589
|
-
tool: resource.metadata.name,
|
|
21590
|
-
connection: resource.spec.auth.connection
|
|
21591
|
-
}
|
|
21592
|
-
];
|
|
21563
|
+
return request.resources.filter((resource) => resource.kind === RESOURCE_KIND_SESSION).flatMap((resource) => {
|
|
21564
|
+
return mcpOAuthToolConnectionsFromSessionTools(resource.spec.tools);
|
|
21593
21565
|
});
|
|
21594
21566
|
}
|
|
21595
21567
|
function mcpOAuthToolConnectionsFromAppliedResources(resources) {
|
|
21596
|
-
return resources.filter((item) => item.kind ===
|
|
21568
|
+
return resources.filter((item) => item.kind === RESOURCE_KIND_SESSION).flatMap((item) => {
|
|
21597
21569
|
const resource = item.resource;
|
|
21598
|
-
|
|
21599
|
-
return [];
|
|
21600
|
-
}
|
|
21601
|
-
return [
|
|
21602
|
-
{
|
|
21603
|
-
tool: resource.metadata.name,
|
|
21604
|
-
connection: resource.spec.auth.connection
|
|
21605
|
-
}
|
|
21606
|
-
];
|
|
21570
|
+
return mcpOAuthToolConnectionsFromSessionTools(resource.spec.tools);
|
|
21607
21571
|
});
|
|
21608
21572
|
}
|
|
21609
21573
|
function applyFiles(root) {
|
|
@@ -21626,6 +21590,14 @@ function applyFiles(root) {
|
|
|
21626
21590
|
}
|
|
21627
21591
|
return files;
|
|
21628
21592
|
}
|
|
21593
|
+
function mcpOAuthToolConnectionsFromSessionTools(tools) {
|
|
21594
|
+
return Object.entries(tools).flatMap(([alias, tool]) => {
|
|
21595
|
+
if (tool.kind !== "mcp_remote" || tool.disabled || tool.auth.kind !== "mcp_oauth") {
|
|
21596
|
+
return [];
|
|
21597
|
+
}
|
|
21598
|
+
return [{ tool: alias, connection: tool.auth.connection }];
|
|
21599
|
+
});
|
|
21600
|
+
}
|
|
21629
21601
|
function readApplyDocumentFile(path2) {
|
|
21630
21602
|
const source = readFileSync3(path2, "utf8");
|
|
21631
21603
|
let documents;
|
|
@@ -21825,13 +21797,11 @@ var init_files = __esm({
|
|
|
21825
21797
|
APPLY_DIRECTORIES = {
|
|
21826
21798
|
environment: "environments",
|
|
21827
21799
|
identity: "identities",
|
|
21828
|
-
tool: "tools",
|
|
21829
21800
|
session: "sessions"
|
|
21830
21801
|
};
|
|
21831
21802
|
APPLY_SCHEMAS = {
|
|
21832
21803
|
environment: EnvironmentApplyRequestSchema,
|
|
21833
21804
|
identity: IdentityApplyRequestSchema,
|
|
21834
|
-
tool: ToolApplyRequestSchema,
|
|
21835
21805
|
session: SessionApplyRequestSchema
|
|
21836
21806
|
};
|
|
21837
21807
|
ALLOWED_AVATAR_EXTENSIONS = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png"]);
|
|
@@ -22004,8 +21974,6 @@ async function listProjectResources2(client, kind, options) {
|
|
|
22004
21974
|
return (await client.listEnvironments(options)).environments;
|
|
22005
21975
|
case RESOURCE_KIND_IDENTITY:
|
|
22006
21976
|
return (await client.listIdentities(options)).identities;
|
|
22007
|
-
case RESOURCE_KIND_TOOL:
|
|
22008
|
-
return (await client.listTools(options)).tools;
|
|
22009
21977
|
case RESOURCE_KIND_SESSION:
|
|
22010
21978
|
return (await client.listSessions(options)).sessions;
|
|
22011
21979
|
}
|
|
@@ -22032,12 +22000,6 @@ var init_resources3 = __esm({
|
|
|
22032
22000
|
label: "Environment",
|
|
22033
22001
|
pluralLabel: "Environments"
|
|
22034
22002
|
},
|
|
22035
|
-
[RESOURCE_KIND_TOOL]: {
|
|
22036
|
-
kind: RESOURCE_KIND_TOOL,
|
|
22037
|
-
section: "tools",
|
|
22038
|
-
label: "Tool",
|
|
22039
|
-
pluralLabel: "Tools"
|
|
22040
|
-
},
|
|
22041
22003
|
[RESOURCE_KIND_IDENTITY]: {
|
|
22042
22004
|
kind: RESOURCE_KIND_IDENTITY,
|
|
22043
22005
|
section: "identities",
|
|
@@ -22054,8 +22016,7 @@ var init_resources3 = __esm({
|
|
|
22054
22016
|
PROJECT_RESOURCE_TUI_ORDER = [
|
|
22055
22017
|
RESOURCE_KIND_SESSION,
|
|
22056
22018
|
RESOURCE_KIND_IDENTITY,
|
|
22057
|
-
RESOURCE_KIND_ENVIRONMENT
|
|
22058
|
-
RESOURCE_KIND_TOOL
|
|
22019
|
+
RESOURCE_KIND_ENVIRONMENT
|
|
22059
22020
|
];
|
|
22060
22021
|
PROJECT_RESOURCE_TUI_DEFINITIONS = PROJECT_RESOURCE_TUI_ORDER.map(
|
|
22061
22022
|
(kind) => PROJECT_RESOURCE_TUI_DEFINITION_BY_KIND[kind]
|
|
@@ -24476,38 +24437,6 @@ function EnvironmentsView({
|
|
|
24476
24437
|
}
|
|
24477
24438
|
);
|
|
24478
24439
|
}
|
|
24479
|
-
function ToolsView({
|
|
24480
|
-
resources,
|
|
24481
|
-
selectedIndex,
|
|
24482
|
-
selectedSession,
|
|
24483
|
-
error: error51
|
|
24484
|
-
}) {
|
|
24485
|
-
return /* @__PURE__ */ jsx9(
|
|
24486
|
-
ResourceTable,
|
|
24487
|
-
{
|
|
24488
|
-
rows: resources.map((tool) => {
|
|
24489
|
-
const aliases = sessionToolAliases(selectedSession, tool.metadata.name);
|
|
24490
|
-
return {
|
|
24491
|
-
id: tool.metadata.uid,
|
|
24492
|
-
name: tool.metadata.name,
|
|
24493
|
-
kind: toolKind(tool),
|
|
24494
|
-
target: toolTarget(tool),
|
|
24495
|
-
detail: [
|
|
24496
|
-
toolAuth(tool),
|
|
24497
|
-
aliases.length ? `alias:${aliases.join(",")}` : ""
|
|
24498
|
-
].filter(Boolean).join(" "),
|
|
24499
|
-
updatedAt: tool.metadata.updatedAt
|
|
24500
|
-
};
|
|
24501
|
-
}),
|
|
24502
|
-
selectedIndex,
|
|
24503
|
-
error: error51,
|
|
24504
|
-
empty: "no tools found",
|
|
24505
|
-
kindHeader: "KIND",
|
|
24506
|
-
targetHeader: "TARGET",
|
|
24507
|
-
detailHeader: "AUTH / ALIAS"
|
|
24508
|
-
}
|
|
24509
|
-
);
|
|
24510
|
-
}
|
|
24511
24440
|
function IdentitiesView({
|
|
24512
24441
|
resources,
|
|
24513
24442
|
selectedIndex,
|
|
@@ -24647,26 +24576,6 @@ function envValueKind(value) {
|
|
|
24647
24576
|
}
|
|
24648
24577
|
return "unknown";
|
|
24649
24578
|
}
|
|
24650
|
-
function sessionToolAliases(selectedSession, toolName) {
|
|
24651
|
-
if (!selectedSession) return [];
|
|
24652
|
-
return Object.entries(selectedSession.spec.tools).filter(([, value]) => "ref" in value && value.ref === toolName).map(([alias]) => alias).sort();
|
|
24653
|
-
}
|
|
24654
|
-
function toolKind(tool) {
|
|
24655
|
-
if (tool.spec.kind === "local") return `local/${tool.spec.implementation}`;
|
|
24656
|
-
return tool.spec.kind;
|
|
24657
|
-
}
|
|
24658
|
-
function toolTarget(tool) {
|
|
24659
|
-
if (tool.spec.kind === "local") return tool.spec.implementation;
|
|
24660
|
-
return tool.spec.url;
|
|
24661
|
-
}
|
|
24662
|
-
function toolAuth(tool) {
|
|
24663
|
-
const auth = tool.spec.auth;
|
|
24664
|
-
if (auth.kind === "none") return "auth:none";
|
|
24665
|
-
if (auth.kind === "bearer") return "auth:bearer";
|
|
24666
|
-
if (auth.kind === "provider_oauth") return `auth:${auth.provider}`;
|
|
24667
|
-
if (auth.kind === "connection") return `auth:${auth.provider}`;
|
|
24668
|
-
return "auth:unknown";
|
|
24669
|
-
}
|
|
24670
24579
|
var COL_KIND, COL_DETAIL, COL_TARGET, COL_UPDATED, ROW_GAP_COUNT;
|
|
24671
24580
|
var init_ResourceViews = __esm({
|
|
24672
24581
|
"src/tui/ResourceViews.tsx"() {
|
|
@@ -24722,10 +24631,6 @@ function useIdentities(apiUrl) {
|
|
|
24722
24631
|
const client = useApiClient();
|
|
24723
24632
|
return useQuery(identitiesQueryOptions(client, apiUrl));
|
|
24724
24633
|
}
|
|
24725
|
-
function useTools(apiUrl) {
|
|
24726
|
-
const client = useApiClient();
|
|
24727
|
-
return useQuery(toolsQueryOptions(client, apiUrl));
|
|
24728
|
-
}
|
|
24729
24634
|
function useSessionRuns(sessionName, apiUrl, includeArchived = false) {
|
|
24730
24635
|
const client = useApiClient();
|
|
24731
24636
|
return useQuery(
|
|
@@ -25017,16 +24922,6 @@ function sessionsQueryOptions(client, apiUrl) {
|
|
|
25017
24922
|
staleTime: Number.POSITIVE_INFINITY
|
|
25018
24923
|
});
|
|
25019
24924
|
}
|
|
25020
|
-
function toolsQueryOptions(client, apiUrl) {
|
|
25021
|
-
return queryOptions({
|
|
25022
|
-
queryKey: queryKeys.tools(apiUrl),
|
|
25023
|
-
queryFn: async () => {
|
|
25024
|
-
const res = await client.listTools({ apiBaseUrl: apiUrl });
|
|
25025
|
-
return sortByName(res.tools);
|
|
25026
|
-
},
|
|
25027
|
-
staleTime: Number.POSITIVE_INFINITY
|
|
25028
|
-
});
|
|
25029
|
-
}
|
|
25030
24925
|
function projectsQueryOptions(client, apiUrl) {
|
|
25031
24926
|
return queryOptions({
|
|
25032
24927
|
queryKey: queryKeys.projects(apiUrl),
|
|
@@ -25571,8 +25466,6 @@ function selectedNamedResourceForSection(input) {
|
|
|
25571
25466
|
return input.selectedIdentity ?? null;
|
|
25572
25467
|
case "sessions":
|
|
25573
25468
|
return input.selectedSession ?? null;
|
|
25574
|
-
case "tools":
|
|
25575
|
-
return input.selectedTool ?? null;
|
|
25576
25469
|
default:
|
|
25577
25470
|
return null;
|
|
25578
25471
|
}
|
|
@@ -25612,7 +25505,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25612
25505
|
const [sessionIndex, setSessionIndex] = useState3(0);
|
|
25613
25506
|
const [environmentIndex, setEnvironmentIndex] = useState3(0);
|
|
25614
25507
|
const [identityIndex, setIdentityIndex] = useState3(0);
|
|
25615
|
-
const [toolIndex, setToolIndex] = useState3(0);
|
|
25616
25508
|
const [projectIndex, setProjectIndex] = useState3(0);
|
|
25617
25509
|
const [serviceAccountIndex, setServiceAccountIndex] = useState3(0);
|
|
25618
25510
|
const [runIndex, setRunIndex] = useState3(0);
|
|
@@ -25652,11 +25544,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25652
25544
|
isLoading: isIdentitiesLoading,
|
|
25653
25545
|
error: identitiesError
|
|
25654
25546
|
} = useIdentities(apiUrl);
|
|
25655
|
-
const {
|
|
25656
|
-
data: tools = [],
|
|
25657
|
-
isLoading: isToolsLoading,
|
|
25658
|
-
error: toolsError
|
|
25659
|
-
} = useTools(apiUrl);
|
|
25660
25547
|
const {
|
|
25661
25548
|
data: projects = [],
|
|
25662
25549
|
isLoading: isProjectsLoading,
|
|
@@ -25745,14 +25632,12 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25745
25632
|
const selectedSession = sessions[sessionIndex];
|
|
25746
25633
|
const selectedEnvironment = environments[environmentIndex];
|
|
25747
25634
|
const selectedIdentity = identities[identityIndex];
|
|
25748
|
-
const selectedTool = tools[toolIndex];
|
|
25749
25635
|
const selectedInspectableResource = useMemo3(() => {
|
|
25750
25636
|
const selectedEditable = editableResourceForSelection({
|
|
25751
25637
|
activeSection,
|
|
25752
25638
|
selectedEnvironment,
|
|
25753
25639
|
selectedIdentity,
|
|
25754
|
-
selectedSession
|
|
25755
|
-
selectedTool
|
|
25640
|
+
selectedSession
|
|
25756
25641
|
});
|
|
25757
25642
|
if (!selectedEditable) {
|
|
25758
25643
|
return null;
|
|
@@ -25776,37 +25661,18 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25776
25661
|
name: selectedEditable.name,
|
|
25777
25662
|
spec: selectedIdentity.spec
|
|
25778
25663
|
} : null;
|
|
25779
|
-
case "tools":
|
|
25780
|
-
return selectedTool ? {
|
|
25781
|
-
kind: selectedEditable.kind,
|
|
25782
|
-
name: selectedEditable.name,
|
|
25783
|
-
spec: selectedTool.spec
|
|
25784
|
-
} : null;
|
|
25785
25664
|
default:
|
|
25786
25665
|
return null;
|
|
25787
25666
|
}
|
|
25788
|
-
}, [
|
|
25789
|
-
activeSection,
|
|
25790
|
-
selectedEnvironment,
|
|
25791
|
-
selectedIdentity,
|
|
25792
|
-
selectedSession,
|
|
25793
|
-
selectedTool
|
|
25794
|
-
]);
|
|
25667
|
+
}, [activeSection, selectedEnvironment, selectedIdentity, selectedSession]);
|
|
25795
25668
|
const selectedEditableResource = useMemo3(
|
|
25796
25669
|
() => editableResourceForSelection({
|
|
25797
25670
|
activeSection,
|
|
25798
25671
|
selectedEnvironment,
|
|
25799
25672
|
selectedIdentity,
|
|
25800
|
-
selectedSession
|
|
25801
|
-
selectedTool
|
|
25673
|
+
selectedSession
|
|
25802
25674
|
}),
|
|
25803
|
-
[
|
|
25804
|
-
activeSection,
|
|
25805
|
-
selectedEnvironment,
|
|
25806
|
-
selectedIdentity,
|
|
25807
|
-
selectedSession,
|
|
25808
|
-
selectedTool
|
|
25809
|
-
]
|
|
25675
|
+
[activeSection, selectedEnvironment, selectedIdentity, selectedSession]
|
|
25810
25676
|
);
|
|
25811
25677
|
const inspectPanelHeight = Math.max(1, termHeight - 12);
|
|
25812
25678
|
const scopedSession = runScopeSessionName ? sessions.find((session) => session.metadata.name === runScopeSessionName) : void 0;
|
|
@@ -25849,22 +25715,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
25849
25715
|
);
|
|
25850
25716
|
if (index >= 0) setEnvironmentIndex(index);
|
|
25851
25717
|
}, [environments, selectedSession]);
|
|
25852
|
-
useEffect3(() => {
|
|
25853
|
-
const sessionToolRefs = selectedSession ? Object.values(selectedSession.spec.tools).flatMap((tool) => {
|
|
25854
|
-
if ("ref" in tool) {
|
|
25855
|
-
return [tool.ref];
|
|
25856
|
-
}
|
|
25857
|
-
if ("refs" in tool) {
|
|
25858
|
-
return tool.refs;
|
|
25859
|
-
}
|
|
25860
|
-
return [];
|
|
25861
|
-
}) : [];
|
|
25862
|
-
if (sessionToolRefs.length === 0) return;
|
|
25863
|
-
const index = tools.findIndex(
|
|
25864
|
-
(tool) => sessionToolRefs.includes(tool.metadata.name)
|
|
25865
|
-
);
|
|
25866
|
-
if (index >= 0) setToolIndex(index);
|
|
25867
|
-
}, [tools, selectedSession]);
|
|
25868
25718
|
const connectionStatus = startConnection.error instanceof Error ? startConnection.error.message : allowConnection.error instanceof Error ? allowConnection.error.message : removeConnection.error instanceof Error ? removeConnection.error.message : connectionNotice;
|
|
25869
25719
|
const startRun = useCallback2(() => {
|
|
25870
25720
|
if (!scopedSession || triggerRun.isPending) return;
|
|
@@ -26410,16 +26260,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26410
26260
|
return;
|
|
26411
26261
|
}
|
|
26412
26262
|
}
|
|
26413
|
-
if (activeSection === "tools") {
|
|
26414
|
-
if (key.upArrow) {
|
|
26415
|
-
setToolIndex((i) => Math.max(0, i - 1));
|
|
26416
|
-
return;
|
|
26417
|
-
}
|
|
26418
|
-
if (key.downArrow) {
|
|
26419
|
-
setToolIndex((i) => clampListIndex(i + 1, tools.length));
|
|
26420
|
-
return;
|
|
26421
|
-
}
|
|
26422
|
-
}
|
|
26423
26263
|
if (activeSection === "serviceAccounts") {
|
|
26424
26264
|
if (input === "n") {
|
|
26425
26265
|
createServiceAccount2.reset();
|
|
@@ -26700,10 +26540,9 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26700
26540
|
sectionTitle = `Service Accounts[${serviceAccounts.length}]`;
|
|
26701
26541
|
break;
|
|
26702
26542
|
case "environments":
|
|
26703
|
-
case "identities":
|
|
26704
|
-
case "tools": {
|
|
26543
|
+
case "identities": {
|
|
26705
26544
|
const definition = PROJECT_RESOURCE_TUI_DEFINITIONS_BY_SECTION.get(activeSection);
|
|
26706
|
-
const count = activeSection === "environments" ? environments.length :
|
|
26545
|
+
const count = activeSection === "environments" ? environments.length : identities.length;
|
|
26707
26546
|
sectionTitle = `${definition?.pluralLabel ?? activeSection}[${count}]`;
|
|
26708
26547
|
break;
|
|
26709
26548
|
}
|
|
@@ -26874,14 +26713,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26874
26713
|
selectedSession,
|
|
26875
26714
|
error: environmentsError instanceof Error ? environmentsError.message : environmentsError ? String(environmentsError) : null
|
|
26876
26715
|
}
|
|
26877
|
-
) : activeSection === "tools" ? isToolsLoading ? /* @__PURE__ */ jsx14(Box13, { padding: 2, children: /* @__PURE__ */ jsx14(Spinner, { label: "loading tools\u2026" }) }) : /* @__PURE__ */ jsx14(
|
|
26878
|
-
ToolsView,
|
|
26879
|
-
{
|
|
26880
|
-
resources: tools,
|
|
26881
|
-
selectedIndex: toolIndex,
|
|
26882
|
-
selectedSession,
|
|
26883
|
-
error: toolsError instanceof Error ? toolsError.message : toolsError ? String(toolsError) : null
|
|
26884
|
-
}
|
|
26885
26716
|
) : activeSection === "identities" ? isIdentitiesLoading ? /* @__PURE__ */ jsx14(Box13, { padding: 2, children: /* @__PURE__ */ jsx14(Spinner, { label: "loading identities\u2026" }) }) : /* @__PURE__ */ jsx14(
|
|
26886
26717
|
IdentitiesView,
|
|
26887
26718
|
{
|
|
@@ -26993,7 +26824,7 @@ function HomeView({ apiUrl, notice, returnToSession }) {
|
|
|
26993
26824
|
/* @__PURE__ */ jsx14(Text14, { dimColor: true, children: ` ${inspectedResource.name} ` }),
|
|
26994
26825
|
/* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "\u203A" }),
|
|
26995
26826
|
/* @__PURE__ */ jsx14(Text14, { backgroundColor: "cyan", color: "black", children: " inspect " })
|
|
26996
|
-
] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "identities" || activeSection === "
|
|
26827
|
+
] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "identities" || activeSection === "serviceAccounts" || activeSection === "connections") && /* @__PURE__ */ jsx14(
|
|
26997
26828
|
Text14,
|
|
26998
26829
|
{
|
|
26999
26830
|
backgroundColor: "cyan",
|
|
@@ -27234,10 +27065,9 @@ var init_HomeView = __esm({
|
|
|
27234
27065
|
{ k: "2", label: "Runs", activeSection: "runs" },
|
|
27235
27066
|
resourceNavItem({ k: "3", section: "environments" }),
|
|
27236
27067
|
resourceNavItem({ k: "4", section: "identities" }),
|
|
27237
|
-
|
|
27238
|
-
{ k: "6", label: "
|
|
27239
|
-
{ k: "7", label: "
|
|
27240
|
-
{ k: "8", label: "Connections", activeSection: "connections" }
|
|
27068
|
+
{ k: "5", label: "Projects", activeSection: "projects" },
|
|
27069
|
+
{ k: "6", label: "Service Accounts", activeSection: "serviceAccounts" },
|
|
27070
|
+
{ k: "7", label: "Connections", activeSection: "connections" }
|
|
27241
27071
|
];
|
|
27242
27072
|
RESOURCES_PER_COLUMN = 4;
|
|
27243
27073
|
}
|
|
@@ -27501,13 +27331,6 @@ var init_launcher = __esm({
|
|
|
27501
27331
|
queryKey: queryKeys.environments,
|
|
27502
27332
|
sort: sortByResourceName
|
|
27503
27333
|
},
|
|
27504
|
-
[RESOURCE_KIND_TOOL]: {
|
|
27505
|
-
async list({ apiClient, apiUrl }) {
|
|
27506
|
-
return (await apiClient.listTools({ apiBaseUrl: apiUrl })).tools;
|
|
27507
|
-
},
|
|
27508
|
-
queryKey: queryKeys.tools,
|
|
27509
|
-
sort: sortByResourceName
|
|
27510
|
-
},
|
|
27511
27334
|
[RESOURCE_KIND_IDENTITY]: {
|
|
27512
27335
|
async list({ apiClient, apiUrl }) {
|
|
27513
27336
|
return (await apiClient.listIdentities({ apiBaseUrl: apiUrl })).identities;
|