@agentunion/fastaun 0.5.17 → 0.5.19
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 +83 -0
- package/_packed_docs/CHANGELOG.md +83 -0
- package/_packed_docs/INDEX.md +163 -16
- package/_packed_docs/KITE_DOCS_GUIDE.md +52 -20
- package/_packed_docs/agent.md/SCHEMA.md +266 -207
- 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 +64 -31
- package/_packed_docs/aun/346/265/213/350/257/225/350/277/220/350/241/214/346/214/207/345/215/227.md +8 -6
- 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 +39 -39
- 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 +1 -1
- package/_packed_docs/protocol/10-Group-/345/255/220/345/215/217/350/256/256.md +28 -9
- package/_packed_docs/protocol/11-Storage-/345/255/220/345/215/217/350/256/256.md +20 -2
- package/_packed_docs/protocol/agent.md/SCHEMA.md +4 -0
- package/_packed_docs/sdk/04-/350/277/236/346/216/245/344/270/216/350/256/244/350/257/201.md +5 -2
- package/_packed_docs/sdk/06-API/346/211/213/345/206/214.md +246 -241
- package/_packed_docs/sdk/09-group-rpc-manual.md +46 -14
- package/_packed_docs/sdk/09-message-rpc-manual.md +40 -2
- package/_packed_docs/sdk/09-storage-rpc-manual.md +69 -38
- package/_packed_docs/sdk/AUN_DOCS_GUIDE.md +25 -5
- package/_packed_docs/sdk/INDEX.md +78 -18
- package/dist/agent-md-schema.d.ts +2 -0
- package/dist/agent-md-schema.js +46 -9
- package/dist/agent-md-schema.js.map +1 -1
- package/dist/agent-md.d.ts +46 -1
- package/dist/agent-md.js +492 -30
- package/dist/agent-md.js.map +1 -1
- package/dist/aid-store.d.ts +9 -1
- package/dist/aid-store.js +139 -18
- package/dist/aid-store.js.map +1 -1
- package/dist/aid.d.ts +17 -1
- package/dist/aid.js +67 -7
- package/dist/aid.js.map +1 -1
- package/dist/auth.d.ts +6 -1
- package/dist/auth.js +428 -15
- package/dist/auth.js.map +1 -1
- package/dist/cert-utils.d.ts +1 -1
- package/dist/cert-utils.js +19 -7
- package/dist/cert-utils.js.map +1 -1
- package/dist/client/delivery.d.ts +4 -1
- package/dist/client/delivery.js +264 -68
- package/dist/client/delivery.js.map +1 -1
- package/dist/client/rpc-pipeline.js +29 -14
- package/dist/client/rpc-pipeline.js.map +1 -1
- package/dist/client/v2-e2ee.d.ts +8 -1
- package/dist/client/v2-e2ee.js +893 -529
- package/dist/client/v2-e2ee.js.map +1 -1
- package/dist/client.d.ts +87 -1
- package/dist/client.js +816 -35
- 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 +5 -1
- package/dist/events.js +47 -6
- package/dist/events.js.map +1 -1
- package/dist/facades.d.ts +85 -3
- package/dist/facades.js +104 -4
- package/dist/facades.js.map +1 -1
- package/dist/index.d.ts +9 -4
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/keystore/aid-db.d.ts +5 -0
- package/dist/keystore/aid-db.js +48 -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 +1689 -0
- package/dist/org-protocol.js.map +1 -0
- package/dist/ownership-proof.d.ts +117 -0
- package/dist/ownership-proof.js +436 -0
- package/dist/ownership-proof.js.map +1 -0
- package/dist/ownership-v21.d.ts +178 -0
- package/dist/ownership-v21.js +635 -0
- package/dist/ownership-v21.js.map +1 -0
- package/dist/ownership-workflow.d.ts +82 -0
- package/dist/ownership-workflow.js +872 -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 +89 -1
- package/dist/tools/cross-sdk-agent.js +338 -7
- package/dist/tools/cross-sdk-agent.js.map +1 -1
- package/dist/transport.d.ts +7 -0
- package/dist/transport.js +108 -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 +8 -8
|
@@ -0,0 +1,178 @@
|
|
|
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
|
+
}
|
|
29
|
+
export interface OwnershipCertificate {
|
|
30
|
+
cert_pem: string;
|
|
31
|
+
chain_valid: boolean;
|
|
32
|
+
state: string;
|
|
33
|
+
revoked: boolean;
|
|
34
|
+
revocation_checked: boolean;
|
|
35
|
+
observed_at: number;
|
|
36
|
+
}
|
|
37
|
+
export interface OwnershipFile {
|
|
38
|
+
raw: Uint8Array;
|
|
39
|
+
payload: string;
|
|
40
|
+
frontmatter: Record<string, unknown>;
|
|
41
|
+
signature: Record<string, string> | null;
|
|
42
|
+
statement?: OwnershipStatementV21;
|
|
43
|
+
action?: 'declare' | 'release' | 'transfer_owner';
|
|
44
|
+
transfer?: OwnershipTransferV21;
|
|
45
|
+
}
|
|
46
|
+
export interface OwnershipConsensusResult {
|
|
47
|
+
status: OwnershipConsensusStatus;
|
|
48
|
+
sub_aid: string;
|
|
49
|
+
owner_aid: string | null;
|
|
50
|
+
relation_version: number;
|
|
51
|
+
lock: 'locked' | 'unlocked';
|
|
52
|
+
agent_md_etag: string;
|
|
53
|
+
agent_md_sha256: string;
|
|
54
|
+
owner_md_revision: 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
|
+
revision: string;
|
|
88
|
+
observed_at: number;
|
|
89
|
+
sha256?: string;
|
|
90
|
+
content: string;
|
|
91
|
+
authoritative: boolean;
|
|
92
|
+
recovery_ready?: boolean;
|
|
93
|
+
service_aid: string;
|
|
94
|
+
authenticated_service_aid: string;
|
|
95
|
+
}
|
|
96
|
+
export interface OwnershipSavedFile {
|
|
97
|
+
raw: string;
|
|
98
|
+
hash: string;
|
|
99
|
+
condition: {
|
|
100
|
+
expected_revision?: string;
|
|
101
|
+
if_match?: string;
|
|
102
|
+
if_none_match?: string;
|
|
103
|
+
};
|
|
104
|
+
published_revision?: string;
|
|
105
|
+
expires_at?: number;
|
|
106
|
+
deleted?: boolean;
|
|
107
|
+
}
|
|
108
|
+
export interface OwnershipFileTask {
|
|
109
|
+
operation_id?: string;
|
|
110
|
+
operation: 'bind' | 'release' | 'transfer';
|
|
111
|
+
sub_aid: string;
|
|
112
|
+
owner_aid: string;
|
|
113
|
+
new_owner_aid?: string;
|
|
114
|
+
base_relation_version: number;
|
|
115
|
+
target_relation_version: number;
|
|
116
|
+
files: Record<string, OwnershipSavedFile>;
|
|
117
|
+
authorization_sha256?: string;
|
|
118
|
+
expires_at?: number;
|
|
119
|
+
persist(): Promise<void>;
|
|
120
|
+
}
|
|
121
|
+
export interface OwnershipFileDependencies {
|
|
122
|
+
currentAid(): AID;
|
|
123
|
+
currentType?(): string;
|
|
124
|
+
now(): number;
|
|
125
|
+
readAgentMdFresh(subAid: string): Promise<OwnershipAgentObservation>;
|
|
126
|
+
submitAgentMdRaw(subAid: string, raw: string, condition: OwnershipSavedFile['condition']): Promise<OwnershipAgentObservation>;
|
|
127
|
+
readOwnerMd(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
128
|
+
writeOwnerMd(ownerAid: string, subAid: string, raw: string, originalRevision: string): Promise<OwnershipOwnerObservation>;
|
|
129
|
+
deleteOwnerMd(ownerAid: string, subAid: string, originalRevision: string): Promise<unknown>;
|
|
130
|
+
resolveCertificate(aid: string, fingerprint: string, purpose?: 'signing' | 'group_identity'): Promise<OwnershipCertificate>;
|
|
131
|
+
}
|
|
132
|
+
export declare function ownershipFailure(code: string, reason: string, retryable?: boolean): StateError;
|
|
133
|
+
export declare function requireOwnershipApplicable(type: unknown): void;
|
|
134
|
+
export declare class OwnershipFiles {
|
|
135
|
+
private readonly deps;
|
|
136
|
+
constructor(deps: OwnershipFileDependencies);
|
|
137
|
+
checkConsensus(subAid: string, target?: {
|
|
138
|
+
owner_aid: string;
|
|
139
|
+
relation_version: number;
|
|
140
|
+
}): Promise<OwnershipConsensusResult>;
|
|
141
|
+
declareSubaid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
142
|
+
declareOwneraid(task: OwnershipFileTask): Promise<OwnershipAgentObservation>;
|
|
143
|
+
revokeSubaid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
144
|
+
revokeOwneraid(task: OwnershipFileTask): Promise<OwnershipAgentObservation>;
|
|
145
|
+
transferOwneraid(task: OwnershipFileTask): Promise<OwnershipOwnerObservation>;
|
|
146
|
+
cleanupOwnerFile(task: OwnershipFileTask): Promise<void>;
|
|
147
|
+
readAgent(subAid: string): Promise<OwnershipAgentObservation>;
|
|
148
|
+
readOwner(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
149
|
+
verifyFile(raw: string, role: OwnershipFileRole, subAid: string, ownerAid?: string): Promise<OwnershipFile>;
|
|
150
|
+
requireTransfer(task: OwnershipFileTask): Promise<OwnershipFile>;
|
|
151
|
+
private targetOwner;
|
|
152
|
+
private requireLocal;
|
|
153
|
+
private statement;
|
|
154
|
+
private assertBase;
|
|
155
|
+
private requireOriginal;
|
|
156
|
+
private savedFile;
|
|
157
|
+
private validSavedCondition;
|
|
158
|
+
private publishOwner;
|
|
159
|
+
private publishAgent;
|
|
160
|
+
}
|
|
161
|
+
interface OwnershipStorageDependencies {
|
|
162
|
+
currentAid(): string;
|
|
163
|
+
call(method: string, params: Record<string, unknown>): Promise<unknown>;
|
|
164
|
+
now?(): number;
|
|
165
|
+
}
|
|
166
|
+
export declare class OwnershipStorageAdapter {
|
|
167
|
+
private readonly deps;
|
|
168
|
+
constructor(deps: OwnershipStorageDependencies);
|
|
169
|
+
private now;
|
|
170
|
+
private call;
|
|
171
|
+
private metadata;
|
|
172
|
+
readObject(ownerAid: string, path: string): Promise<OwnershipOwnerObservation>;
|
|
173
|
+
readOwnerMd(ownerAid: string, subAid: string): Promise<OwnershipOwnerObservation>;
|
|
174
|
+
writeOwnerMd(ownerAid: string, subAid: string, raw: string, originalRevision: string): Promise<OwnershipOwnerObservation>;
|
|
175
|
+
deleteOwnerMd(ownerAid: string, subAid: string, originalRevision: string): Promise<void>;
|
|
176
|
+
private requireLocal;
|
|
177
|
+
}
|
|
178
|
+
export {};
|