@alva-ai/toolkit 0.38.0-beta.1 → 0.38.0-beta.2
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/README.md +4 -1
- package/dist/browser.global.js +30 -30
- package/dist/browser.global.js.map +1 -1
- package/dist/cli.d.ts +5 -1
- package/dist/cli.js +77 -22
- package/dist/cli.js.map +1 -1
- package/dist/dispatch.d.ts +5 -1
- package/dist/dispatch.js +33 -21
- package/dist/dispatch.js.map +1 -1
- package/dist/index.cjs +17 -14
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -2
- package/dist/index.d.ts +6 -2
- package/dist/index.js +17 -14
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1365,6 +1365,20 @@ function graphQLErrorMessage(errors) {
|
|
|
1365
1365
|
return messages.length > 0 ? messages.join("; ") : "GraphQL request failed";
|
|
1366
1366
|
}
|
|
1367
1367
|
|
|
1368
|
+
// src/resources/webOrigin.ts
|
|
1369
|
+
function webOriginFromApiBase(apiBaseUrl) {
|
|
1370
|
+
try {
|
|
1371
|
+
const host = new URL(apiBaseUrl).hostname;
|
|
1372
|
+
const match = /^api-llm\.([a-z0-9-]+)\.alva\.ai$/i.exec(host);
|
|
1373
|
+
if (match) {
|
|
1374
|
+
const env = match[1].toLowerCase();
|
|
1375
|
+
return env === "prd" ? "https://alva.ai" : `https://${env}.alva.ai`;
|
|
1376
|
+
}
|
|
1377
|
+
} catch {
|
|
1378
|
+
}
|
|
1379
|
+
return "https://alva.ai";
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1368
1382
|
// src/resources/playbooks.ts
|
|
1369
1383
|
var PLAYBOOK_VISIBILITIES = [
|
|
1370
1384
|
"public",
|
|
@@ -1515,18 +1529,6 @@ var PlaybooksResource = class {
|
|
|
1515
1529
|
);
|
|
1516
1530
|
}
|
|
1517
1531
|
};
|
|
1518
|
-
function webOriginFromApiBase(apiBaseUrl) {
|
|
1519
|
-
try {
|
|
1520
|
-
const host = new URL(apiBaseUrl).hostname;
|
|
1521
|
-
const match = /^api-llm\.([a-z0-9-]+)\.alva\.ai$/i.exec(host);
|
|
1522
|
-
if (match) {
|
|
1523
|
-
const env = match[1].toLowerCase();
|
|
1524
|
-
return env === "prd" ? "https://alva.ai" : `https://${env}.alva.ai`;
|
|
1525
|
-
}
|
|
1526
|
-
} catch {
|
|
1527
|
-
}
|
|
1528
|
-
return "https://alva.ai";
|
|
1529
|
-
}
|
|
1530
1532
|
function toAgentPlaybook(raw, webOrigin) {
|
|
1531
1533
|
const username = raw.creator?.name ?? "";
|
|
1532
1534
|
const name = raw.name ?? "";
|
|
@@ -3340,7 +3342,8 @@ var ThesesResource = class {
|
|
|
3340
3342
|
await this.client._request("POST", "/api/v1/theses", { body })
|
|
3341
3343
|
);
|
|
3342
3344
|
requireKeptWeights(body.entity_stances, response.thesis.entity_stances);
|
|
3343
|
-
|
|
3345
|
+
const webOrigin = webOriginFromApiBase(this.client.baseUrl);
|
|
3346
|
+
return { ...response, url: `${webOrigin}/thesis/${response.thesis.id}` };
|
|
3344
3347
|
}
|
|
3345
3348
|
async get(id) {
|
|
3346
3349
|
this.client._requireAuth();
|
|
@@ -7471,7 +7474,7 @@ var installPlaybookRuntime = (targetWindow) => {
|
|
|
7471
7474
|
};
|
|
7472
7475
|
|
|
7473
7476
|
// src/index.ts
|
|
7474
|
-
var VERSION = true ? "0.38.0-beta.
|
|
7477
|
+
var VERSION = true ? "0.38.0-beta.2" : "dev";
|
|
7475
7478
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7476
7479
|
0 && (module.exports = {
|
|
7477
7480
|
AlertsResource,
|