@keydris/cli 0.1.8 → 0.1.10
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 +7 -3
- package/config/dev.toml +19 -0
- package/config/stable.toml +19 -0
- package/package.json +10 -7
- package/scripts/install-config.mjs +54 -0
package/README.md
CHANGED
|
@@ -15,6 +15,10 @@ implementation remains in the native binary.
|
|
|
15
15
|
Do not install with `--omit=optional`; that omits the platform binary. A global
|
|
16
16
|
installation is recommended when using the long-running `keydris proxy`.
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`
|
|
18
|
+
The install writes the channel defaults to `~/.keydris.toml`, backing up an
|
|
19
|
+
existing file as `~/.keydris.toml.bak`. Stable releases use the stable config;
|
|
20
|
+
prereleases use the dev config. Set `KEYDRIS_NO_CONFIG=1` to leave an existing
|
|
21
|
+
config unchanged. npm's `--ignore-scripts` option skips this config step.
|
|
22
|
+
|
|
23
|
+
The package performs no privileged work during installation. Trust-store changes
|
|
24
|
+
happen only when explicitly requested through `keydris init --trust-store`.
|
package/config/dev.toml
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Keydris dev-channel defaults. npm prereleases install this to ~/.keydris.toml.
|
|
2
|
+
#
|
|
3
|
+
# Lowest-precedence config: override any value with an environment variable.
|
|
4
|
+
# Project-local .env/.keydris.toml files require KEYDRIS_TRUST_PROJECT_CONFIG=1.
|
|
5
|
+
# Each key maps to KEYDRIS_<UPPER(KEY)>.
|
|
6
|
+
|
|
7
|
+
[keydris]
|
|
8
|
+
# `keydris upgrade` reads this to stay on the channel this install came from.
|
|
9
|
+
channel = "dev"
|
|
10
|
+
|
|
11
|
+
control_url = "https://dev.api.keydris.com"
|
|
12
|
+
control_mtls_url = "https://dev.api.keydris.com:8443"
|
|
13
|
+
trust_domain = "keydris.local"
|
|
14
|
+
|
|
15
|
+
oidc_issuer = "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_Hjh0EehFH"
|
|
16
|
+
cognito_domain = "keydris-dev.auth.us-east-1.amazoncognito.com"
|
|
17
|
+
oauth_client_id = "791bq13e9aijdu8cspi851mv5u"
|
|
18
|
+
oauth_scopes = "openid email"
|
|
19
|
+
oauth_redirect_url = "http://localhost:3000/callback"
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Keydris stable-channel defaults. npm installs this to ~/.keydris.toml.
|
|
2
|
+
#
|
|
3
|
+
# Lowest-precedence config: override any value with an environment variable.
|
|
4
|
+
# Project-local .env/.keydris.toml files require KEYDRIS_TRUST_PROJECT_CONFIG=1.
|
|
5
|
+
# Each key maps to KEYDRIS_<UPPER(KEY)>.
|
|
6
|
+
|
|
7
|
+
[keydris]
|
|
8
|
+
# `keydris upgrade` reads this to stay on the channel this install came from.
|
|
9
|
+
channel = "stable"
|
|
10
|
+
|
|
11
|
+
control_url = "https://api.keydris.com"
|
|
12
|
+
control_mtls_url = "https://api.keydris.com:8443"
|
|
13
|
+
trust_domain = "keydris.local"
|
|
14
|
+
|
|
15
|
+
oidc_issuer = "https://cognito-idp.us-east-1.amazonaws.com/us-east-1_ft2ArrhS7"
|
|
16
|
+
cognito_domain = "https://auth.keydris.com"
|
|
17
|
+
oauth_client_id = "6rll39d1l5hq1irjag9o4cu8m2"
|
|
18
|
+
oauth_scopes = "openid email"
|
|
19
|
+
oauth_redirect_url = "http://localhost:3000/callback"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keydris/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Governed, per-session identity and brokered egress for AI agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -8,21 +8,24 @@
|
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin",
|
|
11
|
+
"config",
|
|
12
|
+
"scripts",
|
|
11
13
|
"README.md"
|
|
12
14
|
],
|
|
13
15
|
"engines": {
|
|
14
16
|
"node": ">=20"
|
|
15
17
|
},
|
|
16
18
|
"scripts": {
|
|
19
|
+
"postinstall": "node scripts/install-config.mjs",
|
|
17
20
|
"prepublishOnly": "node ../../scripts/prepublish-check.mjs"
|
|
18
21
|
},
|
|
19
22
|
"optionalDependencies": {
|
|
20
|
-
"@keydris/cli-win32-x64": "0.1.
|
|
21
|
-
"@keydris/cli-win32-arm64": "0.1.
|
|
22
|
-
"@keydris/cli-darwin-x64": "0.1.
|
|
23
|
-
"@keydris/cli-darwin-arm64": "0.1.
|
|
24
|
-
"@keydris/cli-linux-x64": "0.1.
|
|
25
|
-
"@keydris/cli-linux-arm64": "0.1.
|
|
23
|
+
"@keydris/cli-win32-x64": "0.1.10",
|
|
24
|
+
"@keydris/cli-win32-arm64": "0.1.10",
|
|
25
|
+
"@keydris/cli-darwin-x64": "0.1.10",
|
|
26
|
+
"@keydris/cli-darwin-arm64": "0.1.10",
|
|
27
|
+
"@keydris/cli-linux-x64": "0.1.10",
|
|
28
|
+
"@keydris/cli-linux-arm64": "0.1.10"
|
|
26
29
|
},
|
|
27
30
|
"keywords": [
|
|
28
31
|
"ai",
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { copyFile, readFile, writeFile } from "node:fs/promises";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
|
|
5
|
+
async function installConfig() {
|
|
6
|
+
const home = homedir();
|
|
7
|
+
if (!home) {
|
|
8
|
+
throw new Error("could not resolve the user's home directory");
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
const manifest = JSON.parse(
|
|
12
|
+
await readFile(new URL("../package.json", import.meta.url), "utf8")
|
|
13
|
+
);
|
|
14
|
+
const channel = manifest.version.includes("-") ? "dev" : "stable";
|
|
15
|
+
const source = new URL(`../config/${channel}.toml`, import.meta.url);
|
|
16
|
+
const data = await readFile(source);
|
|
17
|
+
const destination = path.join(home, ".keydris.toml");
|
|
18
|
+
|
|
19
|
+
if (process.env.KEYDRIS_NO_CONFIG === "1") {
|
|
20
|
+
console.log(
|
|
21
|
+
`keydris: KEYDRIS_NO_CONFIG=1; leaving ${destination} unchanged`
|
|
22
|
+
);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
let existing;
|
|
27
|
+
try {
|
|
28
|
+
existing = await readFile(destination);
|
|
29
|
+
} catch (error) {
|
|
30
|
+
if (error.code !== "ENOENT") {
|
|
31
|
+
throw error;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (existing?.equals(data)) {
|
|
36
|
+
console.log(`keydris: ${channel} config already up to date at ${destination}`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (existing) {
|
|
41
|
+
const backup = `${destination}.bak`;
|
|
42
|
+
await copyFile(destination, backup);
|
|
43
|
+
console.log(`keydris: backed up existing config to ${backup}`);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
await writeFile(destination, data, { mode: 0o644 });
|
|
47
|
+
console.log(`keydris: wrote ${channel} config to ${destination}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
await installConfig();
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.warn(`keydris: WARNING: could not install ~/.keydris.toml: ${error.message}`);
|
|
54
|
+
}
|