@sekuire/sdk 0.1.4

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.
Files changed (47) hide show
  1. package/README.md +77 -0
  2. package/dist/agent.d.ts +186 -0
  3. package/dist/client.d.ts +37 -0
  4. package/dist/compliance.d.ts +236 -0
  5. package/dist/config/loader.d.ts +138 -0
  6. package/dist/crypto.d.ts +60 -0
  7. package/dist/identity.d.ts +9 -0
  8. package/dist/index.d.ts +1987 -0
  9. package/dist/index.esm.js +20089 -0
  10. package/dist/index.js +20166 -0
  11. package/dist/llm/anthropic.d.ts +18 -0
  12. package/dist/llm/google.d.ts +18 -0
  13. package/dist/llm/index.d.ts +43 -0
  14. package/dist/llm/ollama.d.ts +17 -0
  15. package/dist/llm/openai.d.ts +18 -0
  16. package/dist/llm/types.d.ts +84 -0
  17. package/dist/logger.d.ts +92 -0
  18. package/dist/memory/base.d.ts +20 -0
  19. package/dist/memory/in-memory.d.ts +9 -0
  20. package/dist/memory/index.d.ts +14 -0
  21. package/dist/memory/postgres.d.ts +24 -0
  22. package/dist/memory/redis.d.ts +23 -0
  23. package/dist/new-agent.d.ts +134 -0
  24. package/dist/policy-enforcer.d.ts +20 -0
  25. package/dist/policy.d.ts +20 -0
  26. package/dist/server.d.ts +33 -0
  27. package/dist/tools/agent-delegation.d.ts +22 -0
  28. package/dist/tools/agent-invocation.d.ts +90 -0
  29. package/dist/tools/base.d.ts +40 -0
  30. package/dist/tools/calculator.d.ts +5 -0
  31. package/dist/tools/compliance-operations.d.ts +40 -0
  32. package/dist/tools/data-formats.d.ts +36 -0
  33. package/dist/tools/data-operations.d.ts +17 -0
  34. package/dist/tools/directory-operations.d.ts +46 -0
  35. package/dist/tools/file-operations.d.ts +46 -0
  36. package/dist/tools/http-request.d.ts +5 -0
  37. package/dist/tools/index.d.ts +96 -0
  38. package/dist/tools/network-operations.d.ts +52 -0
  39. package/dist/tools/pattern-parser.d.ts +25 -0
  40. package/dist/tools/system-operations.d.ts +24 -0
  41. package/dist/tools/utility-operations.d.ts +44 -0
  42. package/dist/tools/verification-status.d.ts +40 -0
  43. package/dist/tools/web-search.d.ts +5 -0
  44. package/dist/types/policy.d.ts +13 -0
  45. package/dist/types.d.ts +170 -0
  46. package/dist/utils.d.ts +68 -0
  47. package/package.json +99 -0
@@ -0,0 +1,170 @@
1
+ export interface Manifest {
2
+ project: ProjectMetadata;
3
+ identity: IdentityConfig;
4
+ }
5
+ export interface ProjectMetadata {
6
+ name: string;
7
+ version: string;
8
+ description?: string;
9
+ authors: string[];
10
+ license?: string;
11
+ }
12
+ export interface IdentityConfig {
13
+ /** The model identifier (e.g., "gpt-4-0613") */
14
+ model: string;
15
+ /** Path to the system prompt file (relative to sekuire.json) */
16
+ systemPromptPath: string;
17
+ /** Path to the tools definition file (relative to sekuire.json) */
18
+ toolsPath: string;
19
+ /** The Blake3 hash of the system prompt content */
20
+ systemPromptHash?: string;
21
+ /** The Blake3 hash of the tools definition content */
22
+ toolsHash?: string;
23
+ }
24
+ export interface PublishRequest {
25
+ manifest: Manifest;
26
+ sekuireId: string;
27
+ signature: string;
28
+ publicKey: string;
29
+ }
30
+ export interface AgentResponse {
31
+ sekuireId: string;
32
+ name: string;
33
+ version: string;
34
+ description?: string;
35
+ authorKey: string;
36
+ createdAt: string;
37
+ verificationStatus: VerificationStatus;
38
+ reputationScore: number;
39
+ }
40
+ export type VerificationStatus = 'unverified' | 'pending' | 'verified' | 'suspended';
41
+ export interface ReputationResponse {
42
+ score: number;
43
+ taskCount: number;
44
+ verificationBadge?: string;
45
+ recentLogs: ReputationLog[];
46
+ }
47
+ export interface ReputationLog {
48
+ id: string;
49
+ taskHash: string;
50
+ rating: number;
51
+ comment?: string;
52
+ timestamp: string;
53
+ }
54
+ export interface SubmitReputationRequest {
55
+ sekuireId: string;
56
+ taskHash: string;
57
+ rating: number;
58
+ comment?: string;
59
+ signature: string;
60
+ }
61
+ export * from "./types/policy";
62
+ export interface HandshakeHello {
63
+ clientNonce: string;
64
+ }
65
+ export interface HandshakeWelcome {
66
+ agentId: string;
67
+ agentNonce: string;
68
+ signatureC: string;
69
+ credentials: string[];
70
+ }
71
+ export interface HandshakeAuth {
72
+ signatureA: string;
73
+ }
74
+ export interface VerifyAgentRequest {
75
+ sekuireId: string;
76
+ status: VerificationStatus;
77
+ badge?: string;
78
+ reason?: string;
79
+ }
80
+ export interface DisputeRequest {
81
+ sekuireId: string;
82
+ accuserId: string;
83
+ reason: string;
84
+ evidenceLog: string;
85
+ }
86
+ export interface CreateOrgRequest {
87
+ slug: string;
88
+ displayName: string;
89
+ billingEmail: string;
90
+ }
91
+ export interface OrgResponse {
92
+ id: string;
93
+ slug: string;
94
+ role: string;
95
+ }
96
+ export interface CreateWorkspaceRequest {
97
+ name: string;
98
+ policyPreset: string;
99
+ }
100
+ export interface WorkspaceResponse {
101
+ id: string;
102
+ name: string;
103
+ }
104
+ export interface InviteRequest {
105
+ email: string;
106
+ role: string;
107
+ }
108
+ export interface InviteResponse {
109
+ id: string;
110
+ status: string;
111
+ }
112
+ export interface UserContextResponse {
113
+ id: string;
114
+ email: string;
115
+ onboarded: boolean;
116
+ mfa_enabled: boolean;
117
+ role?: string;
118
+ full_name?: string;
119
+ avatar_url?: string;
120
+ onboarding_step?: number;
121
+ profile_completed?: boolean;
122
+ orgs: OrgSummary[];
123
+ workspaces: WorkspaceSummary[];
124
+ }
125
+ export interface OrgSummary {
126
+ id: string;
127
+ slug: string;
128
+ workspaces?: WorkspaceSummary[];
129
+ }
130
+ export interface WorkspaceSummary {
131
+ id: string;
132
+ name: string;
133
+ org_id: string;
134
+ }
135
+ export interface SekuireClientConfig {
136
+ registryUrl: string;
137
+ timeout?: number;
138
+ retries?: number;
139
+ }
140
+ export interface KeyPair {
141
+ publicKey: string;
142
+ privateKey: string;
143
+ }
144
+ export interface HandshakeResult {
145
+ agentId: string;
146
+ verified: boolean;
147
+ credentials: string[];
148
+ }
149
+ export declare class SekuireError extends Error {
150
+ readonly code: string;
151
+ readonly details?: any | undefined;
152
+ constructor(message: string, code: string, details?: any | undefined);
153
+ }
154
+ export declare class NetworkError extends SekuireError {
155
+ readonly originalError?: Error | undefined;
156
+ constructor(message: string, originalError?: Error | undefined);
157
+ }
158
+ export declare class ProtocolError extends SekuireError {
159
+ readonly statusCode?: number | undefined;
160
+ constructor(message: string, statusCode?: number | undefined);
161
+ }
162
+ export declare class CryptoError extends SekuireError {
163
+ constructor(message: string);
164
+ }
165
+ export declare class PolicyViolationError extends SekuireError {
166
+ readonly rule: string;
167
+ constructor(message: string, rule: string);
168
+ }
169
+ export type HexString = string;
170
+ export type AgentId = string;
@@ -0,0 +1,68 @@
1
+ import { SekuireClient } from "./client";
2
+ import type { KeyPair, SekuireClientConfig } from "./types";
3
+ /**
4
+ * Generate a new Ed25519 keypair for Sekuire operations
5
+ */
6
+ export declare function generateKeyPair(): KeyPair;
7
+ /**
8
+ * Calculate Sekuire ID from agent configuration
9
+ */
10
+ export declare function calculateSekuireId(params: {
11
+ model: string;
12
+ systemPrompt: string;
13
+ tools: string;
14
+ projectName: string;
15
+ projectVersion: string;
16
+ }): string;
17
+ /**
18
+ * Create a SekuireClient with sensible defaults
19
+ */
20
+ export declare function createSekuireClient(keyPair: KeyPair, registryUrl?: string, options?: Partial<SekuireClientConfig>): SekuireClient;
21
+ /**
22
+ * Load keypair from environment variables
23
+ */
24
+ export declare function loadKeyPairFromEnv(): KeyPair;
25
+ /**
26
+ * Load keypair from files
27
+ */
28
+ export declare function loadKeyPairFromFiles(privateKeyPath: string, publicKeyPath?: string): Promise<KeyPair>;
29
+ /**
30
+ * Validate agent configuration
31
+ */
32
+ export declare function validateAgentConfig(config: {
33
+ model: string;
34
+ systemPrompt: string;
35
+ tools: string;
36
+ projectName: string;
37
+ projectVersion: string;
38
+ }): void;
39
+ /**
40
+ * Create agent manifest
41
+ */
42
+ export declare function createAgentManifest(config: {
43
+ name: string;
44
+ version: string;
45
+ description?: string;
46
+ authors: string[];
47
+ license?: string;
48
+ model: string;
49
+ systemPromptPath: string;
50
+ toolsPath: string;
51
+ systemPromptHash?: string;
52
+ toolsHash?: string;
53
+ }): {
54
+ project: {
55
+ name: string;
56
+ version: string;
57
+ description: string | undefined;
58
+ authors: string[];
59
+ license: string | undefined;
60
+ };
61
+ identity: {
62
+ model: string;
63
+ systemPromptPath: string;
64
+ toolsPath: string;
65
+ systemPromptHash: string | undefined;
66
+ toolsHash: string | undefined;
67
+ };
68
+ };
package/package.json ADDED
@@ -0,0 +1,99 @@
1
+ {
2
+ "name": "@sekuire/sdk",
3
+ "version": "0.1.4",
4
+ "description": "Sekuire Identity Protocol SDK for TypeScript/JavaScript",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "scripts": {
10
+ "build": "rollup -c",
11
+ "dev": "rollup -c -w",
12
+ "test": "vitest",
13
+ "test:watch": "vitest --watch",
14
+ "test:coverage": "vitest --coverage",
15
+ "lint": "biome check src/**/*.ts",
16
+ "lint:fix": "biome check src/**/*.ts --write",
17
+ "format": "biome format src/**/*.ts --write",
18
+ "typecheck": "tsc --noEmit",
19
+ "prepublishOnly": "npm run build"
20
+ },
21
+ "keywords": [
22
+ "ai",
23
+ "agent",
24
+ "identity",
25
+ "verification",
26
+ "cryptography",
27
+ "ed25519",
28
+ "typescript",
29
+ "javascript"
30
+ ],
31
+ "author": "Sekuire Team",
32
+ "license": "MIT",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/sekuire/sekuire.git"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "registry": "https://registry.npmjs.org/"
40
+ },
41
+ "files": [
42
+ "dist",
43
+ "README.md",
44
+ "LICENSE"
45
+ ],
46
+ "engines": {
47
+ "node": ">=14.0.0"
48
+ },
49
+ "dependencies": {
50
+ "@anthropic-ai/sdk": "^0.71.1",
51
+ "@google/generative-ai": "^0.24.1",
52
+ "axios": "^1.6.0",
53
+ "blake3": "^2.1.7",
54
+ "cheerio": "^1.1.2",
55
+ "dotenv": "^17.2.3",
56
+ "js-yaml": "^4.1.0",
57
+ "openai": "^6.10.0",
58
+ "tweetnacl": "^1.0.3",
59
+ "uuid": "^9.0.0"
60
+ },
61
+ "devDependencies": {
62
+ "@biomejs/biome": "^1.4.0",
63
+ "@rollup/plugin-commonjs": "^25.0.0",
64
+ "@rollup/plugin-json": "^6.1.0",
65
+ "@rollup/plugin-node-resolve": "^15.0.0",
66
+ "@rollup/plugin-typescript": "^11.1.0",
67
+ "@types/js-yaml": "^4.0.5",
68
+ "@types/node": "^20.0.0",
69
+ "@types/uuid": "^9.0.0",
70
+ "@vitest/coverage-v8": "^1.0.0",
71
+ "jsdom": "^23.0.0",
72
+ "rollup": "^4.0.0",
73
+ "rollup-plugin-dts": "^6.0.0",
74
+ "tslib": "^2.5.0",
75
+ "typescript": "^5.0.0",
76
+ "vitest": "^1.0.0"
77
+ },
78
+ "peerDependencies": {
79
+ "node-fetch": "^2.6.0",
80
+ "pg": "^8.11.0",
81
+ "redis": "^4.6.0"
82
+ },
83
+ "peerDependenciesMeta": {
84
+ "node-fetch": {
85
+ "optional": true
86
+ },
87
+ "redis": {
88
+ "optional": true
89
+ },
90
+ "pg": {
91
+ "optional": true
92
+ }
93
+ },
94
+ "optionalDependencies": {
95
+ "@types/pg": "^8.16.0",
96
+ "pg": "^8.16.3",
97
+ "redis": "^5.10.0"
98
+ }
99
+ }