@autohq/cli 0.1.135 → 0.1.136
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 +22 -5
- package/dist/index.js +46 -13
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -19793,7 +19793,8 @@ var SERVICE_ACCOUNT_READ_ONLY_SCOPES = [
|
|
|
19793
19793
|
"environments:read",
|
|
19794
19794
|
"tools:read",
|
|
19795
19795
|
"sessions:read",
|
|
19796
|
-
"runs:read"
|
|
19796
|
+
"runs:read",
|
|
19797
|
+
"provider_grants:read"
|
|
19797
19798
|
];
|
|
19798
19799
|
var SERVICE_ACCOUNT_SCOPE_PRESETS = {
|
|
19799
19800
|
"read-only": SERVICE_ACCOUNT_READ_ONLY_SCOPES,
|
|
@@ -19801,7 +19802,8 @@ var SERVICE_ACCOUNT_SCOPE_PRESETS = {
|
|
|
19801
19802
|
...SERVICE_ACCOUNT_READ_ONLY_SCOPES,
|
|
19802
19803
|
"environments:write",
|
|
19803
19804
|
"tools:write",
|
|
19804
|
-
"sessions:write"
|
|
19805
|
+
"sessions:write",
|
|
19806
|
+
"provider_grants:use"
|
|
19805
19807
|
]
|
|
19806
19808
|
};
|
|
19807
19809
|
var ServiceAccountScopePresetSchema = external_exports.enum(["read-only", "applier"]);
|
|
@@ -20623,11 +20625,18 @@ function resourceApplyDocumentSchema(kind, spec) {
|
|
|
20623
20625
|
}
|
|
20624
20626
|
|
|
20625
20627
|
// ../../packages/schemas/src/connections.ts
|
|
20628
|
+
var RESOURCE_KIND_CONNECTION = "connection";
|
|
20626
20629
|
var ConnectionNameSchema = ResourceNameSchema;
|
|
20627
20630
|
var ProviderConnectionReferenceSchema = external_exports.object({
|
|
20628
20631
|
provider: ProviderNameSchema,
|
|
20629
20632
|
connection: ConnectionNameSchema
|
|
20630
20633
|
});
|
|
20634
|
+
var ProjectConnectionAllocationSpecSchema = external_exports.object({
|
|
20635
|
+
provider: ProviderNameSchema
|
|
20636
|
+
});
|
|
20637
|
+
var ProjectConnectionAllocationResourceSchema = resourceEnvelopeSchema(
|
|
20638
|
+
ProjectConnectionAllocationSpecSchema
|
|
20639
|
+
);
|
|
20631
20640
|
var GithubConnectionAccountSchema = external_exports.object({
|
|
20632
20641
|
login: external_exports.string().trim().min(1),
|
|
20633
20642
|
type: external_exports.enum(["User", "Organization"])
|
|
@@ -21909,18 +21918,24 @@ var ProjectApplyResourceSchema = external_exports.preprocess(
|
|
|
21909
21918
|
])
|
|
21910
21919
|
);
|
|
21911
21920
|
var PROJECT_RESOURCE_APPLY_ORDER = [
|
|
21912
|
-
|
|
21921
|
+
RESOURCE_KIND_CONNECTION,
|
|
21913
21922
|
RESOURCE_KIND_IDENTITY,
|
|
21923
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
21914
21924
|
RESOURCE_KIND_SESSION
|
|
21915
21925
|
];
|
|
21916
21926
|
var PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
|
|
21927
|
+
var PROJECT_APPLY_RESOURCE_KINDS = [
|
|
21928
|
+
RESOURCE_KIND_IDENTITY,
|
|
21929
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
21930
|
+
RESOURCE_KIND_SESSION
|
|
21931
|
+
];
|
|
21917
21932
|
var ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
21918
21933
|
name: external_exports.string().trim().min(1)
|
|
21919
21934
|
});
|
|
21920
21935
|
var ProjectDeleteResourceSchema = external_exports.preprocess(
|
|
21921
21936
|
normalizeLegacySessionKind,
|
|
21922
21937
|
ProjectDeleteResourceBaseSchema.extend({
|
|
21923
|
-
kind: external_exports.enum(
|
|
21938
|
+
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
21924
21939
|
})
|
|
21925
21940
|
);
|
|
21926
21941
|
var AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
@@ -21959,6 +21974,7 @@ var ProjectApplySystemConfigSchema = external_exports.object({
|
|
|
21959
21974
|
spec: ProjectApplyRequestSchema
|
|
21960
21975
|
});
|
|
21961
21976
|
var ProjectAppliedResourceSchema = external_exports.union([
|
|
21977
|
+
ProjectConnectionAllocationResourceSchema,
|
|
21962
21978
|
EnvironmentResourceSchema,
|
|
21963
21979
|
IdentityResourceSchema,
|
|
21964
21980
|
SessionResourceSchema
|
|
@@ -21970,6 +21986,7 @@ var ProjectApplyDiagnosticSchema = external_exports.object({
|
|
|
21970
21986
|
message: external_exports.string().min(1),
|
|
21971
21987
|
action: external_exports.enum(["create", "update", "unchanged"]),
|
|
21972
21988
|
kind: external_exports.enum([
|
|
21989
|
+
RESOURCE_KIND_CONNECTION,
|
|
21973
21990
|
RESOURCE_KIND_ENVIRONMENT,
|
|
21974
21991
|
RESOURCE_KIND_IDENTITY,
|
|
21975
21992
|
RESOURCE_KIND_SESSION
|
|
@@ -26273,7 +26290,7 @@ Object.assign(lookup, {
|
|
|
26273
26290
|
// package.json
|
|
26274
26291
|
var package_default = {
|
|
26275
26292
|
name: "@autohq/cli",
|
|
26276
|
-
version: "0.1.
|
|
26293
|
+
version: "0.1.136",
|
|
26277
26294
|
license: "SEE LICENSE IN README.md",
|
|
26278
26295
|
publishConfig: {
|
|
26279
26296
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -16191,7 +16191,8 @@ var init_auth = __esm({
|
|
|
16191
16191
|
"environments:read",
|
|
16192
16192
|
"tools:read",
|
|
16193
16193
|
"sessions:read",
|
|
16194
|
-
"runs:read"
|
|
16194
|
+
"runs:read",
|
|
16195
|
+
"provider_grants:read"
|
|
16195
16196
|
];
|
|
16196
16197
|
SERVICE_ACCOUNT_SCOPE_PRESETS = {
|
|
16197
16198
|
"read-only": SERVICE_ACCOUNT_READ_ONLY_SCOPES,
|
|
@@ -16199,7 +16200,8 @@ var init_auth = __esm({
|
|
|
16199
16200
|
...SERVICE_ACCOUNT_READ_ONLY_SCOPES,
|
|
16200
16201
|
"environments:write",
|
|
16201
16202
|
"tools:write",
|
|
16202
|
-
"sessions:write"
|
|
16203
|
+
"sessions:write",
|
|
16204
|
+
"provider_grants:use"
|
|
16203
16205
|
]
|
|
16204
16206
|
};
|
|
16205
16207
|
ServiceAccountScopePresetSchema = external_exports.enum(["read-only", "applier"]);
|
|
@@ -17159,7 +17161,7 @@ var init_resources = __esm({
|
|
|
17159
17161
|
});
|
|
17160
17162
|
|
|
17161
17163
|
// ../../packages/schemas/src/connections.ts
|
|
17162
|
-
var ConnectionNameSchema, ProviderConnectionReferenceSchema, GithubConnectionAccountSchema, GithubConnectionRepositorySchema, GITHUB_CONNECTION_EVENTS, GithubConnectionEventSchema, GithubConnectionSpecSchema, ConnectionSpecSchema, ConnectionResourceSchema, ConnectionApplyRequestSchema, ConnectionStartRequestSchema, ConnectionProviderDescriptorSchema, ConnectionProviderListResponseSchema, ConnectionStartResponseSchema, TelegramConnectionCreateRequestSchema, TelegramManagerBotSummarySchema, TelegramConnectionCreateResponseSchema, ConnectionAllowRequestSchema, SlackConfigTokenRegisterRequestSchema, SlackConfigTokenRegisterResponseSchema, ConnectionAllowResponseSchema, ConnectionRemoveRequestSchema, ConnectionRemoveResponseSchema;
|
|
17164
|
+
var RESOURCE_KIND_CONNECTION, ConnectionNameSchema, ProviderConnectionReferenceSchema, ProjectConnectionAllocationSpecSchema, ProjectConnectionAllocationResourceSchema, GithubConnectionAccountSchema, GithubConnectionRepositorySchema, GITHUB_CONNECTION_EVENTS, GithubConnectionEventSchema, GithubConnectionSpecSchema, ConnectionSpecSchema, ConnectionResourceSchema, ConnectionApplyRequestSchema, ConnectionStartRequestSchema, ConnectionProviderDescriptorSchema, ConnectionProviderListResponseSchema, ConnectionStartResponseSchema, TelegramConnectionCreateRequestSchema, TelegramManagerBotSummarySchema, TelegramConnectionCreateResponseSchema, ConnectionAllowRequestSchema, SlackConfigTokenRegisterRequestSchema, SlackConfigTokenRegisterResponseSchema, ConnectionAllowResponseSchema, ConnectionRemoveRequestSchema, ConnectionRemoveResponseSchema;
|
|
17163
17165
|
var init_connections = __esm({
|
|
17164
17166
|
"../../packages/schemas/src/connections.ts"() {
|
|
17165
17167
|
"use strict";
|
|
@@ -17167,11 +17169,18 @@ var init_connections = __esm({
|
|
|
17167
17169
|
init_ids();
|
|
17168
17170
|
init_provider_grants();
|
|
17169
17171
|
init_resources();
|
|
17172
|
+
RESOURCE_KIND_CONNECTION = "connection";
|
|
17170
17173
|
ConnectionNameSchema = ResourceNameSchema;
|
|
17171
17174
|
ProviderConnectionReferenceSchema = external_exports.object({
|
|
17172
17175
|
provider: ProviderNameSchema,
|
|
17173
17176
|
connection: ConnectionNameSchema
|
|
17174
17177
|
});
|
|
17178
|
+
ProjectConnectionAllocationSpecSchema = external_exports.object({
|
|
17179
|
+
provider: ProviderNameSchema
|
|
17180
|
+
});
|
|
17181
|
+
ProjectConnectionAllocationResourceSchema = resourceEnvelopeSchema(
|
|
17182
|
+
ProjectConnectionAllocationSpecSchema
|
|
17183
|
+
);
|
|
17175
17184
|
GithubConnectionAccountSchema = external_exports.object({
|
|
17176
17185
|
login: external_exports.string().trim().min(1),
|
|
17177
17186
|
type: external_exports.enum(["User", "Organization"])
|
|
@@ -18595,11 +18604,12 @@ function normalizeLegacySessionKind(value) {
|
|
|
18595
18604
|
function isRecord(value) {
|
|
18596
18605
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
18597
18606
|
}
|
|
18598
|
-
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseResourceKindSchema, ProjectApplyResponseSchema;
|
|
18607
|
+
var EnvironmentApplyDocumentSchema, IdentityApplyDocumentSchema, SessionApplyDocumentSchema, ProjectApplyResourceSchema, PROJECT_RESOURCE_APPLY_ORDER, PROJECT_RESOURCE_KINDS, PROJECT_APPLY_RESOURCE_KINDS, ProjectDeleteResourceBaseSchema, ProjectDeleteResourceSchema, AVATAR_ASSET_CONTENT_TYPES, MAX_AVATAR_ASSET_BASE64_LENGTH, ProjectApplyAssetSchema, ProjectApplyAssetsSchema, AvatarAssetUploadRequestSchema, AvatarAssetUploadResponseSchema, ProjectApplyRequestSchema, ProjectApplySystemConfigSchema, ProjectAppliedResourceSchema, ProjectApplyDiagnosticSchema, ProjectApplyResponseResourceKindSchema, ProjectApplyResponseSchema;
|
|
18599
18608
|
var init_project_resources = __esm({
|
|
18600
18609
|
"../../packages/schemas/src/project-resources.ts"() {
|
|
18601
18610
|
"use strict";
|
|
18602
18611
|
init_zod();
|
|
18612
|
+
init_connections();
|
|
18603
18613
|
init_environments();
|
|
18604
18614
|
init_identities();
|
|
18605
18615
|
init_resources();
|
|
@@ -18625,18 +18635,24 @@ var init_project_resources = __esm({
|
|
|
18625
18635
|
])
|
|
18626
18636
|
);
|
|
18627
18637
|
PROJECT_RESOURCE_APPLY_ORDER = [
|
|
18628
|
-
|
|
18638
|
+
RESOURCE_KIND_CONNECTION,
|
|
18629
18639
|
RESOURCE_KIND_IDENTITY,
|
|
18640
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
18630
18641
|
RESOURCE_KIND_SESSION
|
|
18631
18642
|
];
|
|
18632
18643
|
PROJECT_RESOURCE_KINDS = PROJECT_RESOURCE_APPLY_ORDER;
|
|
18644
|
+
PROJECT_APPLY_RESOURCE_KINDS = [
|
|
18645
|
+
RESOURCE_KIND_IDENTITY,
|
|
18646
|
+
RESOURCE_KIND_ENVIRONMENT,
|
|
18647
|
+
RESOURCE_KIND_SESSION
|
|
18648
|
+
];
|
|
18633
18649
|
ProjectDeleteResourceBaseSchema = external_exports.object({
|
|
18634
18650
|
name: external_exports.string().trim().min(1)
|
|
18635
18651
|
});
|
|
18636
18652
|
ProjectDeleteResourceSchema = external_exports.preprocess(
|
|
18637
18653
|
normalizeLegacySessionKind,
|
|
18638
18654
|
ProjectDeleteResourceBaseSchema.extend({
|
|
18639
|
-
kind: external_exports.enum(
|
|
18655
|
+
kind: external_exports.enum(PROJECT_APPLY_RESOURCE_KINDS)
|
|
18640
18656
|
})
|
|
18641
18657
|
);
|
|
18642
18658
|
AVATAR_ASSET_CONTENT_TYPES = ["image/png", "image/jpeg"];
|
|
@@ -18675,6 +18691,7 @@ var init_project_resources = __esm({
|
|
|
18675
18691
|
spec: ProjectApplyRequestSchema
|
|
18676
18692
|
});
|
|
18677
18693
|
ProjectAppliedResourceSchema = external_exports.union([
|
|
18694
|
+
ProjectConnectionAllocationResourceSchema,
|
|
18678
18695
|
EnvironmentResourceSchema,
|
|
18679
18696
|
IdentityResourceSchema,
|
|
18680
18697
|
SessionResourceSchema
|
|
@@ -18686,6 +18703,7 @@ var init_project_resources = __esm({
|
|
|
18686
18703
|
message: external_exports.string().min(1),
|
|
18687
18704
|
action: external_exports.enum(["create", "update", "unchanged"]),
|
|
18688
18705
|
kind: external_exports.enum([
|
|
18706
|
+
RESOURCE_KIND_CONNECTION,
|
|
18689
18707
|
RESOURCE_KIND_ENVIRONMENT,
|
|
18690
18708
|
RESOURCE_KIND_IDENTITY,
|
|
18691
18709
|
RESOURCE_KIND_SESSION
|
|
@@ -21208,7 +21226,7 @@ var init_package = __esm({
|
|
|
21208
21226
|
"package.json"() {
|
|
21209
21227
|
package_default = {
|
|
21210
21228
|
name: "@autohq/cli",
|
|
21211
|
-
version: "0.1.
|
|
21229
|
+
version: "0.1.136",
|
|
21212
21230
|
license: "SEE LICENSE IN README.md",
|
|
21213
21231
|
publishConfig: {
|
|
21214
21232
|
access: "public"
|
|
@@ -21878,7 +21896,7 @@ function mcpOAuthSessionToolConnectionsFromAppliedResources(resources) {
|
|
|
21878
21896
|
}
|
|
21879
21897
|
function applyFiles(root) {
|
|
21880
21898
|
const files = [];
|
|
21881
|
-
for (const kind of
|
|
21899
|
+
for (const kind of PROJECT_APPLY_RESOURCE_KINDS) {
|
|
21882
21900
|
const kindFiles = [];
|
|
21883
21901
|
for (const directory of applyDirectories(kind)) {
|
|
21884
21902
|
const path2 = join4(root, directory);
|
|
@@ -22087,9 +22105,11 @@ function applyCandidate(document) {
|
|
|
22087
22105
|
}
|
|
22088
22106
|
};
|
|
22089
22107
|
}
|
|
22090
|
-
if (!
|
|
22108
|
+
if (!PROJECT_APPLY_RESOURCE_KINDS.includes(
|
|
22109
|
+
document.kind
|
|
22110
|
+
)) {
|
|
22091
22111
|
throw new Error(
|
|
22092
|
-
`Unsupported apply resource kind "${String(document.kind)}"; supported kinds are ${
|
|
22112
|
+
`Unsupported apply resource kind "${String(document.kind)}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((kind2) => `"${kind2}"`).join(", ")} (legacy alias "session" is also accepted)`
|
|
22093
22113
|
);
|
|
22094
22114
|
}
|
|
22095
22115
|
const kind = document.kind;
|
|
@@ -22436,15 +22456,20 @@ function parseProjectResourceReference(resource) {
|
|
|
22436
22456
|
if (!kind || !name || extra) {
|
|
22437
22457
|
throw new Error('Resource must be formatted as "kind/name"');
|
|
22438
22458
|
}
|
|
22439
|
-
if (!
|
|
22459
|
+
if (!PROJECT_APPLY_RESOURCE_KINDS.includes(
|
|
22460
|
+
kind
|
|
22461
|
+
)) {
|
|
22440
22462
|
if (kind === LEGACY_RESOURCE_KIND_SESSION) {
|
|
22441
22463
|
return { kind: RESOURCE_KIND_SESSION, name };
|
|
22442
22464
|
}
|
|
22443
22465
|
throw new Error(
|
|
22444
|
-
`Unsupported resource kind "${kind}"; supported kinds are ${
|
|
22466
|
+
`Unsupported resource kind "${kind}"; supported kinds are ${PROJECT_APPLY_RESOURCE_KINDS.map((value) => `"${value}"`).join(", ")} (legacy alias "session" is also accepted)`
|
|
22445
22467
|
);
|
|
22446
22468
|
}
|
|
22447
|
-
return {
|
|
22469
|
+
return {
|
|
22470
|
+
kind,
|
|
22471
|
+
name
|
|
22472
|
+
};
|
|
22448
22473
|
}
|
|
22449
22474
|
async function listProjectResources2(client, kind, options) {
|
|
22450
22475
|
switch (kind) {
|
|
@@ -22454,6 +22479,8 @@ async function listProjectResources2(client, kind, options) {
|
|
|
22454
22479
|
return (await client.listIdentities(options)).identities;
|
|
22455
22480
|
case RESOURCE_KIND_SESSION:
|
|
22456
22481
|
return (await client.listSessions(options)).sessions;
|
|
22482
|
+
default:
|
|
22483
|
+
throw new Error(`Resource kind "${kind}" cannot be listed directly.`);
|
|
22457
22484
|
}
|
|
22458
22485
|
}
|
|
22459
22486
|
async function requireProjectResource(client, reference, options) {
|
|
@@ -27828,6 +27855,9 @@ async function launch(opts) {
|
|
|
27828
27855
|
}
|
|
27829
27856
|
}
|
|
27830
27857
|
async function refreshEditedResource(input) {
|
|
27858
|
+
if (!isRefreshableResourceKind(input.kind)) {
|
|
27859
|
+
return;
|
|
27860
|
+
}
|
|
27831
27861
|
const definition = RESOURCE_REFRESH_DEFINITIONS[input.kind];
|
|
27832
27862
|
input.queryClient.setQueryData(
|
|
27833
27863
|
definition.queryKey(input.apiUrl),
|
|
@@ -27842,6 +27872,9 @@ function sortByResourceName(resources) {
|
|
|
27842
27872
|
function isEditSelection(selection) {
|
|
27843
27873
|
return "action" in selection && selection.action === "editResource";
|
|
27844
27874
|
}
|
|
27875
|
+
function isRefreshableResourceKind(kind) {
|
|
27876
|
+
return kind in RESOURCE_REFRESH_DEFINITIONS;
|
|
27877
|
+
}
|
|
27845
27878
|
var RESOURCE_REFRESH_DEFINITIONS;
|
|
27846
27879
|
var init_launcher = __esm({
|
|
27847
27880
|
"src/tui/launcher.ts"() {
|