@autohq/cli 0.1.150 → 0.1.152
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 +1 -1
- package/dist/index.js +29 -3
- package/package.json +1 -1
package/dist/agent-bridge.js
CHANGED
|
@@ -26296,7 +26296,7 @@ Object.assign(lookup, {
|
|
|
26296
26296
|
// package.json
|
|
26297
26297
|
var package_default = {
|
|
26298
26298
|
name: "@autohq/cli",
|
|
26299
|
-
version: "0.1.
|
|
26299
|
+
version: "0.1.152",
|
|
26300
26300
|
license: "SEE LICENSE IN README.md",
|
|
26301
26301
|
publishConfig: {
|
|
26302
26302
|
access: "public"
|
package/dist/index.js
CHANGED
|
@@ -21306,7 +21306,7 @@ var init_package = __esm({
|
|
|
21306
21306
|
"package.json"() {
|
|
21307
21307
|
package_default = {
|
|
21308
21308
|
name: "@autohq/cli",
|
|
21309
|
-
version: "0.1.
|
|
21309
|
+
version: "0.1.152",
|
|
21310
21310
|
license: "SEE LICENSE IN README.md",
|
|
21311
21311
|
publishConfig: {
|
|
21312
21312
|
access: "public"
|
|
@@ -23016,7 +23016,7 @@ function appliedResourceKind(request, response, index) {
|
|
|
23016
23016
|
const kind = plannedResources[index]?.kind ?? request.resources[index]?.kind;
|
|
23017
23017
|
if (!kind) {
|
|
23018
23018
|
throw new Error(
|
|
23019
|
-
|
|
23019
|
+
applyResourceKindError(request, response, plannedResources, index)
|
|
23020
23020
|
);
|
|
23021
23021
|
}
|
|
23022
23022
|
return kind;
|
|
@@ -23039,7 +23039,32 @@ function mcpOAuthAgentToolConnectionsFromAppliedResources(resources) {
|
|
|
23039
23039
|
});
|
|
23040
23040
|
}
|
|
23041
23041
|
function isProjectApplyResourceKind(kind) {
|
|
23042
|
-
return kind === RESOURCE_KIND_IDENTITY || kind === RESOURCE_KIND_ENVIRONMENT || kind === RESOURCE_KIND_AGENT;
|
|
23042
|
+
return kind === RESOURCE_KIND_CONNECTION || kind === RESOURCE_KIND_IDENTITY || kind === RESOURCE_KIND_ENVIRONMENT || kind === RESOURCE_KIND_AGENT;
|
|
23043
|
+
}
|
|
23044
|
+
function applyResourceKindError(request, response, plannedResources, index) {
|
|
23045
|
+
const planLabels = plannedResources.map(
|
|
23046
|
+
(resource) => `${resource.kind}/${resource.name}`
|
|
23047
|
+
);
|
|
23048
|
+
const requestLabels = request.resources.map(resourceLabel);
|
|
23049
|
+
return [
|
|
23050
|
+
`Apply response did not include a resource kind for item ${index}.`,
|
|
23051
|
+
`Unable to infer from ${planLabels.length} non-archived plan item(s) or ${requestLabels.length} request resource(s).`,
|
|
23052
|
+
`Apply response contained ${response.resources.length} applied resource item(s).`,
|
|
23053
|
+
`Nearby plan items: ${nearbyLabels(planLabels, index)}.`,
|
|
23054
|
+
`Nearby request resources: ${nearbyLabels(requestLabels, index)}.`,
|
|
23055
|
+
"This usually means the server returned an applied resource that was not represented in the apply plan or original request."
|
|
23056
|
+
].join(" ");
|
|
23057
|
+
}
|
|
23058
|
+
function nearbyLabels(labels, index) {
|
|
23059
|
+
if (labels.length === 0) {
|
|
23060
|
+
return "none";
|
|
23061
|
+
}
|
|
23062
|
+
const start = Math.max(0, Math.min(index - 2, labels.length - 3));
|
|
23063
|
+
const end = Math.min(labels.length, index + 3);
|
|
23064
|
+
return labels.slice(start, end).map((label, offset) => `${start + offset} ${label}`).join(", ");
|
|
23065
|
+
}
|
|
23066
|
+
function resourceLabel(resource) {
|
|
23067
|
+
return `${resource.kind}/${resource.metadata.name}`;
|
|
23043
23068
|
}
|
|
23044
23069
|
function mcpOAuthAgentToolConnectionsFromAgentTools(input) {
|
|
23045
23070
|
return Object.entries(input.tools).flatMap(([alias, tool]) => {
|
|
@@ -23059,6 +23084,7 @@ var init_apply_result = __esm({
|
|
|
23059
23084
|
"../../packages/schemas/src/project-apply-files/apply-result.ts"() {
|
|
23060
23085
|
"use strict";
|
|
23061
23086
|
init_agents();
|
|
23087
|
+
init_connections();
|
|
23062
23088
|
init_environments();
|
|
23063
23089
|
init_identities();
|
|
23064
23090
|
}
|