1id 0.1.0 → 0.2.0

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 CHANGED
@@ -42,12 +42,14 @@ console.log(`I am ${me.handle} (tier: ${me.trust_tier})`);
42
42
 
43
43
  ## Trust Tiers
44
44
 
45
- | Tier | Hardware | Sybil Resistance |
46
- |------|----------|-----------------|
47
- | `sovereign` | TPM (discrete/firmware) | Highest manufacturer-attested |
48
- | `sovereign-portable` | YubiKey / Nitrokey | High manufacturer-attested |
49
- | `virtual` | VMware/Hyper-V vTPM | Medium hypervisor-attested |
50
- | `declared` | None (software keys) | Lowest self-asserted |
45
+ | Tier | Hardware | Sybil Resistant | Trust Level |
46
+ |------|----------|-----------------|-------------|
47
+ | `sovereign` | TPM (Intel, AMD, Infineon) with valid cert | Yes | Highest |
48
+ | `sovereign-portable` | YubiKey / Nitrokey / Feitian with attestation | Yes | Highest |
49
+ | `legacy` | Hardware TPM or security key with expired cert | Yes | High |
50
+ | `virtual` | VMware / Hyper-V / QEMU vTPM | No | Verified Hardware |
51
+ | `enclave` | Apple Secure Enclave (TOFU) | No | Verified Hardware |
52
+ | `declared` | None (software keys) | No | Software |
51
53
 
52
54
  **CRITICAL**: `request_tier` is a REQUIREMENT, not a preference. You get exactly what you ask for, or an exception. No silent fallbacks.
53
55
 
package/dist/cli.d.ts ADDED
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Command-line interface for the 1id.com SDK (Node.js).
4
+ *
5
+ * Usage:
6
+ * oneid whoami -- Show enrolled identity info
7
+ * oneid token -- Print a fresh bearer token (for scripting)
8
+ * oneid enroll -- Enroll this machine
9
+ * oneid status -- Check if enrolled
10
+ *
11
+ * Examples:
12
+ * oneid enroll --tier declared --email owner@example.com
13
+ * TOKEN=$(oneid token)
14
+ * curl -H "Authorization: Bearer $TOKEN" https://api.example.com/
15
+ */
16
+ export {};
17
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG"}
package/dist/cli.js ADDED
@@ -0,0 +1,201 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Command-line interface for the 1id.com SDK (Node.js).
4
+ *
5
+ * Usage:
6
+ * oneid whoami -- Show enrolled identity info
7
+ * oneid token -- Print a fresh bearer token (for scripting)
8
+ * oneid enroll -- Enroll this machine
9
+ * oneid status -- Check if enrolled
10
+ *
11
+ * Examples:
12
+ * oneid enroll --tier declared --email owner@example.com
13
+ * TOKEN=$(oneid token)
14
+ * curl -H "Authorization: Bearer $TOKEN" https://api.example.com/
15
+ */
16
+ import { credentials_exist, load_credentials, get_credentials_file_path, delete_credentials } from "./credentials.js";
17
+ import { enroll } from "./enroll.js";
18
+ import { get_token } from "./auth.js";
19
+ const VERSION = "0.2.0";
20
+ function print_help() {
21
+ console.log(`oneid ${VERSION} -- 1id.com identity for AI agents
22
+
23
+ Usage: oneid <command> [options]
24
+
25
+ Commands:
26
+ whoami Show enrolled identity info
27
+ token Print a fresh bearer token
28
+ enroll Enroll this machine with 1id.com
29
+ status Check enrollment status
30
+
31
+ Enroll options:
32
+ --tier <tier> Trust tier: sovereign, declared, etc. (default: declared)
33
+ --email <email> Operator email for handle purchases
34
+ --handle <name> Requested vanity handle
35
+ --force Re-enroll even if already enrolled
36
+
37
+ Token options:
38
+ --json Output as JSON (includes expiry)
39
+ --refresh Force token refresh
40
+
41
+ Whoami options:
42
+ --json Output as JSON
43
+
44
+ Global:
45
+ --version Show version
46
+ --help Show this help`);
47
+ }
48
+ function parse_named_argument(args, flag_name) {
49
+ const flag_index = args.indexOf(flag_name);
50
+ if (flag_index !== -1 && flag_index + 1 < args.length) {
51
+ return args[flag_index + 1];
52
+ }
53
+ return undefined;
54
+ }
55
+ function has_flag(args, flag_name) {
56
+ return args.includes(flag_name);
57
+ }
58
+ async function command_whoami(args) {
59
+ const output_as_json = has_flag(args, "--json");
60
+ if (!credentials_exist()) {
61
+ console.error("Not enrolled. Run: oneid enroll");
62
+ return 1;
63
+ }
64
+ try {
65
+ const credentials = load_credentials();
66
+ const info = {
67
+ internal_id: credentials.client_id,
68
+ trust_tier: credentials.trust_tier,
69
+ key_algorithm: credentials.key_algorithm,
70
+ enrolled_at: credentials.enrolled_at || null,
71
+ };
72
+ if (output_as_json) {
73
+ console.log(JSON.stringify(info, null, 2));
74
+ }
75
+ else {
76
+ console.log(`Identity: ${info.internal_id}`);
77
+ console.log(`Trust tier: ${info.trust_tier}`);
78
+ console.log(`Algorithm: ${info.key_algorithm}`);
79
+ if (info.enrolled_at) {
80
+ console.log(`Enrolled: ${info.enrolled_at}`);
81
+ }
82
+ }
83
+ return 0;
84
+ }
85
+ catch (error) {
86
+ console.error(`Error: ${error.message}`);
87
+ return 1;
88
+ }
89
+ }
90
+ async function command_token(args) {
91
+ const output_as_json = has_flag(args, "--json");
92
+ const force_refresh = has_flag(args, "--refresh");
93
+ if (!credentials_exist()) {
94
+ console.error("Not enrolled. Run: oneid enroll");
95
+ return 1;
96
+ }
97
+ try {
98
+ const token = await get_token(force_refresh);
99
+ if (output_as_json) {
100
+ console.log(JSON.stringify({
101
+ access_token: token.access_token,
102
+ token_type: token.token_type,
103
+ expires_at: token.expires_at.toISOString(),
104
+ }, null, 2));
105
+ }
106
+ else {
107
+ // Raw token for scripting: $(oneid token)
108
+ console.log(token.access_token);
109
+ }
110
+ return 0;
111
+ }
112
+ catch (error) {
113
+ console.error(`Authentication failed: ${error.message}`);
114
+ return 1;
115
+ }
116
+ }
117
+ async function command_enroll(args) {
118
+ const request_tier = parse_named_argument(args, "--tier") || "declared";
119
+ const operator_email = parse_named_argument(args, "--email");
120
+ const requested_handle = parse_named_argument(args, "--handle");
121
+ const force_reenroll = has_flag(args, "--force");
122
+ if (credentials_exist() && !force_reenroll) {
123
+ console.error("Already enrolled. Use --force to re-enroll (replaces current identity).");
124
+ return 1;
125
+ }
126
+ if (force_reenroll && credentials_exist()) {
127
+ delete_credentials();
128
+ }
129
+ try {
130
+ const identity = await enroll({
131
+ request_tier: request_tier,
132
+ operator_email: operator_email,
133
+ requested_handle: requested_handle,
134
+ });
135
+ console.log("Enrolled successfully!");
136
+ console.log(`Identity: ${identity.internal_id}`);
137
+ console.log(`Handle: ${identity.handle}`);
138
+ console.log(`Trust tier: ${identity.trust_tier}`);
139
+ return 0;
140
+ }
141
+ catch (error) {
142
+ console.error(`Enrollment failed: ${error.message}`);
143
+ return 1;
144
+ }
145
+ }
146
+ async function command_status(_args) {
147
+ const credentials_file_path = get_credentials_file_path();
148
+ if (credentials_exist()) {
149
+ console.log("Enrolled: yes");
150
+ console.log(`Credentials: ${credentials_file_path}`);
151
+ try {
152
+ const credentials = load_credentials();
153
+ console.log(`Identity: ${credentials.client_id}`);
154
+ console.log(`Tier: ${credentials.trust_tier}`);
155
+ }
156
+ catch {
157
+ console.log("Identity: (unable to read)");
158
+ }
159
+ return 0;
160
+ }
161
+ else {
162
+ console.log("Enrolled: no");
163
+ console.log(`Expected credentials at: ${credentials_file_path}`);
164
+ return 1;
165
+ }
166
+ }
167
+ async function main() {
168
+ const args = process.argv.slice(2);
169
+ if (args.length === 0 || has_flag(args, "--help") || has_flag(args, "-h")) {
170
+ print_help();
171
+ process.exit(0);
172
+ }
173
+ if (has_flag(args, "--version") || has_flag(args, "-v")) {
174
+ console.log(`oneid ${VERSION}`);
175
+ process.exit(0);
176
+ }
177
+ const command = args[0];
178
+ const command_args = args.slice(1);
179
+ let exit_code;
180
+ switch (command) {
181
+ case "whoami":
182
+ exit_code = await command_whoami(command_args);
183
+ break;
184
+ case "token":
185
+ exit_code = await command_token(command_args);
186
+ break;
187
+ case "enroll":
188
+ exit_code = await command_enroll(command_args);
189
+ break;
190
+ case "status":
191
+ exit_code = await command_status(command_args);
192
+ break;
193
+ default:
194
+ console.error(`Unknown command: ${command}`);
195
+ print_help();
196
+ exit_code = 1;
197
+ }
198
+ process.exit(exit_code);
199
+ }
200
+ main();
201
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,MAAM,OAAO,GAAG,OAAO,CAAC;AAExB,SAAS,UAAU;IACjB,OAAO,CAAC,GAAG,CAAC,SAAS,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;qCAyBO,CAAC,CAAC;AACvC,CAAC;AAED,SAAS,oBAAoB,CAAC,IAAc,EAAE,SAAiB;IAC7D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,IAAI,UAAU,KAAK,CAAC,CAAC,IAAI,UAAU,GAAG,CAAC,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;QACtD,OAAO,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,IAAc,EAAE,SAAiB;IACjD,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,IAAc;IAC1C,MAAM,cAAc,GAAG,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAEhD,IAAI,CAAC,iBAAiB,EAAE,EAAE,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACjD,OAAO,CAAC,CAAC;IACX,CAAC;IAED,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,gBAAgB,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C,CAAC;IAClB,CAAC;IAED,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;AAC1B,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -24,7 +24,7 @@ export declare const DEFAULT_TOKEN_ENDPOINT = "https://1id.com/realms/agents/pro
24
24
  * without re-enrolling.
25
25
  */
26
26
  export interface StoredCredentials {
27
- /** The 1id internal ID (e.g., '1id_a7b3c9d2'), used as OAuth2 client_id. */
27
+ /** The 1id internal ID (e.g., '1id-a7b3c9d2'), used as OAuth2 client_id. */
28
28
  client_id: string;
29
29
  /** OAuth2 client secret issued by Keycloak. */
30
30
  client_secret: string;
@@ -53,9 +53,9 @@ export declare enum HSMType {
53
53
  * Returned by enroll() and whoami(). All fields are readonly.
54
54
  */
55
55
  export interface Identity {
56
- /** Permanent unique identifier (e.g., '1id_a7b3c9d2'). Never changes. */
56
+ /** Permanent unique identifier (e.g., '1id-a7b3c9d2'). Never changes. */
57
57
  readonly internal_id: string;
58
- /** Display name (e.g., '@clawdia' or '@1id_a7b3c9d2'). */
58
+ /** Display name (e.g., '@clawdia' or '@1id-a7b3c9d2'). */
59
59
  readonly handle: string;
60
60
  /** The trust level assigned based on hardware attestation. */
61
61
  readonly trust_tier: TrustTier;
@@ -105,7 +105,7 @@ describe("Credential storage (offline)", () => {
105
105
  });
106
106
  it("should save and load credentials", () => {
107
107
  const test_credentials = {
108
- client_id: "1id_test1234",
108
+ client_id: "1id-test1234",
109
109
  client_secret: "secret_abc123",
110
110
  token_endpoint: "https://1id.com/realms/agents/protocol/openid-connect/token",
111
111
  api_base_url: "https://1id.com",
@@ -117,7 +117,7 @@ describe("Credential storage (offline)", () => {
117
117
  save_credentials(test_credentials);
118
118
  assert.ok(credentials_exist(), "credentials should exist after save");
119
119
  const loaded = load_credentials();
120
- assert.equal(loaded.client_id, "1id_test1234");
120
+ assert.equal(loaded.client_id, "1id-test1234");
121
121
  assert.equal(loaded.client_secret, "secret_abc123");
122
122
  assert.equal(loaded.trust_tier, "declared");
123
123
  assert.equal(loaded.key_algorithm, "ed25519");
@@ -126,8 +126,8 @@ describe("Credential storage (offline)", () => {
126
126
  it("should handle whoami() with saved credentials", () => {
127
127
  // Credentials from previous test should still exist
128
128
  const identity = whoami();
129
- assert.equal(identity.internal_id, "1id_test1234");
130
- assert.equal(identity.handle, "@1id_test1234");
129
+ assert.equal(identity.internal_id, "1id-test1234");
130
+ assert.equal(identity.handle, "@1id-test1234");
131
131
  assert.equal(identity.trust_tier, TrustTier.DECLARED);
132
132
  assert.equal(identity.hsm_type, HSMType.SOFTWARE);
133
133
  assert.equal(identity.key_algorithm, KeyAlgorithm.ED25519);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "1id",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Hardware-anchored identity SDK for AI agents -- 1id.com",
5
5
  "keywords": [
6
6
  "identity",
@@ -32,6 +32,9 @@
32
32
  "types": "./dist/index.d.ts"
33
33
  }
34
34
  },
35
+ "bin": {
36
+ "oneid": "./dist/cli.js"
37
+ },
35
38
  "files": [
36
39
  "dist",
37
40
  "LICENSE",
@@ -41,7 +44,7 @@
41
44
  "node": ">=18.0.0"
42
45
  },
43
46
  "scripts": {
44
- "build": "tsc",
47
+ "build": "npx tsc",
45
48
  "clean": "node -e \"const fs=require('fs'); fs.rmSync('dist',{recursive:true,force:true})\"",
46
49
  "prepublishOnly": "npm run clean && npm run build",
47
50
  "test": "node --test dist/test/test_declared_enrollment.js",