@autohq/cli 0.1.130 → 0.1.132

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.
@@ -21124,12 +21124,6 @@ var ToolConnectCompleteResponseSchema = external_exports.object({
21124
21124
  connection: ResourceNameSchema,
21125
21125
  projectId: ProjectIdSchema
21126
21126
  });
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
21127
  var InlineSessionToolSchema = RemoteMcpToolSchema.extend({
21134
21128
  disabled: external_exports.boolean().optional()
21135
21129
  }).or(
@@ -21143,9 +21137,7 @@ var InlineSessionToolSchema = RemoteMcpToolSchema.extend({
21143
21137
  disabled: external_exports.boolean().optional()
21144
21138
  })
21145
21139
  );
21146
- var SessionToolRefSchema = InlineSessionToolSchema.or(
21147
- ReferencedSessionToolRefSchema
21148
- ).or(ReferencedSessionToolRefsSchema);
21140
+ var SessionToolRefSchema = InlineSessionToolSchema;
21149
21141
  var SessionToolsSchema = external_exports.record(
21150
21142
  ToolAliasSchema,
21151
21143
  SessionToolRefSchema
@@ -21904,10 +21896,6 @@ var IdentityApplyDocumentSchema = resourceApplyDocumentSchema(
21904
21896
  RESOURCE_KIND_IDENTITY,
21905
21897
  IdentityApplyRequestSchema.shape.spec
21906
21898
  );
21907
- var ToolApplyDocumentSchema = resourceApplyDocumentSchema(
21908
- RESOURCE_KIND_TOOL,
21909
- ToolApplyRequestSchema.shape.spec
21910
- );
21911
21899
  var SessionApplyDocumentSchema = resourceApplyDocumentSchema(
21912
21900
  RESOURCE_KIND_SESSION,
21913
21901
  SessionApplyRequestSchema.shape.spec
@@ -21915,16 +21903,23 @@ var SessionApplyDocumentSchema = resourceApplyDocumentSchema(
21915
21903
  var ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
21916
21904
  EnvironmentApplyDocumentSchema,
21917
21905
  IdentityApplyDocumentSchema,
21918
- ToolApplyDocumentSchema,
21919
21906
  SessionApplyDocumentSchema
21920
21907
  ]);
21921
21908
  var PROJECT_RESOURCE_APPLY_ORDER = [
21922
21909
  RESOURCE_KIND_ENVIRONMENT,
21923
21910
  RESOURCE_KIND_IDENTITY,
21924
- RESOURCE_KIND_TOOL,
21925
21911
  RESOURCE_KIND_SESSION
21926
21912
  ];
21927
21913
  var PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
21914
+ var ProjectApplyResponseResourceKindSchema = external_exports.enum([
21915
+ RESOURCE_KIND_ENVIRONMENT,
21916
+ RESOURCE_KIND_IDENTITY,
21917
+ RESOURCE_KIND_SESSION,
21918
+ // Legacy tool resources are no longer authorable, but apply responses may
21919
+ // still report archived/pruned tool rows while existing installations clean
21920
+ // up their stored resource state.
21921
+ RESOURCE_KIND_TOOL
21922
+ ]);
21928
21923
  var ProjectDeleteResourceSchema = external_exports.object({
21929
21924
  kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
21930
21925
  name: external_exports.string().trim().min(1)
@@ -21967,7 +21962,6 @@ var ProjectApplySystemConfigSchema = external_exports.object({
21967
21962
  var ProjectAppliedResourceSchema = external_exports.union([
21968
21963
  EnvironmentResourceSchema,
21969
21964
  IdentityResourceSchema,
21970
- ToolResourceSchema,
21971
21965
  SessionResourceSchema
21972
21966
  ]);
21973
21967
  var ProjectApplyDiagnosticSchema = external_exports.object({
@@ -21979,7 +21973,6 @@ var ProjectApplyDiagnosticSchema = external_exports.object({
21979
21973
  kind: external_exports.enum([
21980
21974
  RESOURCE_KIND_ENVIRONMENT,
21981
21975
  RESOURCE_KIND_IDENTITY,
21982
- RESOURCE_KIND_TOOL,
21983
21976
  RESOURCE_KIND_SESSION
21984
21977
  ]),
21985
21978
  name: external_exports.string().min(1)
@@ -21992,24 +21985,14 @@ var ProjectApplyResponseSchema = external_exports.object({
21992
21985
  plan: external_exports.array(
21993
21986
  external_exports.object({
21994
21987
  action: external_exports.enum(["create", "update", "unchanged", "archive"]),
21995
- kind: external_exports.enum([
21996
- RESOURCE_KIND_ENVIRONMENT,
21997
- RESOURCE_KIND_IDENTITY,
21998
- RESOURCE_KIND_TOOL,
21999
- RESOURCE_KIND_SESSION
22000
- ]),
21988
+ kind: ProjectApplyResponseResourceKindSchema,
22001
21989
  name: external_exports.string().min(1),
22002
21990
  uid: external_exports.string().min(1).optional()
22003
21991
  })
22004
21992
  ).default([]),
22005
21993
  pruned: external_exports.array(
22006
21994
  external_exports.object({
22007
- kind: external_exports.enum([
22008
- RESOURCE_KIND_ENVIRONMENT,
22009
- RESOURCE_KIND_IDENTITY,
22010
- RESOURCE_KIND_TOOL,
22011
- RESOURCE_KIND_SESSION
22012
- ]),
21995
+ kind: ProjectApplyResponseResourceKindSchema,
22013
21996
  name: external_exports.string().min(1),
22014
21997
  uid: external_exports.string().min(1)
22015
21998
  })
@@ -26283,7 +26266,7 @@ Object.assign(lookup, {
26283
26266
  // package.json
26284
26267
  var package_default = {
26285
26268
  name: "@autohq/cli",
26286
- version: "0.1.130",
26269
+ version: "0.1.132",
26287
26270
  license: "SEE LICENSE IN README.md",
26288
26271
  publishConfig: {
26289
26272
  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 RESOURCE_KIND_TOOL, REMOTE_MCP_TRANSPORTS, LOCAL_TOOL_IMPLEMENTATIONS, SecretReferenceSchema, NoToolAuthSchema, McpOAuthToolAuthSchema, ConnectionToolAuthSchema, ConnectionsToolAuthSchema, ToolAliasSchema, RemoteMcpToolSchema, LocalAutoToolSchema, LocalPingToolSchema, LocalChatToolSchema, LocalToolSchema, GithubToolSchema, ToolSpecSchema, ToolResourceSchema, ToolApplyRequestSchema, ToolConnectRequestSchema, ToolConnectResponseSchema, ToolConnectCompleteResponseSchema, ReferencedSessionToolRefSchema, ReferencedSessionToolRefsSchema, InlineSessionToolSchema, SessionToolRefSchema, SessionToolsSchema;
17606
+ var RESOURCE_KIND_TOOL, 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";
@@ -17707,12 +17707,6 @@ var init_tools = __esm({
17707
17707
  connection: ResourceNameSchema,
17708
17708
  projectId: ProjectIdSchema
17709
17709
  });
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
17710
  InlineSessionToolSchema = RemoteMcpToolSchema.extend({
17717
17711
  disabled: external_exports.boolean().optional()
17718
17712
  }).or(
@@ -17726,9 +17720,7 @@ var init_tools = __esm({
17726
17720
  disabled: external_exports.boolean().optional()
17727
17721
  })
17728
17722
  );
17729
- SessionToolRefSchema = InlineSessionToolSchema.or(
17730
- ReferencedSessionToolRefSchema
17731
- ).or(ReferencedSessionToolRefsSchema);
17723
+ SessionToolRefSchema = InlineSessionToolSchema;
17732
17724
  SessionToolsSchema = external_exports.record(
17733
17725
  ToolAliasSchema,
17734
17726
  SessionToolRefSchema
@@ -18594,7 +18586,7 @@ var init_project_service_accounts = __esm({
18594
18586
  });
18595
18587
 
18596
18588
  // ../../packages/schemas/src/project-resources.ts
18597
- var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, ToolApplyDocumentSchema, 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;
18589
+ var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, ProjectApplyResponseResourceKindSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseSchema;
18598
18590
  var init_project_resources = __esm({
18599
18591
  "../../packages/schemas/src/project-resources.ts"() {
18600
18592
  "use strict";
@@ -18612,10 +18604,6 @@ var init_project_resources = __esm({
18612
18604
  RESOURCE_KIND_IDENTITY,
18613
18605
  IdentityApplyRequestSchema.shape.spec
18614
18606
  );
18615
- ToolApplyDocumentSchema = resourceApplyDocumentSchema(
18616
- RESOURCE_KIND_TOOL,
18617
- ToolApplyRequestSchema.shape.spec
18618
- );
18619
18607
  SessionApplyDocumentSchema = resourceApplyDocumentSchema(
18620
18608
  RESOURCE_KIND_SESSION,
18621
18609
  SessionApplyRequestSchema.shape.spec
@@ -18623,16 +18611,23 @@ var init_project_resources = __esm({
18623
18611
  ProjectApplyResourceSchema = external_exports.discriminatedUnion("kind", [
18624
18612
  EnvironmentApplyDocumentSchema,
18625
18613
  IdentityApplyDocumentSchema,
18626
- ToolApplyDocumentSchema,
18627
18614
  SessionApplyDocumentSchema
18628
18615
  ]);
18629
18616
  PROJECT_RESOURCE_APPLY_ORDER = [
18630
18617
  RESOURCE_KIND_ENVIRONMENT,
18631
18618
  RESOURCE_KIND_IDENTITY,
18632
- RESOURCE_KIND_TOOL,
18633
18619
  RESOURCE_KIND_SESSION
18634
18620
  ];
18635
18621
  PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
18622
+ ProjectApplyResponseResourceKindSchema = external_exports.enum([
18623
+ RESOURCE_KIND_ENVIRONMENT,
18624
+ RESOURCE_KIND_IDENTITY,
18625
+ RESOURCE_KIND_SESSION,
18626
+ // Legacy tool resources are no longer authorable, but apply responses may
18627
+ // still report archived/pruned tool rows while existing installations clean
18628
+ // up their stored resource state.
18629
+ RESOURCE_KIND_TOOL
18630
+ ]);
18636
18631
  ProjectDeleteResourceSchema = external_exports.object({
18637
18632
  kind: external_exports.enum(PROJECT_RESOURCE_KINDS),
18638
18633
  name: external_exports.string().trim().min(1)
@@ -18675,7 +18670,6 @@ var init_project_resources = __esm({
18675
18670
  ProjectAppliedResourceSchema = external_exports.union([
18676
18671
  EnvironmentResourceSchema,
18677
18672
  IdentityResourceSchema,
18678
- ToolResourceSchema,
18679
18673
  SessionResourceSchema
18680
18674
  ]);
18681
18675
  ProjectApplyDiagnosticSchema = external_exports.object({
@@ -18687,7 +18681,6 @@ var init_project_resources = __esm({
18687
18681
  kind: external_exports.enum([
18688
18682
  RESOURCE_KIND_ENVIRONMENT,
18689
18683
  RESOURCE_KIND_IDENTITY,
18690
- RESOURCE_KIND_TOOL,
18691
18684
  RESOURCE_KIND_SESSION
18692
18685
  ]),
18693
18686
  name: external_exports.string().min(1)
@@ -18700,24 +18693,14 @@ var init_project_resources = __esm({
18700
18693
  plan: external_exports.array(
18701
18694
  external_exports.object({
18702
18695
  action: external_exports.enum(["create", "update", "unchanged", "archive"]),
18703
- kind: external_exports.enum([
18704
- RESOURCE_KIND_ENVIRONMENT,
18705
- RESOURCE_KIND_IDENTITY,
18706
- RESOURCE_KIND_TOOL,
18707
- RESOURCE_KIND_SESSION
18708
- ]),
18696
+ kind: ProjectApplyResponseResourceKindSchema,
18709
18697
  name: external_exports.string().min(1),
18710
18698
  uid: external_exports.string().min(1).optional()
18711
18699
  })
18712
18700
  ).default([]),
18713
18701
  pruned: external_exports.array(
18714
18702
  external_exports.object({
18715
- kind: external_exports.enum([
18716
- RESOURCE_KIND_ENVIRONMENT,
18717
- RESOURCE_KIND_IDENTITY,
18718
- RESOURCE_KIND_TOOL,
18719
- RESOURCE_KIND_SESSION
18720
- ]),
18703
+ kind: ProjectApplyResponseResourceKindSchema,
18721
18704
  name: external_exports.string().min(1),
18722
18705
  uid: external_exports.string().min(1)
18723
18706
  })
@@ -21225,7 +21208,7 @@ var init_package = __esm({
21225
21208
  "package.json"() {
21226
21209
  package_default = {
21227
21210
  name: "@autohq/cli",
21228
- version: "0.1.130",
21211
+ version: "0.1.132",
21229
21212
  license: "SEE LICENSE IN README.md",
21230
21213
  publishConfig: {
21231
21214
  access: "public"
@@ -21569,7 +21552,7 @@ function readProjectApplyRequest(options) {
21569
21552
  }
21570
21553
  function appliedResourceKind(request, response, index) {
21571
21554
  const plannedResources = response.plan.filter(
21572
- (item) => item.action !== "archive"
21555
+ (item) => item.action !== "archive" && isProjectApplyResourceKind(item.kind)
21573
21556
  );
21574
21557
  const kind = plannedResources[index]?.kind ?? request.resources[index]?.kind;
21575
21558
  if (!kind) {
@@ -21579,31 +21562,20 @@ function appliedResourceKind(request, response, index) {
21579
21562
  }
21580
21563
  return kind;
21581
21564
  }
21565
+ function isProjectApplyResourceKind(kind) {
21566
+ return PROJECT_RESOURCE_APPLY_ORDER.includes(
21567
+ kind
21568
+ );
21569
+ }
21582
21570
  function mcpOAuthToolConnectionsFromApplyRequest(request) {
21583
- return request.resources.filter((resource) => resource.kind === RESOURCE_KIND_TOOL).flatMap((resource) => {
21584
- if (resource.spec.kind !== "mcp_remote" || resource.spec.auth.kind !== "mcp_oauth") {
21585
- return [];
21586
- }
21587
- return [
21588
- {
21589
- tool: resource.metadata.name,
21590
- connection: resource.spec.auth.connection
21591
- }
21592
- ];
21571
+ return request.resources.filter((resource) => resource.kind === RESOURCE_KIND_SESSION).flatMap((resource) => {
21572
+ return mcpOAuthToolConnectionsFromSessionTools(resource.spec.tools);
21593
21573
  });
21594
21574
  }
21595
21575
  function mcpOAuthToolConnectionsFromAppliedResources(resources) {
21596
- return resources.filter((item) => item.kind === RESOURCE_KIND_TOOL).flatMap((item) => {
21576
+ return resources.filter((item) => item.kind === RESOURCE_KIND_SESSION).flatMap((item) => {
21597
21577
  const resource = item.resource;
21598
- if (resource.spec.kind !== "mcp_remote" || resource.spec.auth.kind !== "mcp_oauth") {
21599
- return [];
21600
- }
21601
- return [
21602
- {
21603
- tool: resource.metadata.name,
21604
- connection: resource.spec.auth.connection
21605
- }
21606
- ];
21578
+ return mcpOAuthToolConnectionsFromSessionTools(resource.spec.tools);
21607
21579
  });
21608
21580
  }
21609
21581
  function applyFiles(root) {
@@ -21626,6 +21598,14 @@ function applyFiles(root) {
21626
21598
  }
21627
21599
  return files;
21628
21600
  }
21601
+ function mcpOAuthToolConnectionsFromSessionTools(tools) {
21602
+ return Object.entries(tools).flatMap(([alias, tool]) => {
21603
+ if (tool.kind !== "mcp_remote" || tool.disabled || tool.auth.kind !== "mcp_oauth") {
21604
+ return [];
21605
+ }
21606
+ return [{ tool: alias, connection: tool.auth.connection }];
21607
+ });
21608
+ }
21629
21609
  function readApplyDocumentFile(path2) {
21630
21610
  const source = readFileSync3(path2, "utf8");
21631
21611
  let documents;
@@ -21825,13 +21805,11 @@ var init_files = __esm({
21825
21805
  APPLY_DIRECTORIES = {
21826
21806
  environment: "environments",
21827
21807
  identity: "identities",
21828
- tool: "tools",
21829
21808
  session: "sessions"
21830
21809
  };
21831
21810
  APPLY_SCHEMAS = {
21832
21811
  environment: EnvironmentApplyRequestSchema,
21833
21812
  identity: IdentityApplyRequestSchema,
21834
- tool: ToolApplyRequestSchema,
21835
21813
  session: SessionApplyRequestSchema
21836
21814
  };
21837
21815
  ALLOWED_AVATAR_EXTENSIONS = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png"]);
@@ -22004,8 +21982,6 @@ async function listProjectResources2(client, kind, options) {
22004
21982
  return (await client.listEnvironments(options)).environments;
22005
21983
  case RESOURCE_KIND_IDENTITY:
22006
21984
  return (await client.listIdentities(options)).identities;
22007
- case RESOURCE_KIND_TOOL:
22008
- return (await client.listTools(options)).tools;
22009
21985
  case RESOURCE_KIND_SESSION:
22010
21986
  return (await client.listSessions(options)).sessions;
22011
21987
  }
@@ -22032,12 +22008,6 @@ var init_resources3 = __esm({
22032
22008
  label: "Environment",
22033
22009
  pluralLabel: "Environments"
22034
22010
  },
22035
- [RESOURCE_KIND_TOOL]: {
22036
- kind: RESOURCE_KIND_TOOL,
22037
- section: "tools",
22038
- label: "Tool",
22039
- pluralLabel: "Tools"
22040
- },
22041
22011
  [RESOURCE_KIND_IDENTITY]: {
22042
22012
  kind: RESOURCE_KIND_IDENTITY,
22043
22013
  section: "identities",
@@ -22054,8 +22024,7 @@ var init_resources3 = __esm({
22054
22024
  PROJECT_RESOURCE_TUI_ORDER = [
22055
22025
  RESOURCE_KIND_SESSION,
22056
22026
  RESOURCE_KIND_IDENTITY,
22057
- RESOURCE_KIND_ENVIRONMENT,
22058
- RESOURCE_KIND_TOOL
22027
+ RESOURCE_KIND_ENVIRONMENT
22059
22028
  ];
22060
22029
  PROJECT_RESOURCE_TUI_DEFINITIONS = PROJECT_RESOURCE_TUI_ORDER.map(
22061
22030
  (kind) => PROJECT_RESOURCE_TUI_DEFINITION_BY_KIND[kind]
@@ -24476,38 +24445,6 @@ function EnvironmentsView({
24476
24445
  }
24477
24446
  );
24478
24447
  }
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
24448
  function IdentitiesView({
24512
24449
  resources,
24513
24450
  selectedIndex,
@@ -24647,26 +24584,6 @@ function envValueKind(value) {
24647
24584
  }
24648
24585
  return "unknown";
24649
24586
  }
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
24587
  var COL_KIND, COL_DETAIL, COL_TARGET, COL_UPDATED, ROW_GAP_COUNT;
24671
24588
  var init_ResourceViews = __esm({
24672
24589
  "src/tui/ResourceViews.tsx"() {
@@ -24722,10 +24639,6 @@ function useIdentities(apiUrl) {
24722
24639
  const client = useApiClient();
24723
24640
  return useQuery(identitiesQueryOptions(client, apiUrl));
24724
24641
  }
24725
- function useTools(apiUrl) {
24726
- const client = useApiClient();
24727
- return useQuery(toolsQueryOptions(client, apiUrl));
24728
- }
24729
24642
  function useSessionRuns(sessionName, apiUrl, includeArchived = false) {
24730
24643
  const client = useApiClient();
24731
24644
  return useQuery(
@@ -25017,16 +24930,6 @@ function sessionsQueryOptions(client, apiUrl) {
25017
24930
  staleTime: Number.POSITIVE_INFINITY
25018
24931
  });
25019
24932
  }
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
24933
  function projectsQueryOptions(client, apiUrl) {
25031
24934
  return queryOptions({
25032
24935
  queryKey: queryKeys.projects(apiUrl),
@@ -25571,8 +25474,6 @@ function selectedNamedResourceForSection(input) {
25571
25474
  return input.selectedIdentity ?? null;
25572
25475
  case "sessions":
25573
25476
  return input.selectedSession ?? null;
25574
- case "tools":
25575
- return input.selectedTool ?? null;
25576
25477
  default:
25577
25478
  return null;
25578
25479
  }
@@ -25612,7 +25513,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25612
25513
  const [sessionIndex, setSessionIndex] = useState3(0);
25613
25514
  const [environmentIndex, setEnvironmentIndex] = useState3(0);
25614
25515
  const [identityIndex, setIdentityIndex] = useState3(0);
25615
- const [toolIndex, setToolIndex] = useState3(0);
25616
25516
  const [projectIndex, setProjectIndex] = useState3(0);
25617
25517
  const [serviceAccountIndex, setServiceAccountIndex] = useState3(0);
25618
25518
  const [runIndex, setRunIndex] = useState3(0);
@@ -25652,11 +25552,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25652
25552
  isLoading: isIdentitiesLoading,
25653
25553
  error: identitiesError
25654
25554
  } = useIdentities(apiUrl);
25655
- const {
25656
- data: tools = [],
25657
- isLoading: isToolsLoading,
25658
- error: toolsError
25659
- } = useTools(apiUrl);
25660
25555
  const {
25661
25556
  data: projects = [],
25662
25557
  isLoading: isProjectsLoading,
@@ -25745,14 +25640,12 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25745
25640
  const selectedSession = sessions[sessionIndex];
25746
25641
  const selectedEnvironment = environments[environmentIndex];
25747
25642
  const selectedIdentity = identities[identityIndex];
25748
- const selectedTool = tools[toolIndex];
25749
25643
  const selectedInspectableResource = useMemo3(() => {
25750
25644
  const selectedEditable = editableResourceForSelection({
25751
25645
  activeSection,
25752
25646
  selectedEnvironment,
25753
25647
  selectedIdentity,
25754
- selectedSession,
25755
- selectedTool
25648
+ selectedSession
25756
25649
  });
25757
25650
  if (!selectedEditable) {
25758
25651
  return null;
@@ -25776,37 +25669,18 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25776
25669
  name: selectedEditable.name,
25777
25670
  spec: selectedIdentity.spec
25778
25671
  } : null;
25779
- case "tools":
25780
- return selectedTool ? {
25781
- kind: selectedEditable.kind,
25782
- name: selectedEditable.name,
25783
- spec: selectedTool.spec
25784
- } : null;
25785
25672
  default:
25786
25673
  return null;
25787
25674
  }
25788
- }, [
25789
- activeSection,
25790
- selectedEnvironment,
25791
- selectedIdentity,
25792
- selectedSession,
25793
- selectedTool
25794
- ]);
25675
+ }, [activeSection, selectedEnvironment, selectedIdentity, selectedSession]);
25795
25676
  const selectedEditableResource = useMemo3(
25796
25677
  () => editableResourceForSelection({
25797
25678
  activeSection,
25798
25679
  selectedEnvironment,
25799
25680
  selectedIdentity,
25800
- selectedSession,
25801
- selectedTool
25681
+ selectedSession
25802
25682
  }),
25803
- [
25804
- activeSection,
25805
- selectedEnvironment,
25806
- selectedIdentity,
25807
- selectedSession,
25808
- selectedTool
25809
- ]
25683
+ [activeSection, selectedEnvironment, selectedIdentity, selectedSession]
25810
25684
  );
25811
25685
  const inspectPanelHeight = Math.max(1, termHeight - 12);
25812
25686
  const scopedSession = runScopeSessionName ? sessions.find((session) => session.metadata.name === runScopeSessionName) : void 0;
@@ -25849,22 +25723,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
25849
25723
  );
25850
25724
  if (index >= 0) setEnvironmentIndex(index);
25851
25725
  }, [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
25726
  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
25727
  const startRun = useCallback2(() => {
25870
25728
  if (!scopedSession || triggerRun.isPending) return;
@@ -26410,16 +26268,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
26410
26268
  return;
26411
26269
  }
26412
26270
  }
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
26271
  if (activeSection === "serviceAccounts") {
26424
26272
  if (input === "n") {
26425
26273
  createServiceAccount2.reset();
@@ -26700,10 +26548,9 @@ function HomeView({ apiUrl, notice, returnToSession }) {
26700
26548
  sectionTitle = `Service Accounts[${serviceAccounts.length}]`;
26701
26549
  break;
26702
26550
  case "environments":
26703
- case "identities":
26704
- case "tools": {
26551
+ case "identities": {
26705
26552
  const definition = PROJECT_RESOURCE_TUI_DEFINITIONS_BY_SECTION.get(activeSection);
26706
- const count = activeSection === "environments" ? environments.length : activeSection === "identities" ? identities.length : tools.length;
26553
+ const count = activeSection === "environments" ? environments.length : identities.length;
26707
26554
  sectionTitle = `${definition?.pluralLabel ?? activeSection}[${count}]`;
26708
26555
  break;
26709
26556
  }
@@ -26874,14 +26721,6 @@ function HomeView({ apiUrl, notice, returnToSession }) {
26874
26721
  selectedSession,
26875
26722
  error: environmentsError instanceof Error ? environmentsError.message : environmentsError ? String(environmentsError) : null
26876
26723
  }
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
26724
  ) : activeSection === "identities" ? isIdentitiesLoading ? /* @__PURE__ */ jsx14(Box13, { padding: 2, children: /* @__PURE__ */ jsx14(Spinner, { label: "loading identities\u2026" }) }) : /* @__PURE__ */ jsx14(
26886
26725
  IdentitiesView,
26887
26726
  {
@@ -26993,7 +26832,7 @@ function HomeView({ apiUrl, notice, returnToSession }) {
26993
26832
  /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: ` ${inspectedResource.name} ` }),
26994
26833
  /* @__PURE__ */ jsx14(Text14, { dimColor: true, children: "\u203A" }),
26995
26834
  /* @__PURE__ */ jsx14(Text14, { backgroundColor: "cyan", color: "black", children: " inspect " })
26996
- ] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "identities" || activeSection === "tools" || activeSection === "serviceAccounts" || activeSection === "connections") && /* @__PURE__ */ jsx14(
26835
+ ] }) : (activeSection === "projects" || activeSection === "environments" || activeSection === "identities" || activeSection === "serviceAccounts" || activeSection === "connections") && /* @__PURE__ */ jsx14(
26997
26836
  Text14,
26998
26837
  {
26999
26838
  backgroundColor: "cyan",
@@ -27234,10 +27073,9 @@ var init_HomeView = __esm({
27234
27073
  { k: "2", label: "Runs", activeSection: "runs" },
27235
27074
  resourceNavItem({ k: "3", section: "environments" }),
27236
27075
  resourceNavItem({ k: "4", section: "identities" }),
27237
- resourceNavItem({ k: "5", section: "tools" }),
27238
- { k: "6", label: "Projects", activeSection: "projects" },
27239
- { k: "7", label: "Service Accounts", activeSection: "serviceAccounts" },
27240
- { k: "8", label: "Connections", activeSection: "connections" }
27076
+ { k: "5", label: "Projects", activeSection: "projects" },
27077
+ { k: "6", label: "Service Accounts", activeSection: "serviceAccounts" },
27078
+ { k: "7", label: "Connections", activeSection: "connections" }
27241
27079
  ];
27242
27080
  RESOURCES_PER_COLUMN = 4;
27243
27081
  }
@@ -27501,13 +27339,6 @@ var init_launcher = __esm({
27501
27339
  queryKey: queryKeys.environments,
27502
27340
  sort: sortByResourceName
27503
27341
  },
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
27342
  [RESOURCE_KIND_IDENTITY]: {
27512
27343
  async list({ apiClient, apiUrl }) {
27513
27344
  return (await apiClient.listIdentities({ apiBaseUrl: apiUrl })).identities;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autohq/cli",
3
- "version": "0.1.130",
3
+ "version": "0.1.132",
4
4
  "license": "SEE LICENSE IN README.md",
5
5
  "publishConfig": {
6
6
  "access": "public"