@agentunion/fastaun 0.5.18 → 0.5.20
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/CHANGELOG.md +172 -79
- package/_packed_docs/CHANGELOG.md +172 -79
- package/_packed_docs/INDEX.md +244 -116
- package/_packed_docs/KITE_DOCS_GUIDE.md +98 -69
- package/_packed_docs/agent.md/SCHEMA.md +245 -205
- package/_packed_docs/agent.md//350/277/234/347/250/213agent.md/347/274/223/345/255/230/344/270/216etag/351/200/217/344/274/240/346/226/271/346/241/210.md +11 -11
- package/_packed_docs/aun/345/210/206/345/270/203/345/274/217/346/265/213/350/257/225/350/277/220/350/241/214/346/214/207/345/215/227.md +42 -15
- package/_packed_docs/aun/346/265/213/350/257/225/350/277/220/350/241/214/346/214/207/345/215/227.md +4 -4
- package/_packed_docs/protocol/01-/350/272/253/344/273/275/344/270/216/345/207/255/350/257/201/345/215/217/350/256/256-auth.md +45 -134
- package/_packed_docs/protocol/06-/346/234/215/345/212/241/345/215/217/350/256/256.md +1072 -1072
- package/_packed_docs/protocol/07-/351/224/231/350/257/257/347/240/201/344/270/216/347/212/266/346/200/201/346/234/272.md +5 -20
- package/_packed_docs/protocol/10-Group-/345/255/220/345/215/217/350/256/256.md +687 -668
- package/_packed_docs/protocol/11-Storage-/345/255/220/345/215/217/350/256/256.md +19 -28
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/211.md +443 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2112.0.md +161 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2112.1.md +658 -0
- package/_packed_docs/protocol/Ownership/345/215/217/350/256/256/345/256/232/344/271/2113.0.md +233 -0
- package/_packed_docs/protocol/agent.md/SCHEMA.md +4 -0
- package/_packed_docs/sdk/03-/346/240/270/345/277/203/346/246/202/345/277/265.md +1 -1
- package/_packed_docs/sdk/04-/350/277/236/346/216/245/344/270/216/350/256/244/350/257/201.md +68 -61
- package/_packed_docs/sdk/05-E2EE/345/212/240/345/257/206/351/200/232/344/277/241.md +1 -1
- package/_packed_docs/sdk/06-API/346/211/213/345/206/214.md +279 -285
- package/_packed_docs/sdk/08-/346/234/200/344/275/263/345/256/236/350/267/265.md +3 -3
- package/_packed_docs/sdk/09-group-rpc-manual.md +271 -235
- package/_packed_docs/sdk/09-message-rpc-manual.md +47 -6
- package/_packed_docs/sdk/09-storage-rpc-manual.md +70 -68
- package/_packed_docs/sdk/AUN_DOCS_GUIDE.md +63 -34
- package/_packed_docs/sdk/INDEX.md +105 -34
- package/_packed_docs/sdk/Ownership-SDK/345/256/236/347/216/260/346/214/207/345/215/227.md +169 -0
- package/_packed_docs/sdk/Ownership-SDK/347/274/226/346/216/222/346/214/207/345/215/227.md +349 -0
- package/_packed_docs/sdk/Ownership-SDK/347/274/226/346/216/222/346/214/207/345/215/2272.1.md +922 -0
- package/_packed_docs/sdk/Ownership-SDK/351/233/206/346/210/220/346/214/207/345/215/227.md +270 -0
- package/_packed_docs/sdk/Ownership2.1-SDK/345/272/224/347/224/250/351/233/206/346/210/220/346/214/207/345/215/227.md +300 -0
- package/_packed_docs/sdk/Ownership2.1-SDK/345/274/200/345/217/221/344/270/216/347/247/273/346/244/215/346/214/207/345/215/227.md +382 -0
- package/_packed_docs/sdk/Ownership2.1-TDD/345/210/206/351/230/266/346/256/265/345/256/236/346/226/275/350/256/241/345/210/222.md +708 -0
- package/_packed_docs/sdk/Ownership2.1/350/257/246/347/273/206/350/256/276/350/256/241.md +476 -0
- package/_packed_docs/sdk/Ownership/347/256/241/347/220/206/344/270/223/351/242/230.md +559 -0
- package/_packed_docs/sdk/ProtectedHeaders/347/224/250/346/263/225/344/270/223/351/242/230.md +299 -0
- package/_packed_docs/sdk//345/207/255/350/257/201/344/270/216/347/273/204/347/273/207/346/234/215/345/212/241SDK/345/272/224/347/224/250/351/233/206/346/210/220/346/214/207/345/215/227.md +173 -0
- package/_packed_docs/sdk//345/207/255/350/257/201/344/270/216/347/273/204/347/273/207/346/234/215/345/212/241SDK/345/274/200/345/217/221/344/270/216/347/247/273/346/244/215/346/214/207/345/215/227.md +211 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273SDK/345/256/236/347/216/260/347/247/273/346/244/215/346/214/207/345/215/227.md +331 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273SDK/351/233/206/346/210/220/346/214/207/345/215/227.md +207 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/344/273/243/347/240/201/345/256/241/346/237/245/346/212/245/345/221/212.md +252 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/345/256/236/346/226/275/350/256/241/345/210/222.md +156 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/346/226/271/346/241/210.md +273 -0
- package/_packed_docs//350/267/250/350/256/276/345/244/207/345/267/262/350/257/273/346/234/252/350/257/273/350/257/246/347/273/206/350/256/276/350/256/241.md +211 -0
- package/dist/agent-md-schema.d.ts +15 -1
- package/dist/agent-md-schema.js +87 -24
- package/dist/agent-md-schema.js.map +1 -1
- package/dist/agent-md.d.ts +54 -2
- package/dist/agent-md.js +637 -53
- package/dist/agent-md.js.map +1 -1
- package/dist/aid-store.d.ts +38 -59
- package/dist/aid-store.js +300 -265
- package/dist/aid-store.js.map +1 -1
- package/dist/aid.js +30 -11
- package/dist/aid.js.map +1 -1
- package/dist/auth.d.ts +6 -1
- package/dist/auth.js +500 -15
- package/dist/auth.js.map +1 -1
- package/dist/cert-utils.d.ts +44 -2
- package/dist/cert-utils.js +149 -49
- package/dist/cert-utils.js.map +1 -1
- package/dist/client/delivery.d.ts +11 -1
- package/dist/client/delivery.js +321 -62
- package/dist/client/delivery.js.map +1 -1
- package/dist/client/rpc-pipeline.d.ts +1 -0
- package/dist/client/rpc-pipeline.js +142 -82
- package/dist/client/rpc-pipeline.js.map +1 -1
- package/dist/client/v2-e2ee.d.ts +1 -0
- package/dist/client/v2-e2ee.js +166 -96
- package/dist/client/v2-e2ee.js.map +1 -1
- package/dist/client.d.ts +84 -1
- package/dist/client.js +780 -30
- package/dist/client.js.map +1 -1
- package/dist/errors.js +4 -3
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +9 -3
- package/dist/events.js +69 -11
- package/dist/events.js.map +1 -1
- package/dist/facades.d.ts +83 -3
- package/dist/facades.js +100 -6
- package/dist/facades.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/keystore/aid-db.d.ts +5 -0
- package/dist/keystore/aid-db.js +57 -0
- package/dist/keystore/aid-db.js.map +1 -1
- package/dist/keystore/index.d.ts +8 -0
- package/dist/keystore/local-identity-store.js +10 -3
- package/dist/keystore/local-identity-store.js.map +1 -1
- package/dist/keystore/local-token-store.d.ts +6 -1
- package/dist/keystore/local-token-store.js +24 -1
- package/dist/keystore/local-token-store.js.map +1 -1
- package/dist/org-protocol.d.ts +98 -0
- package/dist/org-protocol.js +1753 -0
- package/dist/org-protocol.js.map +1 -0
- package/dist/ownership-proof.d.ts +82 -5
- package/dist/ownership-proof.js +327 -31
- package/dist/ownership-proof.js.map +1 -1
- package/dist/ownership-v21.d.ts +196 -0
- package/dist/ownership-v21.js +712 -0
- package/dist/ownership-v21.js.map +1 -0
- package/dist/ownership-workflow.d.ts +87 -0
- package/dist/ownership-workflow.js +1182 -0
- package/dist/ownership-workflow.js.map +1 -0
- package/dist/seq-tracker.d.ts +1 -0
- package/dist/seq-tracker.js +10 -1
- package/dist/seq-tracker.js.map +1 -1
- package/dist/tools/cross-sdk-agent.d.ts +90 -1
- package/dist/tools/cross-sdk-agent.js +441 -7
- package/dist/tools/cross-sdk-agent.js.map +1 -1
- package/dist/transport.d.ts +8 -0
- package/dist/transport.js +118 -4
- package/dist/transport.js.map +1 -1
- package/dist/v2/e2ee/decrypt.d.ts +1 -0
- package/dist/v2/e2ee/decrypt.js +9 -1
- package/dist/v2/e2ee/decrypt.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { AID } from './aid.js';
|
|
2
|
+
import { StateError } from './errors.js';
|
|
3
|
+
export type OwnershipFileRole = 'agent' | 'owner';
|
|
4
|
+
export type OwnershipConsensusStatus = 'consensus' | 'released' | 'unbound' | 'single_sided' | 'invalid' | 'unavailable' | 'not_applicable';
|
|
5
|
+
export interface OwnershipStatementV21 {
|
|
6
|
+
version: 2;
|
|
7
|
+
declaration_id: string;
|
|
8
|
+
owner_aid: string;
|
|
9
|
+
sub_aid: string;
|
|
10
|
+
relation_version: number;
|
|
11
|
+
declared_at: number;
|
|
12
|
+
}
|
|
13
|
+
export interface OwnershipTransferV21 {
|
|
14
|
+
new_owner_aid: string;
|
|
15
|
+
target_relation_version: number;
|
|
16
|
+
expires_at: number;
|
|
17
|
+
}
|
|
18
|
+
export interface OwnershipFileContext {
|
|
19
|
+
expectedSubAid?: string;
|
|
20
|
+
expectedOwnerAid?: string;
|
|
21
|
+
expectedTargetAid?: string;
|
|
22
|
+
authenticatedAid?: string;
|
|
23
|
+
certificateAid?: string;
|
|
24
|
+
resourcePath?: string;
|
|
25
|
+
storagePath?: string;
|
|
26
|
+
now?: number;
|
|
27
|
+
requireSignature?: boolean;
|
|
28
|
+
certificateResolver?: (aid: string, fingerprint: string, timestamp: number) => OwnershipCertificate;
|
|
29
|
+
}
|
|
30
|
+
export interface OwnershipCertificate {
|
|
31
|
+
cert_pem: string;
|
|
32
|
+
chain_valid: boolean;
|
|
33
|
+
state: string;
|
|
34
|
+
revoked: boolean;
|
|
35
|
+
revocation_checked: boolean;
|
|
36
|
+
observed_at: number;
|
|
37
|
+
}
|
|
38
|
+
export interface OwnershipFile {
|
|
39
|
+
raw: Uint8Array;
|
|
40
|
+
payload: string;
|
|
41
|
+
frontmatter: Record<string, unknown>;
|
|
42
|
+
signature: Record<string, string> | null;
|
|
43
|
+
statement?: OwnershipStatementV21;
|
|
44
|
+
action?: 'declare' | 'release' | 'transfer_owner';
|
|
45
|
+
transfer?: OwnershipTransferV21;
|
|
46
|
+
}
|
|
47
|
+
export interface OwnershipConsensusResult {
|
|
48
|
+
status: OwnershipConsensusStatus;
|
|
49
|
+
sub_aid: string;
|
|
50
|
+
owner_aid: string | null;
|
|
51
|
+
relation_version: number;
|
|
52
|
+
lock: 'locked' | 'unlocked';
|
|
53
|
+
agent_md_etag: string;
|
|
54
|
+
agent_md_sha256: string;
|
|
55
|
+
owner_md_sha256: string;
|
|
56
|
+
code?: string;
|
|
57
|
+
reason?: string;
|
|
58
|
+
retryable?: boolean;
|
|
59
|
+
}
|
|
60
|
+
export declare const OWNERSHIP_UUID_V4_RE: RegExp;
|
|
61
|
+
export declare function ownershipAid(value: unknown, field: string): string;
|
|
62
|
+
export declare function ownershipInteger(value: unknown, field: string, min?: number): number;
|
|
63
|
+
export declare function validateOwnershipStatement(value: unknown): OwnershipStatementV21;
|
|
64
|
+
export declare function validateOwnershipAgentFrontmatter(meta: Record<string, unknown>, expectedAid?: string): OwnershipStatementV21 | undefined;
|
|
65
|
+
export declare function parseOwnershipFile(content: string | Uint8Array, role: OwnershipFileRole, context?: OwnershipFileContext): OwnershipFile;
|
|
66
|
+
export declare function verifyOwnershipFile(content: string | Uint8Array, role: OwnershipFileRole, certificate: OwnershipCertificate, context?: OwnershipFileContext): OwnershipFile;
|
|
67
|
+
export declare function signOwnershipFile(identity: AID, content: string | Uint8Array, role: OwnershipFileRole, context?: OwnershipFileContext): string;
|
|
68
|
+
export declare function ownershipSha256(content: string | Uint8Array): string;
|
|
69
|
+
export interface OwnershipAgentObservation {
|
|
70
|
+
sub_aid: string;
|
|
71
|
+
exists: boolean;
|
|
72
|
+
content: string;
|
|
73
|
+
etag: string;
|
|
74
|
+
protocol: string;
|
|
75
|
+
relation_version: number;
|
|
76
|
+
lock: 'locked' | 'unlocked';
|
|
77
|
+
owner_aid?: string | null;
|
|
78
|
+
observed_at: number;
|
|
79
|
+
recovery_ready?: boolean;
|
|
80
|
+
}
|
|
81
|
+
export interface OwnershipOwnerObservation {
|
|
82
|
+
owner_aid: string;
|
|
83
|
+
sub_aid?: string;
|
|
84
|
+
bucket: string;
|
|
85
|
+
path: string;
|
|
86
|
+
exists: boolean;
|
|
87
|
+
observed_at: number;
|
|
88
|
+
sha256?: string;
|
|
89
|
+
content: string;
|
|
90
|
+
authoritative: boolean;
|
|
91
|
+
recovery_ready?: boolean;
|
|
92
|
+
service_aid: string;
|
|
93
|
+
authenticated_service_aid: string;
|
|
94
|
+
version?: number;
|
|
95
|
+
}
|
|
96
|
+
export interface OwnershipSavedFile {
|
|
97
|
+
raw: string;
|
|
98
|
+
hash: string;
|
|
99
|
+
condition: {
|
|
100
|
+
if_match?: string;
|
|
101
|
+
if_none_match?: string;
|
|
102
|
+
};
|
|
103
|
+
published_etag?: string;
|
|
104
|
+
original_owner?: {
|
|
105
|
+
exists: boolean;
|
|
106
|
+
raw: string;
|
|
107
|
+
sha256: string;
|
|
108
|
+
};
|
|
109
|
+
expires_at?: number;
|
|
110
|
+
deleted?: boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface OwnershipFileTask {
|
|
113
|
+
operation_id?: string;
|
|
114
|
+
operation: 'bind' | 'release' | 'transfer';
|
|
115
|
+
sub_aid: string;
|
|
116
|
+
owner_aid: string;
|
|
117
|
+
new_owner_aid?: string;
|
|
118
|
+
base_relation_version: number;
|
|
119
|
+
target_relation_version: number;
|
|
120
|
+
files: Record<string, OwnershipSavedFile>;
|
|
121
|
+
expected_agent_statement?: OwnershipStatementV21;
|
|
122
|
+
base_agent_md?: {
|
|
123
|
+
exists: boolean;
|
|
124
|
+
raw: string;
|
|
125
|
+
sha256: string;
|
|
126
|
+
etag: string;
|
|
127
|
+
statement: OwnershipStatementV21 | null;
|
|
128
|
+
};
|
|
129
|
+
base_owner_md?: {
|
|
130
|
+
exists: boolean;
|
|
131
|
+
raw: string;
|
|
132
|
+
sha256: string;
|
|
133
|
+
};
|
|
134
|
+
authorization_sha256?: string;
|
|
135
|
+
expires_at?: number;
|
|
136
|
+
persist(): Promise<void>;
|
|
137
|
+
}
|
|
138
|
+
export interface OwnershipFileDependencies {
|
|
139
|
+
currentAid(): AID;
|
|
140
|
+
currentType?(): string;
|
|
141
|
+
now(): number;
|
|
142
|
+
readAgentMdFresh(subAid: string): Promise<OwnershipAgentObservation>;
|
|
143
|
+
submitAgentMdRaw(subAid: string, raw: string, condition: OwnershipSavedFile['condition']): Promise<OwnershipAgentObservation>;
|
|
144
|
+
readOwnerMd(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
145
|
+
writeOwnerMd(ownerAid: string, subAid: string, raw: string): Promise<OwnershipOwnerObservation>;
|
|
146
|
+
deleteOwnerMd(ownerAid: string, subAid: string): Promise<unknown>;
|
|
147
|
+
resolveCertificate(aid: string, fingerprint: string, purpose?: 'signing' | 'group_identity'): Promise<OwnershipCertificate>;
|
|
148
|
+
}
|
|
149
|
+
export declare function ownershipFailure(code: string, reason: string, retryable?: boolean): StateError;
|
|
150
|
+
export declare function requireOwnershipApplicable(type: unknown): void;
|
|
151
|
+
export declare class OwnershipFiles {
|
|
152
|
+
private readonly deps;
|
|
153
|
+
constructor(deps: OwnershipFileDependencies);
|
|
154
|
+
checkConsensus(subAid: string, target?: {
|
|
155
|
+
owner_aid: string;
|
|
156
|
+
relation_version: number;
|
|
157
|
+
}): Promise<OwnershipConsensusResult>;
|
|
158
|
+
declareSubaid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
159
|
+
declareOwneraid(task: OwnershipFileTask): Promise<OwnershipAgentObservation>;
|
|
160
|
+
revokeSubaid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
161
|
+
revokeOwneraid(task: OwnershipFileTask): Promise<OwnershipAgentObservation>;
|
|
162
|
+
transferOwneraid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
163
|
+
cleanupOwnerFile(task: OwnershipFileTask): Promise<void>;
|
|
164
|
+
readAgent(subAid: string): Promise<OwnershipAgentObservation>;
|
|
165
|
+
readOwner(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
166
|
+
verifyFile(raw: string, role: OwnershipFileRole, subAid: string, ownerAid?: string): Promise<OwnershipFile>;
|
|
167
|
+
requireTransfer(task: OwnershipFileTask): Promise<OwnershipFile>;
|
|
168
|
+
private targetOwner;
|
|
169
|
+
private requireLocal;
|
|
170
|
+
private statement;
|
|
171
|
+
private assertBase;
|
|
172
|
+
private requireOriginal;
|
|
173
|
+
private savedFile;
|
|
174
|
+
private validSavedCondition;
|
|
175
|
+
private publishOwner;
|
|
176
|
+
private publishAgent;
|
|
177
|
+
}
|
|
178
|
+
interface OwnershipStorageDependencies {
|
|
179
|
+
currentAid(): string;
|
|
180
|
+
call(method: string, params: Record<string, unknown>): Promise<unknown>;
|
|
181
|
+
httpPut?(url: string, data: Uint8Array, headers?: Record<string, string>): Promise<void>;
|
|
182
|
+
now?(): number;
|
|
183
|
+
}
|
|
184
|
+
export declare class OwnershipStorageAdapter {
|
|
185
|
+
private readonly deps;
|
|
186
|
+
constructor(deps: OwnershipStorageDependencies);
|
|
187
|
+
private now;
|
|
188
|
+
private call;
|
|
189
|
+
private metadata;
|
|
190
|
+
readObject(ownerAid: string, path: string): Promise<OwnershipOwnerObservation>;
|
|
191
|
+
readOwnerMd(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
192
|
+
writeOwnerMd(ownerAid: string, subAid: string, raw: string): Promise<OwnershipOwnerObservation>;
|
|
193
|
+
deleteOwnerMd(ownerAid: string, subAid: string): Promise<void>;
|
|
194
|
+
private requireLocal;
|
|
195
|
+
}
|
|
196
|
+
export {};
|