@lasso-ai/cli 2.1.19 → 2.1.20
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/cli/auth.d.ts +7 -0
- package/dist/cli/auth.js +14 -0
- package/dist/cli/bridge.js +3 -3
- package/dist/overlay.js +1 -1
- package/package.json +1 -1
package/dist/cli/auth.d.ts
CHANGED
|
@@ -14,6 +14,13 @@ export interface CliCredentials {
|
|
|
14
14
|
* local development.
|
|
15
15
|
*/
|
|
16
16
|
export declare function serverUrlFrom(fileEnv: Record<string, string>): string;
|
|
17
|
+
/**
|
|
18
|
+
* URL for the standalone hosted agent runtime.
|
|
19
|
+
*
|
|
20
|
+
* Production has a dedicated AI hostname; local development still falls back
|
|
21
|
+
* to the local control-plane server unless an explicit runtime URL is set.
|
|
22
|
+
*/
|
|
23
|
+
export declare function agentRuntimeUrlFrom(fileEnv: Record<string, string>): string;
|
|
17
24
|
export declare function fetchWithTimeout(url: string, init?: RequestInit, timeoutMs?: number): Promise<Response>;
|
|
18
25
|
export declare function loadCredentials(): CliCredentials | null;
|
|
19
26
|
export declare function saveCredentials(credentials: CliCredentials): void;
|
package/dist/cli/auth.js
CHANGED
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.serverUrlFrom = serverUrlFrom;
|
|
7
|
+
exports.agentRuntimeUrlFrom = agentRuntimeUrlFrom;
|
|
7
8
|
exports.fetchWithTimeout = fetchWithTimeout;
|
|
8
9
|
exports.loadCredentials = loadCredentials;
|
|
9
10
|
exports.saveCredentials = saveCredentials;
|
|
@@ -28,6 +29,19 @@ const CREDENTIALS_FILE = node_path_1.default.join(CREDENTIALS_DIR, "credentials.
|
|
|
28
29
|
function serverUrlFrom(fileEnv) {
|
|
29
30
|
return (process.env.LASSO_AUTH_URL || fileEnv.LASSO_AUTH_URL || process.env.LASSO_API_URL || fileEnv.LASSO_API_URL || process.env.LASSO_SERVER_URL || fileEnv.LASSO_SERVER_URL || (process.env.NODE_ENV === "development" ? "http://localhost:3005" : "https://api.lasso.byorello.space")).replace(/\/$/, "");
|
|
30
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* URL for the standalone hosted agent runtime.
|
|
34
|
+
*
|
|
35
|
+
* Production has a dedicated AI hostname; local development still falls back
|
|
36
|
+
* to the local control-plane server unless an explicit runtime URL is set.
|
|
37
|
+
*/
|
|
38
|
+
function agentRuntimeUrlFrom(fileEnv) {
|
|
39
|
+
return (process.env.LASSO_AGENT_RUNTIME_URL ||
|
|
40
|
+
fileEnv.LASSO_AGENT_RUNTIME_URL ||
|
|
41
|
+
(process.env.NODE_ENV === "development"
|
|
42
|
+
? "http://localhost:3005"
|
|
43
|
+
: "https://api.ai.lasso.byorello.space")).replace(/\/$/, "");
|
|
44
|
+
}
|
|
31
45
|
function fetchWithTimeout(url, init, timeoutMs = 8000) {
|
|
32
46
|
const controller = new AbortController();
|
|
33
47
|
const timer = setTimeout(() => controller.abort(), timeoutMs);
|
package/dist/cli/bridge.js
CHANGED
|
@@ -220,7 +220,7 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
|
|
|
220
220
|
const resolvedLassoKey = cliCredentials?.apiKey || (0, project_1.resolveLassoApiKey)(fileEnv) || process.env.LASSO_API_KEY || fileEnv.LASSO_API_KEY || process.env.VITE_LASSO_API_KEY || process.env.NEXT_LASSO_API_KEY || fileEnv.VITE_LASSO_API_KEY || fileEnv.NEXT_LASSO_API_KEY || "";
|
|
221
221
|
const lassoKeyConfigured = Boolean(resolvedLassoKey);
|
|
222
222
|
const serverUrl = (0, auth_1.serverUrlFrom)(fileEnv) || "https://api.lasso.byorello.space";
|
|
223
|
-
const runtimeClient = new runtime_client_1.RuntimeClient(
|
|
223
|
+
const runtimeClient = new runtime_client_1.RuntimeClient((0, auth_1.agentRuntimeUrlFrom)(fileEnv), resolvedLassoKey || undefined);
|
|
224
224
|
// Load project info
|
|
225
225
|
const workspaceConfig = await (0, project_1.resolveWorkspaceConfig)(fileEnv);
|
|
226
226
|
const projectId = workspaceConfig?.workspaceId || "";
|
|
@@ -514,7 +514,7 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
|
|
|
514
514
|
requestController.abort();
|
|
515
515
|
}, 30_000);
|
|
516
516
|
try {
|
|
517
|
-
const response = await fetch(`${
|
|
517
|
+
const response = await fetch(`${(0, auth_1.agentRuntimeUrlFrom)(fileEnv)}/api/v1/agent/session`, {
|
|
518
518
|
method: "POST",
|
|
519
519
|
headers: {
|
|
520
520
|
Accept: "text/event-stream",
|
|
@@ -1164,7 +1164,7 @@ async function startBridge(cwd = process.cwd(), collabConfig = null, bridgePort
|
|
|
1164
1164
|
apiKeyConfigured: lassoKeyConfigured,
|
|
1165
1165
|
agentConfigured: lassoKeyConfigured,
|
|
1166
1166
|
models,
|
|
1167
|
-
collab: collabConfig?.registered ? { ...collabConfig, plan: collabConfig.plan, configuredProviders: collabConfig.configuredProviders } : null,
|
|
1167
|
+
collab: collabConfig?.registered ? { ...collabConfig, agentServerUrl: (0, auth_1.agentRuntimeUrlFrom)(fileEnv), plan: collabConfig.plan, configuredProviders: collabConfig.configuredProviders } : null,
|
|
1168
1168
|
user: userInfo,
|
|
1169
1169
|
}));
|
|
1170
1170
|
void getGitState(cwd).then((git) => {
|
package/dist/overlay.js
CHANGED
|
@@ -19605,7 +19605,7 @@
|
|
|
19605
19605
|
}
|
|
19606
19606
|
async function apiFetch(path, options = {}) {
|
|
19607
19607
|
try {
|
|
19608
|
-
const base = getApiBase();
|
|
19608
|
+
const base = path.startsWith("/agent/") && state.collab?.agentServerUrl ? `${state.collab.agentServerUrl.replace(/\/+$/, "")}/api/v1` : getApiBase();
|
|
19609
19609
|
const apiKey = state.collab?.apiKey || "";
|
|
19610
19610
|
const headers = {
|
|
19611
19611
|
"content-type": "application/json",
|
package/package.json
CHANGED