@meistrari/tela-cli 0.7.41 → 0.7.42
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/index.js +14 -37
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -274,7 +274,7 @@ var require_defaults = __commonJS({
|
|
|
274
274
|
services: {
|
|
275
275
|
pantry: "https://pantry-api.tela.tools",
|
|
276
276
|
workflow: "https://workflow-api.tela.tools",
|
|
277
|
-
agent: "https://agent-
|
|
277
|
+
agent: "https://agent-api-production-81c9.up.railway.app"
|
|
278
278
|
}
|
|
279
279
|
},
|
|
280
280
|
staging: {
|
|
@@ -366,6 +366,7 @@ var require_config = __commonJS({
|
|
|
366
366
|
var paths_1 = require_paths();
|
|
367
367
|
var LEGACY_STAGING_AUTH_API_URL = "https://auth.staging.tela.com";
|
|
368
368
|
var LEGACY_STAGING_DEFAULT_API_URL = "https://api.staging.tela.com";
|
|
369
|
+
var LEGACY_PRODUCTION_AGENT_GATEWAY_URL = "https://agent-gateway-api.tela.tools";
|
|
369
370
|
var CREDENTIAL_MATERIAL_KEYS = /* @__PURE__ */ new Set([
|
|
370
371
|
"accessToken",
|
|
371
372
|
"refreshToken",
|
|
@@ -523,6 +524,13 @@ var require_config = __commonJS({
|
|
|
523
524
|
};
|
|
524
525
|
}
|
|
525
526
|
function applyDefaultEnvironmentValues(id, currentEnvironment, defaultEnvironment) {
|
|
527
|
+
const services = {
|
|
528
|
+
...defaultEnvironment.services,
|
|
529
|
+
...currentEnvironment.services
|
|
530
|
+
};
|
|
531
|
+
if (id === "production" && services.agent === LEGACY_PRODUCTION_AGENT_GATEWAY_URL) {
|
|
532
|
+
services.agent = defaultEnvironment.services.agent;
|
|
533
|
+
}
|
|
526
534
|
return {
|
|
527
535
|
...currentEnvironment,
|
|
528
536
|
authApiUrl: id === "staging" && currentEnvironment.authApiUrl === LEGACY_STAGING_AUTH_API_URL ? defaultEnvironment.authApiUrl : currentEnvironment.authApiUrl,
|
|
@@ -530,10 +538,7 @@ var require_config = __commonJS({
|
|
|
530
538
|
// staging moved to the telastaging.com domain.
|
|
531
539
|
defaultApiUrl: id === "staging" && currentEnvironment.defaultApiUrl === LEGACY_STAGING_DEFAULT_API_URL ? defaultEnvironment.defaultApiUrl : currentEnvironment.defaultApiUrl,
|
|
532
540
|
authApplication: currentEnvironment.authApplication ?? defaultEnvironment.authApplication,
|
|
533
|
-
services
|
|
534
|
-
...defaultEnvironment.services,
|
|
535
|
-
...currentEnvironment.services
|
|
536
|
-
}
|
|
541
|
+
services
|
|
537
542
|
};
|
|
538
543
|
}
|
|
539
544
|
function assertNoCredentialMaterial(value) {
|
|
@@ -2186,7 +2191,6 @@ var require_config2 = __commonJS({
|
|
|
2186
2191
|
"use strict";
|
|
2187
2192
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
2188
2193
|
exports2.getDefaultAgentCloneRoot = getDefaultAgentCloneRoot;
|
|
2189
|
-
exports2.isDirectAgentApiUrl = isDirectAgentApiUrl;
|
|
2190
2194
|
exports2.resolveAgentConfig = resolveAgentConfig;
|
|
2191
2195
|
exports2.ensureConfigInteractive = ensureConfigInteractive;
|
|
2192
2196
|
var node_os_1 = require("node:os");
|
|
@@ -2194,23 +2198,10 @@ var require_config2 = __commonJS({
|
|
|
2194
2198
|
var tela_local_config_1 = require_dist();
|
|
2195
2199
|
var credentials_1 = require_credentials2();
|
|
2196
2200
|
var errors_1 = require_errors();
|
|
2197
|
-
var AGENT_GATEWAY_HOSTS = /* @__PURE__ */ new Set([
|
|
2198
|
-
"agent-gateway-api.tela.tools"
|
|
2199
|
-
]);
|
|
2200
2201
|
function getDefaultAgentCloneRoot(env = process.env) {
|
|
2201
2202
|
const configured = env.TELA_AGENT_CLONE_ROOT?.trim();
|
|
2202
2203
|
return configured ? (0, node_path_1.resolve)(configured.replace(/^~(?=$|\/)/, (0, node_os_1.homedir)())) : (0, node_path_1.join)((0, node_os_1.homedir)(), "tela-agents");
|
|
2203
2204
|
}
|
|
2204
|
-
function isDirectAgentApiUrl(value) {
|
|
2205
|
-
if (!value)
|
|
2206
|
-
return false;
|
|
2207
|
-
try {
|
|
2208
|
-
const url = new URL(value);
|
|
2209
|
-
return !AGENT_GATEWAY_HOSTS.has(url.hostname);
|
|
2210
|
-
} catch {
|
|
2211
|
-
return false;
|
|
2212
|
-
}
|
|
2213
|
-
}
|
|
2214
2205
|
async function resolveAgentConfig(options = {}) {
|
|
2215
2206
|
const env = options.env ?? process.env;
|
|
2216
2207
|
const localConfig = await (0, tela_local_config_1.loadConfig)();
|
|
@@ -2220,22 +2211,13 @@ var require_config2 = __commonJS({
|
|
|
2220
2211
|
workspace: options.workspace,
|
|
2221
2212
|
env
|
|
2222
2213
|
});
|
|
2223
|
-
|
|
2224
|
-
if (shouldRequireAgentService && !Object.prototype.hasOwnProperty.call(resolved.environment.services, "agent")) {
|
|
2214
|
+
if (options.requireAgentService !== false && !Object.prototype.hasOwnProperty.call(resolved.environment.services, "agent")) {
|
|
2225
2215
|
throw (0, errors_1.createUserFacingError)({
|
|
2226
2216
|
code: "agent_service_missing",
|
|
2227
2217
|
summary: `Context ${resolved.id} does not define an agent service URL.`,
|
|
2228
2218
|
fixes: ["Add services.agent to the selected Tela environment in Dock before running agent commands."]
|
|
2229
2219
|
});
|
|
2230
2220
|
}
|
|
2231
|
-
const configuredAgentServiceUrl = resolved.environment.services.agent;
|
|
2232
|
-
if (options.requireDirectAgentService === true && !isDirectAgentApiUrl(configuredAgentServiceUrl)) {
|
|
2233
|
-
throw (0, errors_1.createUserFacingError)({
|
|
2234
|
-
code: "agent_service_gateway_unsupported",
|
|
2235
|
-
summary: `Context ${resolved.id} points Agent API to an Agent Gateway URL, which cannot be used for tela agent setup.`,
|
|
2236
|
-
fixes: ["Connect an environment with a direct Agent API URL, such as Staging, before running agent setup."]
|
|
2237
|
-
});
|
|
2238
|
-
}
|
|
2239
2221
|
const credentials = options.credentials ?? (0, credentials_1.createAgentCredentialAdapter)(env);
|
|
2240
2222
|
const credential = await credentials.get(resolved.context.credentialRef);
|
|
2241
2223
|
if (!credential) {
|
|
@@ -5913,8 +5895,7 @@ var require_setup = __commonJS({
|
|
|
5913
5895
|
environmentId: options.environmentId,
|
|
5914
5896
|
workspace: options.workspace,
|
|
5915
5897
|
credentials: options.credentials,
|
|
5916
|
-
env: options.env
|
|
5917
|
-
requireDirectAgentService: true
|
|
5898
|
+
env: options.env
|
|
5918
5899
|
});
|
|
5919
5900
|
if (!config.contextId) {
|
|
5920
5901
|
throw new Error("Agent setup requires a resolved Tela context.");
|
|
@@ -6028,8 +6009,7 @@ var require_setup = __commonJS({
|
|
|
6028
6009
|
const config = await (0, config_1.resolveAgentConfig)({
|
|
6029
6010
|
contextId: input.contextId,
|
|
6030
6011
|
credentials,
|
|
6031
|
-
env: options.env
|
|
6032
|
-
requireDirectAgentService: true
|
|
6012
|
+
env: options.env
|
|
6033
6013
|
});
|
|
6034
6014
|
const organizations = await (0, agent_api_1.listOrganizations)(config, options.fetchFn);
|
|
6035
6015
|
const organization = organizations.find((item) => item.id === input.organizationId);
|
|
@@ -6965,7 +6945,7 @@ var require_dist2 = __commonJS({
|
|
|
6965
6945
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports3, p)) __createBinding(exports3, m, p);
|
|
6966
6946
|
};
|
|
6967
6947
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
6968
|
-
exports2.ensureConfigInteractive = exports2.resolveAgentConfig = exports2.
|
|
6948
|
+
exports2.ensureConfigInteractive = exports2.resolveAgentConfig = exports2.getDefaultAgentCloneRoot = void 0;
|
|
6969
6949
|
__exportStar(require_agent_api(), exports2);
|
|
6970
6950
|
__exportStar(require_auth2(), exports2);
|
|
6971
6951
|
__exportStar(require_claude(), exports2);
|
|
@@ -6978,9 +6958,6 @@ var require_dist2 = __commonJS({
|
|
|
6978
6958
|
Object.defineProperty(exports2, "getDefaultAgentCloneRoot", { enumerable: true, get: function() {
|
|
6979
6959
|
return config_1.getDefaultAgentCloneRoot;
|
|
6980
6960
|
} });
|
|
6981
|
-
Object.defineProperty(exports2, "isDirectAgentApiUrl", { enumerable: true, get: function() {
|
|
6982
|
-
return config_1.isDirectAgentApiUrl;
|
|
6983
|
-
} });
|
|
6984
6961
|
Object.defineProperty(exports2, "resolveAgentConfig", { enumerable: true, get: function() {
|
|
6985
6962
|
return config_1.resolveAgentConfig;
|
|
6986
6963
|
} });
|