@tacitprotocol/sdk 0.1.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/dist/index.d.mts +554 -0
- package/dist/index.d.ts +554 -0
- package/dist/index.js +996 -0
- package/dist/index.mjs +960 -0
- package/package.json +64 -0
- package/src/core/agent.ts +436 -0
- package/src/discovery/intent.ts +209 -0
- package/src/identity/authenticity.ts +260 -0
- package/src/identity/did.ts +192 -0
- package/src/index.ts +73 -0
- package/src/matching/scorer.ts +287 -0
- package/src/types/index.ts +286 -0
- package/tsconfig.json +24 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,554 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tacit Protocol — Core Type Definitions
|
|
3
|
+
* Version: 0.1.0
|
|
4
|
+
*/
|
|
5
|
+
type DID = `did:${string}:${string}`;
|
|
6
|
+
interface AgentIdentity {
|
|
7
|
+
did: DID;
|
|
8
|
+
publicKey: Uint8Array;
|
|
9
|
+
privateKey?: Uint8Array;
|
|
10
|
+
created: Date;
|
|
11
|
+
}
|
|
12
|
+
type AnonymityLevel = 'anonymous' | 'pseudonymous' | 'semi-identified' | 'identified';
|
|
13
|
+
interface SessionPersona {
|
|
14
|
+
displayName: string;
|
|
15
|
+
context: string;
|
|
16
|
+
anonymityLevel: AnonymityLevel;
|
|
17
|
+
sessionId: string;
|
|
18
|
+
}
|
|
19
|
+
interface AgentCard {
|
|
20
|
+
version: string;
|
|
21
|
+
agent: {
|
|
22
|
+
did: DID;
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
created: string;
|
|
26
|
+
protocols: string[];
|
|
27
|
+
transport: TransportConfig;
|
|
28
|
+
};
|
|
29
|
+
domains: Domain[];
|
|
30
|
+
authenticity: AuthenticityVector;
|
|
31
|
+
preferences: AgentPreferences;
|
|
32
|
+
}
|
|
33
|
+
interface TransportConfig {
|
|
34
|
+
type: 'didcomm/v2';
|
|
35
|
+
endpoint: string;
|
|
36
|
+
}
|
|
37
|
+
interface Domain {
|
|
38
|
+
type: DomainType;
|
|
39
|
+
seeking: string[];
|
|
40
|
+
offering: string[];
|
|
41
|
+
context: Record<string, string | string[] | number>;
|
|
42
|
+
}
|
|
43
|
+
type DomainType = 'professional' | 'dating' | 'local-services' | 'learning' | 'commerce' | 'custom';
|
|
44
|
+
interface AgentPreferences {
|
|
45
|
+
introductionStyle: 'progressive' | 'direct';
|
|
46
|
+
initialAnonymity: boolean;
|
|
47
|
+
responseTime: string;
|
|
48
|
+
languages: string[];
|
|
49
|
+
}
|
|
50
|
+
interface AuthenticityVector {
|
|
51
|
+
level: TrustLevel;
|
|
52
|
+
score: number;
|
|
53
|
+
dimensions: AuthenticityDimensions;
|
|
54
|
+
verifiableCredentials: VerifiableCredential[];
|
|
55
|
+
}
|
|
56
|
+
interface AuthenticityDimensions {
|
|
57
|
+
tenure: number;
|
|
58
|
+
consistency: number;
|
|
59
|
+
attestations: number;
|
|
60
|
+
networkTrust: number;
|
|
61
|
+
}
|
|
62
|
+
type TrustLevel = 'new' | 'emerging' | 'established' | 'trusted' | 'exemplary';
|
|
63
|
+
interface VerifiableCredential {
|
|
64
|
+
type: string;
|
|
65
|
+
issuer: DID;
|
|
66
|
+
claim: string;
|
|
67
|
+
issued: string;
|
|
68
|
+
signature?: string;
|
|
69
|
+
}
|
|
70
|
+
interface Intent {
|
|
71
|
+
id: string;
|
|
72
|
+
agentDid: DID;
|
|
73
|
+
type: IntentType;
|
|
74
|
+
domain: DomainType;
|
|
75
|
+
intent: {
|
|
76
|
+
seeking: Record<string, unknown>;
|
|
77
|
+
context: Record<string, unknown>;
|
|
78
|
+
};
|
|
79
|
+
filters: IntentFilters;
|
|
80
|
+
privacyLevel: PrivacyLevel;
|
|
81
|
+
ttl: number;
|
|
82
|
+
created: string;
|
|
83
|
+
signature: string;
|
|
84
|
+
}
|
|
85
|
+
type IntentType = 'introduction' | 'service' | 'collaboration' | 'mentorship' | 'commerce';
|
|
86
|
+
type PrivacyLevel = 'public' | 'filtered' | 'private';
|
|
87
|
+
interface IntentFilters {
|
|
88
|
+
minAuthenticityScore: number;
|
|
89
|
+
requiredCredentials: string[];
|
|
90
|
+
excludedDomains: string[];
|
|
91
|
+
}
|
|
92
|
+
type IntentStatus = 'created' | 'published' | 'active' | 'matched' | 'fulfilled' | 'expired' | 'withdrawn';
|
|
93
|
+
interface MatchResult {
|
|
94
|
+
matchId: string;
|
|
95
|
+
agents: {
|
|
96
|
+
initiator: DID;
|
|
97
|
+
responder: DID;
|
|
98
|
+
};
|
|
99
|
+
score: MatchScore;
|
|
100
|
+
timestamp: string;
|
|
101
|
+
}
|
|
102
|
+
interface MatchScore {
|
|
103
|
+
overall: number;
|
|
104
|
+
breakdown: {
|
|
105
|
+
intentAlignment: number;
|
|
106
|
+
domainFit: number;
|
|
107
|
+
authenticityCompatibility: number;
|
|
108
|
+
preferenceMatch: number;
|
|
109
|
+
timingFit: number;
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
type MatchAction = 'auto-propose' | 'suggest' | 'ignore';
|
|
113
|
+
interface IntroProposal {
|
|
114
|
+
id: string;
|
|
115
|
+
type: IntentType;
|
|
116
|
+
initiator: {
|
|
117
|
+
agentDid: DID;
|
|
118
|
+
persona: SessionPersona;
|
|
119
|
+
};
|
|
120
|
+
responder: {
|
|
121
|
+
agentDid: DID;
|
|
122
|
+
persona?: SessionPersona;
|
|
123
|
+
};
|
|
124
|
+
match: {
|
|
125
|
+
score: number;
|
|
126
|
+
rationale: string;
|
|
127
|
+
domain: DomainType;
|
|
128
|
+
};
|
|
129
|
+
terms: IntroTerms;
|
|
130
|
+
status: ProposalStatus;
|
|
131
|
+
created: string;
|
|
132
|
+
signature: string;
|
|
133
|
+
}
|
|
134
|
+
interface IntroTerms {
|
|
135
|
+
initialReveal: AnonymityLevel;
|
|
136
|
+
revealStages: RevealStage[];
|
|
137
|
+
communicationChannel: string;
|
|
138
|
+
expiry: string;
|
|
139
|
+
}
|
|
140
|
+
type RevealStage = 'domain_context' | 'professional_background' | 'personal_background' | 'identity' | 'direct_contact';
|
|
141
|
+
type ProposalStatus = 'pending' | 'accepted_by_initiator' | 'accepted_by_responder' | 'active' | 'completed' | 'declined' | 'expired' | 'withdrawn';
|
|
142
|
+
interface ServiceIntent {
|
|
143
|
+
serviceType: string;
|
|
144
|
+
description: string;
|
|
145
|
+
location?: {
|
|
146
|
+
city: string;
|
|
147
|
+
radiusKm: number;
|
|
148
|
+
};
|
|
149
|
+
budget?: {
|
|
150
|
+
currency: string;
|
|
151
|
+
max: number;
|
|
152
|
+
};
|
|
153
|
+
urgency: string;
|
|
154
|
+
requirements: {
|
|
155
|
+
minAuthenticity: number;
|
|
156
|
+
requiredCredentials: string[];
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
interface ServiceAttestation {
|
|
160
|
+
type: 'ServiceAttestation';
|
|
161
|
+
issuer: DID;
|
|
162
|
+
subject: DID;
|
|
163
|
+
claims: {
|
|
164
|
+
serviceType: string;
|
|
165
|
+
completed: boolean;
|
|
166
|
+
qualityRating: number;
|
|
167
|
+
onTime: boolean;
|
|
168
|
+
wouldRecommend: boolean;
|
|
169
|
+
};
|
|
170
|
+
issued: string;
|
|
171
|
+
signature: string;
|
|
172
|
+
}
|
|
173
|
+
type TacitEvent = {
|
|
174
|
+
type: 'intent:published';
|
|
175
|
+
intent: Intent;
|
|
176
|
+
} | {
|
|
177
|
+
type: 'intent:matched';
|
|
178
|
+
match: MatchResult;
|
|
179
|
+
} | {
|
|
180
|
+
type: 'intent:expired';
|
|
181
|
+
intentId: string;
|
|
182
|
+
} | {
|
|
183
|
+
type: 'proposal:received';
|
|
184
|
+
proposal: IntroProposal;
|
|
185
|
+
} | {
|
|
186
|
+
type: 'proposal:accepted';
|
|
187
|
+
proposal: IntroProposal;
|
|
188
|
+
} | {
|
|
189
|
+
type: 'proposal:declined';
|
|
190
|
+
proposalId: string;
|
|
191
|
+
} | {
|
|
192
|
+
type: 'intro:started';
|
|
193
|
+
proposal: IntroProposal;
|
|
194
|
+
} | {
|
|
195
|
+
type: 'intro:context-revealed';
|
|
196
|
+
stage: RevealStage;
|
|
197
|
+
data: Record<string, unknown>;
|
|
198
|
+
} | {
|
|
199
|
+
type: 'intro:completed';
|
|
200
|
+
proposalId: string;
|
|
201
|
+
} | {
|
|
202
|
+
type: 'connection:established';
|
|
203
|
+
endpoint: string;
|
|
204
|
+
} | {
|
|
205
|
+
type: 'connection:lost';
|
|
206
|
+
reason: string;
|
|
207
|
+
} | {
|
|
208
|
+
type: 'error';
|
|
209
|
+
error: Error;
|
|
210
|
+
};
|
|
211
|
+
interface TacitConfig {
|
|
212
|
+
identity?: AgentIdentity;
|
|
213
|
+
relayUrl?: string;
|
|
214
|
+
profile?: {
|
|
215
|
+
name: string;
|
|
216
|
+
description?: string;
|
|
217
|
+
domain: DomainType;
|
|
218
|
+
seeking: string;
|
|
219
|
+
offering: string;
|
|
220
|
+
};
|
|
221
|
+
matchThresholds?: {
|
|
222
|
+
autoPropose: number;
|
|
223
|
+
suggest: number;
|
|
224
|
+
};
|
|
225
|
+
preferences?: Partial<AgentPreferences>;
|
|
226
|
+
}
|
|
227
|
+
interface RelayConfig {
|
|
228
|
+
url: string;
|
|
229
|
+
maxRetries: number;
|
|
230
|
+
retryDelayMs: number;
|
|
231
|
+
heartbeatIntervalMs: number;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* Tacit Protocol — Agent Core
|
|
236
|
+
*
|
|
237
|
+
* The TacitAgent is the primary interface for interacting with the
|
|
238
|
+
* Tacit Protocol. It represents a human's AI agent on the network.
|
|
239
|
+
*/
|
|
240
|
+
|
|
241
|
+
type EventHandler = (event: TacitEvent) => void | Promise<void>;
|
|
242
|
+
declare class TacitAgent {
|
|
243
|
+
private identity;
|
|
244
|
+
private config;
|
|
245
|
+
private events;
|
|
246
|
+
private authenticityEngine;
|
|
247
|
+
private intents;
|
|
248
|
+
private proposals;
|
|
249
|
+
private connected;
|
|
250
|
+
constructor(config: TacitConfig);
|
|
251
|
+
/**
|
|
252
|
+
* Create a new agent identity.
|
|
253
|
+
* Returns an AgentIdentity that can be passed to the constructor.
|
|
254
|
+
*/
|
|
255
|
+
static createIdentity(): Promise<AgentIdentity>;
|
|
256
|
+
/**
|
|
257
|
+
* Connect the agent to the Tacit network via a relay node.
|
|
258
|
+
*/
|
|
259
|
+
connect(): Promise<void>;
|
|
260
|
+
/**
|
|
261
|
+
* Disconnect the agent from the network.
|
|
262
|
+
* Active intents remain on the network until their TTL expires.
|
|
263
|
+
*/
|
|
264
|
+
disconnect(): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Check if the agent is connected to the network.
|
|
267
|
+
*/
|
|
268
|
+
isConnected(): boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Get the agent's DID.
|
|
271
|
+
*/
|
|
272
|
+
getDid(): string;
|
|
273
|
+
/**
|
|
274
|
+
* Get the agent's Agent Card.
|
|
275
|
+
*/
|
|
276
|
+
getAgentCard(): AgentCard;
|
|
277
|
+
/**
|
|
278
|
+
* Get the agent's current authenticity vector.
|
|
279
|
+
*/
|
|
280
|
+
getAuthenticity(): AuthenticityVector;
|
|
281
|
+
/**
|
|
282
|
+
* Publish an intent to the network.
|
|
283
|
+
*/
|
|
284
|
+
publishIntent(params: {
|
|
285
|
+
type: IntentType;
|
|
286
|
+
domain: DomainType;
|
|
287
|
+
seeking: Record<string, unknown>;
|
|
288
|
+
context?: Record<string, unknown>;
|
|
289
|
+
filters?: {
|
|
290
|
+
minAuthenticityScore?: number;
|
|
291
|
+
requiredCredentials?: string[];
|
|
292
|
+
};
|
|
293
|
+
privacyLevel?: PrivacyLevel;
|
|
294
|
+
ttlSeconds?: number;
|
|
295
|
+
}): Promise<Intent>;
|
|
296
|
+
/**
|
|
297
|
+
* Withdraw an active intent.
|
|
298
|
+
*/
|
|
299
|
+
withdrawIntent(intentId: string): Promise<void>;
|
|
300
|
+
/**
|
|
301
|
+
* Get all active intents.
|
|
302
|
+
*/
|
|
303
|
+
getActiveIntents(): Intent[];
|
|
304
|
+
/**
|
|
305
|
+
* Handle an incoming match from the network.
|
|
306
|
+
* Called when another agent's intent is compatible with ours.
|
|
307
|
+
*/
|
|
308
|
+
handleMatch(match: MatchResult): Promise<void>;
|
|
309
|
+
/**
|
|
310
|
+
* Create and send an introduction proposal.
|
|
311
|
+
*/
|
|
312
|
+
proposeIntro(match: MatchResult): Promise<IntroProposal>;
|
|
313
|
+
/**
|
|
314
|
+
* Accept an introduction proposal.
|
|
315
|
+
* This is the human's explicit consent (one half of double opt-in).
|
|
316
|
+
*/
|
|
317
|
+
acceptProposal(proposalId: string): Promise<void>;
|
|
318
|
+
/**
|
|
319
|
+
* Decline an introduction proposal.
|
|
320
|
+
* The other party receives a generic "not a match" response.
|
|
321
|
+
*/
|
|
322
|
+
declineProposal(proposalId: string): Promise<void>;
|
|
323
|
+
/**
|
|
324
|
+
* Get all pending proposals.
|
|
325
|
+
*/
|
|
326
|
+
getPendingProposals(): IntroProposal[];
|
|
327
|
+
/**
|
|
328
|
+
* Subscribe to specific event types.
|
|
329
|
+
*/
|
|
330
|
+
on(type: string, handler: EventHandler): void;
|
|
331
|
+
/**
|
|
332
|
+
* Subscribe to all events.
|
|
333
|
+
*/
|
|
334
|
+
onAny(handler: EventHandler): void;
|
|
335
|
+
/**
|
|
336
|
+
* Unsubscribe from an event type.
|
|
337
|
+
*/
|
|
338
|
+
off(type: string, handler: EventHandler): void;
|
|
339
|
+
private generateRationale;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/**
|
|
343
|
+
* Tacit Protocol — DID Identity Management
|
|
344
|
+
*
|
|
345
|
+
* Handles creation, resolution, and management of W3C Decentralized Identifiers
|
|
346
|
+
* for Tacit agents. Uses did:key method for simplicity in v0.1.
|
|
347
|
+
*/
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* Create a did:key identifier from a public key.
|
|
351
|
+
* did:key encodes the public key directly in the DID string.
|
|
352
|
+
*
|
|
353
|
+
* Format: did:key:z{multibase-encoded-multicodec-public-key}
|
|
354
|
+
* For Ed25519: multicodec prefix is 0xed01
|
|
355
|
+
*/
|
|
356
|
+
declare function publicKeyToDid(publicKey: Uint8Array): DID;
|
|
357
|
+
/**
|
|
358
|
+
* Create a new agent identity with a fresh keypair and DID.
|
|
359
|
+
*/
|
|
360
|
+
declare function createIdentity(): Promise<AgentIdentity>;
|
|
361
|
+
/**
|
|
362
|
+
* Resolve a DID to its public key.
|
|
363
|
+
* For did:key, the public key is embedded in the DID itself.
|
|
364
|
+
*/
|
|
365
|
+
declare function resolveDid(did: DID): {
|
|
366
|
+
publicKey: Uint8Array;
|
|
367
|
+
} | null;
|
|
368
|
+
/**
|
|
369
|
+
* Sign arbitrary data with the agent's private key.
|
|
370
|
+
*/
|
|
371
|
+
declare function sign(data: Uint8Array, privateKey: Uint8Array): Promise<Uint8Array>;
|
|
372
|
+
/**
|
|
373
|
+
* Verify a signature against a public key.
|
|
374
|
+
*/
|
|
375
|
+
declare function verify(data: Uint8Array, signature: Uint8Array, publicKey: Uint8Array): Promise<boolean>;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Tacit Protocol — Authenticity Vector Engine
|
|
379
|
+
*
|
|
380
|
+
* Computes and manages the multi-dimensional trust score that
|
|
381
|
+
* replaces self-reported profiles with verifiable behavioral signals.
|
|
382
|
+
*/
|
|
383
|
+
|
|
384
|
+
declare class AuthenticityEngine {
|
|
385
|
+
/**
|
|
386
|
+
* Compute the tenure dimension score.
|
|
387
|
+
* Linear growth over 365 days, capped at 1.0.
|
|
388
|
+
*/
|
|
389
|
+
computeTenure(agentCreatedDate: Date, now?: Date): number;
|
|
390
|
+
/**
|
|
391
|
+
* Compute the consistency dimension score.
|
|
392
|
+
* Based on behavioral stability signals over time.
|
|
393
|
+
*/
|
|
394
|
+
computeConsistency(signals: ConsistencySignals): number;
|
|
395
|
+
/**
|
|
396
|
+
* Compute the attestation dimension score.
|
|
397
|
+
* Based on third-party verifiable credentials.
|
|
398
|
+
*/
|
|
399
|
+
computeAttestations(credentials: VerifiableCredential[]): number;
|
|
400
|
+
/**
|
|
401
|
+
* Compute the network trust dimension score.
|
|
402
|
+
* Based on the quality of the agent's network relationships.
|
|
403
|
+
*
|
|
404
|
+
* This is a simplified version — production implementations
|
|
405
|
+
* should use a full PageRank-style algorithm.
|
|
406
|
+
*/
|
|
407
|
+
computeNetworkTrust(signals: NetworkTrustSignals): number;
|
|
408
|
+
/**
|
|
409
|
+
* Compute the full authenticity vector from all dimensions.
|
|
410
|
+
*/
|
|
411
|
+
computeVector(params: {
|
|
412
|
+
agentCreatedDate: Date;
|
|
413
|
+
consistencySignals: ConsistencySignals;
|
|
414
|
+
credentials: VerifiableCredential[];
|
|
415
|
+
networkSignals: NetworkTrustSignals;
|
|
416
|
+
lastActiveDate?: Date;
|
|
417
|
+
}): AuthenticityVector;
|
|
418
|
+
/**
|
|
419
|
+
* Convert a numeric score to a trust level.
|
|
420
|
+
*/
|
|
421
|
+
scoreToLevel(score: number): TrustLevel;
|
|
422
|
+
/**
|
|
423
|
+
* Check if an agent meets minimum authenticity requirements.
|
|
424
|
+
*/
|
|
425
|
+
meetsMinimum(vector: AuthenticityVector, minScore: number): boolean;
|
|
426
|
+
}
|
|
427
|
+
interface ConsistencySignals {
|
|
428
|
+
/** 0-1: How stable the agent's intents have been over time */
|
|
429
|
+
intentStability: number;
|
|
430
|
+
/** 0-1: How consistent the profile claims have been */
|
|
431
|
+
profileConsistency: number;
|
|
432
|
+
/** 0-1: How reliably the agent responds to proposals */
|
|
433
|
+
responseReliability: number;
|
|
434
|
+
/** 0-1: Quality ratings from completed interactions */
|
|
435
|
+
interactionQuality: number;
|
|
436
|
+
}
|
|
437
|
+
interface NetworkTrustSignals {
|
|
438
|
+
/** Total number of interactions this agent has had */
|
|
439
|
+
totalInteractions: number;
|
|
440
|
+
/** Number of interactions rated positively by the other party */
|
|
441
|
+
positiveInteractions: number;
|
|
442
|
+
/** Total introduction proposals that reached completion */
|
|
443
|
+
totalIntros: number;
|
|
444
|
+
/** Intros that both parties rated as successful */
|
|
445
|
+
successfulIntros: number;
|
|
446
|
+
/** Number of agents that mutually trust this agent */
|
|
447
|
+
bidirectionalTrustEdges: number;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/**
|
|
451
|
+
* Tacit Protocol — Intent Broadcasting & Discovery
|
|
452
|
+
*
|
|
453
|
+
* Handles the creation, publication, and discovery of intents
|
|
454
|
+
* on the Tacit network.
|
|
455
|
+
*/
|
|
456
|
+
|
|
457
|
+
declare class IntentBuilder {
|
|
458
|
+
private partial;
|
|
459
|
+
constructor(agentDid: DID);
|
|
460
|
+
type(type: IntentType): this;
|
|
461
|
+
domain(domain: DomainType): this;
|
|
462
|
+
seeking(seeking: Record<string, unknown>): this;
|
|
463
|
+
context(context: Record<string, unknown>): this;
|
|
464
|
+
privacy(level: PrivacyLevel): this;
|
|
465
|
+
ttl(seconds: number): this;
|
|
466
|
+
minAuthenticity(score: number): this;
|
|
467
|
+
requireCredentials(...types: string[]): this;
|
|
468
|
+
build(): Intent;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Local intent storage with lifecycle management.
|
|
472
|
+
* In production, this connects to the relay network.
|
|
473
|
+
*/
|
|
474
|
+
declare class IntentStore {
|
|
475
|
+
private intents;
|
|
476
|
+
add(intent: Intent): void;
|
|
477
|
+
get(id: string): Intent | undefined;
|
|
478
|
+
getStatus(id: string): IntentStatus | undefined;
|
|
479
|
+
setStatus(id: string, status: IntentStatus): void;
|
|
480
|
+
withdraw(id: string): boolean;
|
|
481
|
+
/**
|
|
482
|
+
* Get all active intents (not expired, not withdrawn, not fulfilled).
|
|
483
|
+
*/
|
|
484
|
+
getActive(): Intent[];
|
|
485
|
+
/**
|
|
486
|
+
* Find intents that match a given query.
|
|
487
|
+
* This is the local equivalent of a relay query.
|
|
488
|
+
*/
|
|
489
|
+
query(params: {
|
|
490
|
+
type?: IntentType;
|
|
491
|
+
domain?: DomainType;
|
|
492
|
+
minAuthenticity?: number;
|
|
493
|
+
keywords?: string[];
|
|
494
|
+
}): Intent[];
|
|
495
|
+
/**
|
|
496
|
+
* Remove expired intents from the store.
|
|
497
|
+
*/
|
|
498
|
+
cleanup(): number;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
/**
|
|
502
|
+
* Tacit Protocol — Match Scoring Engine
|
|
503
|
+
*
|
|
504
|
+
* Computes compatibility scores between two agents based on their
|
|
505
|
+
* intents, domains, authenticity, and preferences.
|
|
506
|
+
*/
|
|
507
|
+
|
|
508
|
+
declare class MatchScorer {
|
|
509
|
+
private thresholds;
|
|
510
|
+
constructor(thresholds?: {
|
|
511
|
+
autoPropose?: number;
|
|
512
|
+
suggest?: number;
|
|
513
|
+
});
|
|
514
|
+
/**
|
|
515
|
+
* Score the compatibility between two agents based on their intents and cards.
|
|
516
|
+
*/
|
|
517
|
+
score(params: {
|
|
518
|
+
initiator: {
|
|
519
|
+
intent: Intent;
|
|
520
|
+
card: AgentCard;
|
|
521
|
+
};
|
|
522
|
+
responder: {
|
|
523
|
+
intent: Intent;
|
|
524
|
+
card: AgentCard;
|
|
525
|
+
};
|
|
526
|
+
}): MatchResult;
|
|
527
|
+
/**
|
|
528
|
+
* Determine what action to take based on a match score.
|
|
529
|
+
*/
|
|
530
|
+
determineAction(score: number): MatchAction;
|
|
531
|
+
/**
|
|
532
|
+
* Score how well the two intents complement each other.
|
|
533
|
+
* A seeking-offering match scores highest.
|
|
534
|
+
*/
|
|
535
|
+
private scoreIntentAlignment;
|
|
536
|
+
/**
|
|
537
|
+
* Score the domain overlap between two intents.
|
|
538
|
+
*/
|
|
539
|
+
private scoreDomainFit;
|
|
540
|
+
/**
|
|
541
|
+
* Score whether both agents meet each other's authenticity requirements.
|
|
542
|
+
*/
|
|
543
|
+
private scoreAuthenticityCompatibility;
|
|
544
|
+
/**
|
|
545
|
+
* Score preference compatibility (communication style, timing, language).
|
|
546
|
+
*/
|
|
547
|
+
private scorePreferenceMatch;
|
|
548
|
+
/**
|
|
549
|
+
* Score timing compatibility — are both intents active and aligned in urgency?
|
|
550
|
+
*/
|
|
551
|
+
private scoreTimingFit;
|
|
552
|
+
}
|
|
553
|
+
|
|
554
|
+
export { type AgentCard, type AgentIdentity, type AgentPreferences, type AnonymityLevel, type AuthenticityDimensions, AuthenticityEngine, type AuthenticityVector, type ConsistencySignals, type DID, type Domain, type DomainType, type Intent, IntentBuilder, type IntentFilters, type IntentStatus, IntentStore, type IntentType, type IntroProposal, type IntroTerms, type MatchAction, type MatchResult, type MatchScore, MatchScorer, type NetworkTrustSignals, type PrivacyLevel, type ProposalStatus, type RelayConfig, type RevealStage, type ServiceAttestation, type ServiceIntent, type SessionPersona, TacitAgent, type TacitConfig, type TacitEvent, type TransportConfig, type TrustLevel, type VerifiableCredential, createIdentity, publicKeyToDid, resolveDid, sign, verify };
|