kxco-pq-agent 1.0.0 → 1.0.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/package.json CHANGED
@@ -1,62 +1,66 @@
1
- {
2
- "name": "kxco-pq-agent",
3
- "version": "1.0.0",
4
- "description": "AI agent and robot identity for the KXCO post-quantum stack. Any KxcoIdentity holder may sponsor an agent with a locked ML-DSA-65 keypair and capability scope — payments, attestations, audit anchoring.",
5
- "keywords": [
6
- "post-quantum",
7
- "pqc",
8
- "ml-dsa",
9
- "nist",
10
- "fips-204",
11
- "kxco",
12
- "agent-identity",
13
- "robot-identity",
14
- "machine-identity",
15
- "ai-agent",
16
- "capability-scope",
17
- "armature",
18
- "relay",
19
- "blockchain"
20
- ],
21
- "license": "Apache-2.0",
22
- "author": "KXCO by Knightsbridge <hello@kxco.ai>",
23
- "contributors": [
24
- { "name": "Shayne Heffernan" },
25
- { "name": "John Heffernan" }
26
- ],
27
- "homepage": "https://kxco.ai",
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/JackKXCO/kxco-pq-agent.git"
31
- },
32
- "bugs": {
33
- "url": "https://github.com/JackKXCO/kxco-pq-agent/issues"
34
- },
35
- "type": "module",
36
- "sideEffects": false,
37
- "main": "./src/index.js",
38
- "types": "./src/index.d.ts",
39
- "exports": {
40
- ".": {
41
- "types": "./src/index.d.ts",
42
- "import": "./src/index.js"
43
- }
44
- },
45
- "files": [
46
- "src",
47
- "LICENSE"
48
- ],
49
- "engines": {
50
- "node": ">=20.19"
51
- },
52
- "dependencies": {
53
- "kxco-post-quantum": "^1.1.6"
54
- },
55
- "scripts": {
56
- "test": "node --test --test-timeout=30000 test/agent.test.js"
57
- },
58
- "funding": "https://kxco.ai",
59
- "publishConfig": {
60
- "access": "public"
61
- }
62
- }
1
+ {
2
+ "name": "kxco-pq-agent",
3
+ "version": "1.0.2",
4
+ "description": "AI agent and robot identity for the KXCO post-quantum stack. Any KxcoIdentity holder may sponsor an agent with a locked ML-DSA-65 keypair and capability scope — payments, attestations, audit anchoring.",
5
+ "keywords": [
6
+ "post-quantum",
7
+ "pqc",
8
+ "ml-dsa",
9
+ "nist",
10
+ "fips-204",
11
+ "kxco",
12
+ "agent-identity",
13
+ "robot-identity",
14
+ "machine-identity",
15
+ "ai-agent",
16
+ "capability-scope",
17
+ "armature",
18
+ "relay",
19
+ "blockchain"
20
+ ],
21
+ "license": "Apache-2.0",
22
+ "author": "KXCO by Knightsbridge \u003chello@kxco.ai\u003e",
23
+ "contributors": [
24
+ {
25
+ "name": "Shayne Heffernan"
26
+ },
27
+ {
28
+ "name": "John Heffernan"
29
+ }
30
+ ],
31
+ "homepage": "https://kxco.ai",
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "git+https://github.com/JackKXCO/kxco-pq-agent.git"
35
+ },
36
+ "bugs": {
37
+ "url": "https://github.com/JackKXCO/kxco-pq-agent/issues"
38
+ },
39
+ "type": "module",
40
+ "sideEffects": false,
41
+ "main": "./src/index.js",
42
+ "types": "./src/index.d.ts",
43
+ "exports": {
44
+ ".": {
45
+ "types": "./src/index.d.ts",
46
+ "import": "./src/index.js"
47
+ }
48
+ },
49
+ "files": [
50
+ "src",
51
+ "LICENSE"
52
+ ],
53
+ "engines": {
54
+ "node": "\u003e=20.19"
55
+ },
56
+ "dependencies": {
57
+ "kxco-post-quantum": "^1.1.6"
58
+ },
59
+ "scripts": {
60
+ "test": "node --test --test-timeout=30000 test/agent.test.js"
61
+ },
62
+ "funding": "https://kxco.ai",
63
+ "publishConfig": {
64
+ "access": "public"
65
+ }
66
+ }
@@ -294,6 +294,6 @@ export class KxcoAgentIdentity {
294
294
  static async revoke(agentKid, { chain, reason = '' } = {}) {
295
295
  if (!agentKid) throw new KxcoPqAgentError('revoke: agentKid is required')
296
296
  if (!chain) throw new KxcoPqAgentError('revoke: chain is required for on-chain revocation')
297
- await chain.revokeAgentCredential({ agentKid, reason })
297
+ return chain.revokeAgentCredential({ agentKid, reason })
298
298
  }
299
299
  }
package/src/scope.js CHANGED
@@ -70,12 +70,12 @@ export function validateScope(scope) {
70
70
  }
71
71
  }
72
72
 
73
- if (auditLog != null && (typeof auditLog !== 'object' || Array.isArray(auditLog))) {
74
- throw new KxcoPqAgentError('scope.auditLog must be an object')
73
+ if (auditLog != null && typeof auditLog !== 'boolean' && (typeof auditLog !== 'object' || Array.isArray(auditLog))) {
74
+ throw new KxcoPqAgentError('scope.auditLog must be a boolean or object')
75
75
  }
76
76
 
77
- if (credentials != null && (typeof credentials !== 'object' || Array.isArray(credentials))) {
78
- throw new KxcoPqAgentError('scope.credentials must be an object')
77
+ if (credentials != null && typeof credentials !== 'boolean' && (typeof credentials !== 'object' || Array.isArray(credentials))) {
78
+ throw new KxcoPqAgentError('scope.credentials must be a boolean or object')
79
79
  }
80
80
 
81
81
  return scope