atp-sdk 1.2.2 → 1.2.5
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
|
@@ -16,11 +16,15 @@ ATP provides universal quantum-safe security for all AI agent protocols (MCP, Sw
|
|
|
16
16
|
|
|
17
17
|
### Option 1: Scaffold with Onboarding Dashboard
|
|
18
18
|
|
|
19
|
+
Use the [`create-atp-agent`](https://www.npmjs.com/package/create-atp-agent) CLI (ESM-first template, Node 18+):
|
|
20
|
+
|
|
19
21
|
```bash
|
|
20
|
-
npx create-atp-agent
|
|
22
|
+
npx create-atp-agent my-agent
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
This creates `my-agent/` with `atp-sdk`, starter agent code, and `.atp.json` for the profile you pick. After scaffolding, the CLI starts an embedded onboarding UI at **`http://127.0.0.1:3456`** (or the next free port) and opens your browser. Flags: `--no-dashboard`, `--dashboard-only`, `--no-open` (or `CREATE_ATP_AGENT_NO_OPEN=1`). The local UI uses a **mock** onboard API for demos; wire real ATP services in your own app.
|
|
26
|
+
|
|
27
|
+
For the hosted marketing site and full product UI, see **[agenttrustprotocol.com](https://agenttrustprotocol.com)** (including the web wizard at `/onboard/agent` in this repo’s Next.js app).
|
|
24
28
|
|
|
25
29
|
### Option 2: Install the SDK Directly
|
|
26
30
|
|
|
@@ -30,16 +34,20 @@ npm install atp-sdk
|
|
|
30
34
|
|
|
31
35
|
```typescript
|
|
32
36
|
import { Agent } from 'atp-sdk';
|
|
33
|
-
await Agent.quickstart('MyBot');
|
|
37
|
+
const agent = await Agent.quickstart('MyBot');
|
|
38
|
+
console.log('Standalone:', agent.isStandalone());
|
|
34
39
|
// ⚡ MyBot ready!
|
|
35
40
|
// DID: did:atp:a1b2c3...
|
|
36
41
|
// Quantum-safe: yes
|
|
37
|
-
//
|
|
42
|
+
// Standalone: true
|
|
38
43
|
```
|
|
39
44
|
|
|
40
45
|
One line. Auto-prints DID, quantum-safe status, and connection mode. Need the agent reference? Use `const agent = await Agent.quickstart('MyBot')`. Need silent creation for library use? Use `Agent.create('MyBot')` instead.
|
|
41
46
|
|
|
42
47
|
**That's it!** Your agent now has:
|
|
48
|
+
|
|
49
|
+
> 📌 Image guidance: any screenshots, badges, or marketing assets should feature the ATP shield logo for consistent branding.
|
|
50
|
+
|
|
43
51
|
- ✅ Quantum-safe cryptography (hybrid Ed25519 + ML-DSA)
|
|
44
52
|
- ✅ Decentralized Identity (DID)
|
|
45
53
|
- ✅ Cryptographic signatures
|
|
@@ -1093,7 +1101,8 @@ This project is licensed under the Apache-2.0 License - see the [LICENSE](LICENS
|
|
|
1093
1101
|
- [x] **v1.1.0** - Payment Protocols (AP2 & ACP) Integration
|
|
1094
1102
|
- [x] **v1.2.0** - Zero-Knowledge Proof Authentication (Agent-to-Agent)
|
|
1095
1103
|
- [x] **v1.2.1** - Security Profiles & Onboarding (profile-based action gating, CLI/web onboarding wizard)
|
|
1096
|
-
- [x] **v1.2.2** - Standalone Mode & Embedded Dashboard (offline-first agents, `npx create-atp-agent
|
|
1104
|
+
- [x] **v1.2.2** - Standalone Mode & Embedded Dashboard (offline-first agents, `npx create-atp-agent <project>` with browser-based local onboarding UI)
|
|
1105
|
+
- [x] **v1.2.4** - Documentation: npm README aligned with `create-atp-agent` (ESM, flags, mock onboard UI vs [agenttrustprotocol.com](https://agenttrustprotocol.com) web wizard)
|
|
1097
1106
|
- [ ] **v1.3.0** - WebAssembly support for browser environments
|
|
1098
1107
|
- [ ] **v1.4.0** - GraphQL API support
|
|
1099
1108
|
- [ ] **v2.0.0** - ATP Protocol v2 compatibility
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { BaseClient } from './base.js';
|
|
2
|
+
import { ATPConfig, ATPResponse } from '../types.js';
|
|
3
|
+
/** Agent record stored in the ATP registry */
|
|
4
|
+
export interface AgentRecord {
|
|
5
|
+
did: string;
|
|
6
|
+
name: string;
|
|
7
|
+
runtime: string;
|
|
8
|
+
environment: string;
|
|
9
|
+
status: 'pending' | 'active' | 'suspended' | 'deactivated';
|
|
10
|
+
trustScore: number;
|
|
11
|
+
trustLevel: string;
|
|
12
|
+
profileId: string | null;
|
|
13
|
+
profileName: string | null;
|
|
14
|
+
policyComplianceStatus: 'pending' | 'compliant' | 'violation' | 'suspended';
|
|
15
|
+
creator: string | null;
|
|
16
|
+
workspace: string | null;
|
|
17
|
+
model: string | null;
|
|
18
|
+
agentVersion: string | null;
|
|
19
|
+
permissions: Record<string, unknown>;
|
|
20
|
+
isQuantumSafe: boolean;
|
|
21
|
+
totalViolations: number;
|
|
22
|
+
totalInteractions: number;
|
|
23
|
+
lastViolationAt: string | null;
|
|
24
|
+
registeredAt: string | null;
|
|
25
|
+
lastEventAt: string | null;
|
|
26
|
+
updatedAt: string;
|
|
27
|
+
}
|
|
28
|
+
export interface RegisterAgentRequest {
|
|
29
|
+
did: string;
|
|
30
|
+
name: string;
|
|
31
|
+
runtime: string;
|
|
32
|
+
environment: string;
|
|
33
|
+
profileId?: string;
|
|
34
|
+
creator?: string;
|
|
35
|
+
workspace?: string;
|
|
36
|
+
model?: string;
|
|
37
|
+
agentVersion?: string;
|
|
38
|
+
isQuantumSafe?: boolean;
|
|
39
|
+
}
|
|
40
|
+
export interface UpdateAgentRequest {
|
|
41
|
+
name?: string;
|
|
42
|
+
model?: string;
|
|
43
|
+
agentVersion?: string;
|
|
44
|
+
environment?: string;
|
|
45
|
+
permissions?: Record<string, unknown>;
|
|
46
|
+
}
|
|
47
|
+
export declare class RegistryClient extends BaseClient {
|
|
48
|
+
constructor(config: ATPConfig);
|
|
49
|
+
/** Register a new agent in the ATP registry */
|
|
50
|
+
registerAgent(request: RegisterAgentRequest): Promise<ATPResponse<AgentRecord>>;
|
|
51
|
+
/** Get a single agent by DID */
|
|
52
|
+
getAgent(did: string): Promise<ATPResponse<AgentRecord>>;
|
|
53
|
+
/** List all registered agents, optionally filtered */
|
|
54
|
+
listAgents(filters?: {
|
|
55
|
+
status?: string;
|
|
56
|
+
runtime?: string;
|
|
57
|
+
workspace?: string;
|
|
58
|
+
trustLevel?: string;
|
|
59
|
+
limit?: number;
|
|
60
|
+
offset?: number;
|
|
61
|
+
}): Promise<ATPResponse<{
|
|
62
|
+
agents: AgentRecord[];
|
|
63
|
+
total: number;
|
|
64
|
+
}>>;
|
|
65
|
+
/** Update an agent's metadata */
|
|
66
|
+
updateAgent(did: string, request: UpdateAgentRequest): Promise<ATPResponse<AgentRecord>>;
|
|
67
|
+
/** Deactivate an agent */
|
|
68
|
+
deactivateAgent(did: string, reason?: string): Promise<ATPResponse<AgentRecord>>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/client/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGrD,8CAA8C;AAC9C,MAAM,WAAW,WAAW;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC;IAC3D,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,sBAAsB,EAAE,SAAS,GAAG,WAAW,GAAG,WAAW,GAAG,WAAW,CAAC;IAC5E,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,Y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AAsD;IAChD,UAAU,CAAC,OAAO,CAAC,EAAE;QACzB,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,OAAO,CAAC,WAAW,CAAC;QAAE,MAAM,EAAE,WAAW,EAAE,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAYlE,iCAAiC;IAC3B,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IAI9F,0BAA0B;IACpB,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;CAGvF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { BaseClient } from './base.js';
|
|
2
|
+
export class RegistryClient extends BaseClient {
|
|
3
|
+
constructor(config) {
|
|
4
|
+
super(config, 'identity');
|
|
5
|
+
}
|
|
6
|
+
/** Register a new agent in the ATP registry */
|
|
7
|
+
async registerAgent(request) {
|
|
8
|
+
return this.post('/registry/agents', request);
|
|
9
|
+
}
|
|
10
|
+
/** Get a single agent by DID */
|
|
11
|
+
async getAgent(did) {
|
|
12
|
+
return this.get(`/registry/agents/${encodeURIComponent(did)}`);
|
|
13
|
+
}
|
|
14
|
+
/** List all registered agents, optionally filtered */
|
|
15
|
+
async listAgents(filters) {
|
|
16
|
+
const params = new URLSearchParams();
|
|
17
|
+
if (filters?.status)
|
|
18
|
+
params.set('status', filters.status);
|
|
19
|
+
if (filters?.runtime)
|
|
20
|
+
params.set('runtime', filters.runtime);
|
|
21
|
+
if (filters?.workspace)
|
|
22
|
+
params.set('workspace', filters.workspace);
|
|
23
|
+
if (filters?.trustLevel)
|
|
24
|
+
params.set('trustLevel', filters.trustLevel);
|
|
25
|
+
if (filters?.limit)
|
|
26
|
+
params.set('limit', String(filters.limit));
|
|
27
|
+
if (filters?.offset)
|
|
28
|
+
params.set('offset', String(filters.offset));
|
|
29
|
+
const qs = params.toString() ? `?${params.toString()}` : '';
|
|
30
|
+
return this.get(`/registry/agents${qs}`);
|
|
31
|
+
}
|
|
32
|
+
/** Update an agent's metadata */
|
|
33
|
+
async updateAgent(did, request) {
|
|
34
|
+
return this.patch(`/registry/agents/${encodeURIComponent(did)}`, request);
|
|
35
|
+
}
|
|
36
|
+
/** Deactivate an agent */
|
|
37
|
+
async deactivateAgent(did, reason) {
|
|
38
|
+
return this.post(`/registry/agents/${encodeURIComponent(did)}/deactivate`, { reason });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/client/registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAmDvC,MAAM,OAAO,cAAe,SAAQ,UAAU;IAC5C,YAAY,MAAiB;QAC3B,KAAK,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC5B,CAAC;IAED,+CAA+C;IAC/C,KAAK,CAAC,aAAa,CAAC,OAA6B;QAC/C,OAAO,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC;IAED,gCAAgC;IAChC,KAAK,CAAC,QAAQ,CAAC,GAAW;QACxB,OAAO,IAAI,CAAC,GAAG,CAAC,oBAAoB,kBAAkB,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,sDAAsD;IACtD,KAAK,CAAC,UAAU,CAAC,OAOhB;QACC,MAAM,MAAM,GAAG,IAAI,eAAe,EA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