Skip to content

abso-core

Public

abso is version control for agents: the client, the engine and a server you can run on your own Cloudflare account.

Check passed
MCP
code on this site's /mcp
CLI
none: the JSON below is the answer
JSON
/christopher/abso-core/files/client/test/env-names.test.ts?version=281&format=json
25 linesreview 100%Last change review in version 27, 1 version changed it

You're reading version 281. The newest is 318, and no version since then changed this file. Go to the newestCompare with 318

1import assert from "node:assert/strict";
2import { test } from "node:test";
3import { readToken, trustedServers } from "../src/config.ts";
4import { fromEnv, withOldNames } from "../src/env-names.ts";
5
6test("ABSO_ names win over AVCS_ ones, and the old ones still work", () => {
7 assert.equal(fromEnv({ ABSO_X: "new", AVCS_X: "old" }, "X"), "new");
8 assert.equal(fromEnv({ AVCS_X: "old" }, "X"), "old");
9 assert.equal(fromEnv({ ABSO_X: "", AVCS_X: "old" }, "X"), "old");
10 assert.equal(fromEnv({}, "X"), undefined);
11 assert.equal(readToken({ ABSO_TOKEN: " new ", AVCS_TOKEN: "old" }), "new");
12 assert.equal(readToken({ AVCS_TOKEN: "old" }), "old");
13 assert.match(
14 trustedServers({ ABSO_TRUSTED_SERVERS: "https://a.example", ABSO_SERVERS_FILE: "no-servers.json" }),
15 /a\.example/,
16 );
17});
19test("a program abso runs gets both the new and the old names", () => {
20 const out = withOldNames({ ABSO_AGENT: "a", ABSO_SPACE: "shared", OTHER: "x" });
21 assert.equal(out.AVCS_AGENT, "a");
22 assert.equal(out.AVCS_SPACE, "shared");
23 assert.equal(out.ABSO_AGENT, "a");
24 assert.equal(out.AVCS_OTHER, undefined);
25});