@the-ai-company/cbio-node-runtime 1.21.0 → 1.22.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/README.md +2 -1
- package/dist/runtime/index.d.ts +2 -1
- package/dist/runtime/index.js +1 -1
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/private-vault.d.ts +12 -0
- package/dist/runtime/private-vault.js +42 -0
- package/dist/runtime/private-vault.js.map +1 -1
- package/docs/REFERENCE.md +4 -0
- package/docs/es/README.md +2 -1
- package/docs/fr/README.md +2 -1
- package/docs/ja/README.md +2 -1
- package/docs/ko/README.md +2 -1
- package/docs/pt/README.md +2 -1
- package/docs/zh/README.md +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -71,7 +71,8 @@ const childIdentity = await createChildIdentity(storage, rootIdentity, {
|
|
|
71
71
|
nickname: 'worker-1',
|
|
72
72
|
});
|
|
73
73
|
|
|
74
|
-
const profile = await
|
|
74
|
+
const profile = await readIdentityMetadata(storage, rootIdentity.identityId); // Public Discovery
|
|
75
|
+
const fullProfile = await readIdentityMetadata(storage, rootIdentity.identityId, rootIdentity.privateKey); // Full Authorized Profile
|
|
75
76
|
const children = await readIdentityPrivateVaultChildrenState(storage, rootIdentity.privateKey);
|
|
76
77
|
```
|
|
77
78
|
|
package/dist/runtime/index.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export { createIdentity, deriveChildIdentity, restoreIdentity, type CreateIdenti
|
|
|
12
12
|
export { createChildIdentity, type CreateChildIdentityOptions, } from "./child-identity.js";
|
|
13
13
|
export { readVaultProfile, writeVaultProfile, type VaultProfile, } from "./vault-metadata.js";
|
|
14
14
|
export { createWorkspaceStorage, getDefaultWorkspaceDir, } from "./workspace-storage.js";
|
|
15
|
-
export { ensureIdentityPrivateVault, readIdentityPrivateVaultProfile, readIdentityPrivateVaultChildrenState, identityPrivateVaultPrefix, identityPrivateVaultProfileKey, identityPrivateVaultChildrenKey, type IdentityPrivateVaultProfile, type IdentityPrivateVaultChildRecord, type IdentityPrivateVaultChildrenState, } from "./private-vault.js";
|
|
15
|
+
export { ensureIdentityPrivateVault, readIdentityPrivateVaultProfile, readIdentityPrivateVaultChildrenState, readIdentityMetadata, identityPrivateVaultPrefix, identityPrivateVaultProfileKey, identityPrivateVaultChildrenKey, type IdentityPrivateVaultProfile, type IdentityPrivateVaultChildRecord, type IdentityPrivateVaultChildrenState, type IdentityPublicProfile, } from "./private-vault.js";
|
|
16
16
|
export { createVault, recoverVault, type CreateVaultOptions, type CreatedVault, type RecoverVaultOptions, type RecoveredVault, type VaultObject, } from "./bootstrap.js";
|
|
17
17
|
export { createVaultCore, DefaultVaultCore, VaultCoreError, createDefaultVaultCoreDependencies, type CreateDefaultVaultCoreDependenciesOptions, type DefaultPolicyEngineOptions, DefaultPolicyEngine, createPersistentVaultCoreDependencies, initializeVaultCustody, recoverVaultWorkingKey, DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY, type InitializeVaultCustodyOptions, type InitializedVaultCustody, type CreatePersistentVaultCoreDependenciesOptions, PersistentVaultAgentIdentityRegistry, PersistentVaultAuditLog, PersistentVaultOwnerIdentityRegistry, PersistentVaultCapabilityRegistry, PersistentVaultCapabilityRevocationRegistry, PersistentVaultCustomHttpFlowRegistry, PersistentVaultRateLimitStore, PersistentVaultReplayGuard, PersistentVaultSecretCustody, PersistentVaultSecretRepository, HttpDispatchExecutor, InMemoryAgentIdentityRegistry, InMemoryCapabilityRegistry, InMemoryCapabilityRevocationRegistry, InMemoryCustomHttpFlowRegistry, InMemoryRateLimitStore, InMemoryReplayGuard, InMemoryAuditLog, InMemoryOwnerIdentityRegistry, InMemorySecretCustody, InMemorySecretRepository, RandomIdGenerator, SignatureOwnerProofVerifier, type SignatureAgentProofVerifierOptions, SignatureAgentProofVerifier, SystemClock, type AgentCapability, type AgentIdentityRecord, type AgentProof, type OwnerAuditRequest, type OwnerExportSecretRequest, type OwnerDefineSecretTargetsCommand, type OwnerRegisterCapabilityCommand, type OwnerRegisterAgentIdentityCommand, type OwnerRegisterCustomHttpFlowCommand, type OwnerSecretExport, type OwnerIdentityRecord, type CustomHttpFlowDefinition, type OwnerProof, type AuditEntry, type AuditLog, type AuditQuery, type Clock, type DispatchAuthorization, type DispatchInstruction, type DispatchRequest, type DispatchResult, type IdGenerator, type OwnerIdentityRegistry, type OwnerProofVerifier, type PolicyEngine, type RateLimitStore, type ReplayGuard, type CustomHttpFlowRegistry, type SecretAlias, type SecretCustody, type SecretId, type SecretRecord, type SecretRepository, type SecretVersion, type TrustedExecutor, type VaultCore, type VaultCoreDependencies, type VaultPrincipal, type VaultPrincipalKind, type VaultTargetBinding, type VaultWriteSecretCommand, type VaultId, type AgentIdentityRegistry, type AgentProofVerifier, type CapabilityRevocationRegistry, type CapabilityRegistry, } from "../vault-core/index.js";
|
|
18
18
|
export { createVaultClient, type VaultClient, type CreateVaultClientOptions, type VaultIdentity, type VaultSigner, type VaultAuditQueryInput, type OwnerDefineSecretTargetsInput, type VaultExportSecretInput, type VaultGrantCapabilityInput, type VaultRegisterFlowInput, type VaultRegisterAgentInput, type OwnerSecretTargetBinding, type OwnerStoreSecretInput, type OwnerWriteSecretInput, } from "../clients/owner/index.js";
|
|
@@ -37,6 +37,7 @@ export interface CbioRuntime {
|
|
|
37
37
|
ensureIdentityPrivateVault: typeof import("./private-vault.js").ensureIdentityPrivateVault;
|
|
38
38
|
readIdentityPrivateVaultProfile: typeof import("./private-vault.js").readIdentityPrivateVaultProfile;
|
|
39
39
|
readIdentityPrivateVaultChildrenState: typeof import("./private-vault.js").readIdentityPrivateVaultChildrenState;
|
|
40
|
+
readIdentityMetadata: typeof import("./private-vault.js").readIdentityMetadata;
|
|
40
41
|
createVault: typeof import("./bootstrap.js").createVault;
|
|
41
42
|
recoverVault: typeof import("./bootstrap.js").recoverVault;
|
|
42
43
|
createVaultClient: typeof import("../clients/owner/index.js").createVaultClient;
|
package/dist/runtime/index.js
CHANGED
|
@@ -11,7 +11,7 @@ export { createIdentity, deriveChildIdentity, restoreIdentity, } from "./identit
|
|
|
11
11
|
export { createChildIdentity, } from "./child-identity.js";
|
|
12
12
|
export { readVaultProfile, writeVaultProfile, } from "./vault-metadata.js";
|
|
13
13
|
export { createWorkspaceStorage, getDefaultWorkspaceDir, } from "./workspace-storage.js";
|
|
14
|
-
export { ensureIdentityPrivateVault, readIdentityPrivateVaultProfile, readIdentityPrivateVaultChildrenState, identityPrivateVaultPrefix, identityPrivateVaultProfileKey, identityPrivateVaultChildrenKey, } from "./private-vault.js";
|
|
14
|
+
export { ensureIdentityPrivateVault, readIdentityPrivateVaultProfile, readIdentityPrivateVaultChildrenState, readIdentityMetadata, identityPrivateVaultPrefix, identityPrivateVaultProfileKey, identityPrivateVaultChildrenKey, } from "./private-vault.js";
|
|
15
15
|
export { createVault, recoverVault, } from "./bootstrap.js";
|
|
16
16
|
export { createVaultCore, DefaultVaultCore, VaultCoreError, createDefaultVaultCoreDependencies, DefaultPolicyEngine, createPersistentVaultCoreDependencies, initializeVaultCustody, recoverVaultWorkingKey, DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY, PersistentVaultAgentIdentityRegistry, PersistentVaultAuditLog, PersistentVaultOwnerIdentityRegistry, PersistentVaultCapabilityRegistry, PersistentVaultCapabilityRevocationRegistry, PersistentVaultCustomHttpFlowRegistry, PersistentVaultRateLimitStore, PersistentVaultReplayGuard, PersistentVaultSecretCustody, PersistentVaultSecretRepository, HttpDispatchExecutor, InMemoryAgentIdentityRegistry, InMemoryCapabilityRegistry, InMemoryCapabilityRevocationRegistry, InMemoryCustomHttpFlowRegistry, InMemoryRateLimitStore, InMemoryReplayGuard, InMemoryAuditLog, InMemoryOwnerIdentityRegistry, InMemorySecretCustody, InMemorySecretRepository, RandomIdGenerator, SignatureOwnerProofVerifier, SignatureAgentProofVerifier, SystemClock, } from "../vault-core/index.js";
|
|
17
17
|
export { createVaultClient, } from "../clients/owner/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,GAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,GAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,GAElB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,+BAA+B,EAC/B,qCAAqC,EACrC,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,eAAe,GAKhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,mBAAmB,GAEpB,MAAM,qBAAqB,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|
18
18
|
nextChildIndex: number;
|
|
19
19
|
children: IdentityPrivateVaultChildRecord[];
|
|
20
20
|
}
|
|
21
|
+
export interface IdentityPublicProfile {
|
|
22
|
+
identityId: string;
|
|
23
|
+
publicKey: string;
|
|
24
|
+
nickname?: string;
|
|
25
|
+
parentIdentityId?: string;
|
|
26
|
+
}
|
|
21
27
|
type IdentityPrivateVaultAccess = CreatedIdentity | string;
|
|
22
28
|
export declare function identityPrivateVaultPrefix(identityId: string): string;
|
|
23
29
|
export declare function identityPrivateVaultProfileKey(identityId: string): string;
|
|
24
30
|
export declare function identityPrivateVaultChildrenKey(identityId: string): string;
|
|
31
|
+
export declare function identityPrivateVaultPublicProfileKey(identityId: string): string;
|
|
25
32
|
export declare function ensureIdentityPrivateVault(storage: IStorageProvider, identity: CreatedIdentity): Promise<void>;
|
|
26
33
|
export declare function readIdentityPrivateVaultProfile(storage: IStorageProvider, identityOrPrivateKey: IdentityPrivateVaultAccess): Promise<IdentityPrivateVaultProfile | null>;
|
|
34
|
+
/**
|
|
35
|
+
* Unified metadata reader for identities.
|
|
36
|
+
* Handles both open discovery (identityId only) and authorized read (privateKey).
|
|
37
|
+
*/
|
|
38
|
+
export declare function readIdentityMetadata(storage: IStorageProvider, identityId: string, privateKey?: string): Promise<IdentityPrivateVaultProfile | IdentityPublicProfile | null>;
|
|
27
39
|
export declare function readIdentityPrivateVaultChildrenState(storage: IStorageProvider, identityOrPrivateKey: IdentityPrivateVaultAccess): Promise<IdentityPrivateVaultChildrenState>;
|
|
28
40
|
export declare function writeIdentityPrivateVaultChildrenState(storage: IStorageProvider, identityOrPrivateKey: IdentityPrivateVaultAccess, state: IdentityPrivateVaultChildrenState): Promise<void>;
|
|
29
41
|
export declare function withIdentityPrivateVaultLock<T>(storage: IStorageProvider, identityOrPrivateKey: IdentityPrivateVaultAccess, task: () => Promise<T>): Promise<T>;
|
|
@@ -12,6 +12,9 @@ export function identityPrivateVaultProfileKey(identityId) {
|
|
|
12
12
|
export function identityPrivateVaultChildrenKey(identityId) {
|
|
13
13
|
return `${identityPrivateVaultPrefix(identityId)}/sealed/children.sealed`;
|
|
14
14
|
}
|
|
15
|
+
export function identityPrivateVaultPublicProfileKey(identityId) {
|
|
16
|
+
return `${identityPrivateVaultPrefix(identityId)}/public/profile.json`;
|
|
17
|
+
}
|
|
15
18
|
function lockKey(identityId) {
|
|
16
19
|
return `${identityPrivateVaultPrefix(identityId)}/sealed/locks/vault${PRIVATE_VAULT_LOCK_SUFFIX}`;
|
|
17
20
|
}
|
|
@@ -40,6 +43,14 @@ export async function ensureIdentityPrivateVault(storage, identity) {
|
|
|
40
43
|
};
|
|
41
44
|
const profileRepo = new SealedJsonRepository(storage, identityPrivateVaultProfileKey(identity.identityId), deriveIdentityPrivateVaultKey(identity));
|
|
42
45
|
await profileRepo.write(profile, "identity_private_vault_profile");
|
|
46
|
+
// Write public profile mirror (Plaintext)
|
|
47
|
+
const publicProfile = {
|
|
48
|
+
identityId: profile.identityId,
|
|
49
|
+
publicKey: profile.publicKey,
|
|
50
|
+
nickname: profile.nickname,
|
|
51
|
+
parentIdentityId: profile.parentIdentityId,
|
|
52
|
+
};
|
|
53
|
+
await storage.write(identityPrivateVaultPublicProfileKey(identity.identityId), Buffer.from(JSON.stringify(publicProfile, null, 2)));
|
|
43
54
|
const childrenKey = identityPrivateVaultChildrenKey(identity.identityId);
|
|
44
55
|
if (!(await storage.has(childrenKey))) {
|
|
45
56
|
const emptyState = {
|
|
@@ -55,6 +66,37 @@ export async function readIdentityPrivateVaultProfile(storage, identityOrPrivate
|
|
|
55
66
|
const repo = new SealedJsonRepository(storage, identityPrivateVaultProfileKey(identity.identityId), deriveIdentityPrivateVaultKey(identity));
|
|
56
67
|
return repo.read(null);
|
|
57
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Unified metadata reader for identities.
|
|
71
|
+
* Handles both open discovery (identityId only) and authorized read (privateKey).
|
|
72
|
+
*/
|
|
73
|
+
export async function readIdentityMetadata(storage, identityId, privateKey) {
|
|
74
|
+
// If private key is provided, we prefer the full sealed profile
|
|
75
|
+
if (privateKey) {
|
|
76
|
+
try {
|
|
77
|
+
const identity = restoreIdentity(privateKey);
|
|
78
|
+
if (identity.identityId !== identityId) {
|
|
79
|
+
throw new Error("identityId mismatch");
|
|
80
|
+
}
|
|
81
|
+
return await readIdentityPrivateVaultProfile(storage, identity);
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
// Fallback to public if privateKey is invalid or decryption fails
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
// Otherwise, read the public discovery profile
|
|
88
|
+
const publicPath = identityPrivateVaultPublicProfileKey(identityId);
|
|
89
|
+
const publicData = await storage.read(publicPath);
|
|
90
|
+
if (publicData) {
|
|
91
|
+
try {
|
|
92
|
+
return JSON.parse(publicData.toString());
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return null;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
58
100
|
export async function readIdentityPrivateVaultChildrenState(storage, identityOrPrivateKey) {
|
|
59
101
|
const identity = normalizeIdentityAccess(identityOrPrivateKey);
|
|
60
102
|
const repo = new SealedJsonRepository(storage, identityPrivateVaultChildrenKey(identity.identityId), deriveIdentityPrivateVaultKey(identity));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"private-vault.js","sourceRoot":"","sources":["../../src/runtime/private-vault.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAwB,MAAM,eAAe,CAAC;AAEtE,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAC1C,MAAM,yBAAyB,GAAG,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"private-vault.js","sourceRoot":"","sources":["../../src/runtime/private-vault.ts"],"names":[],"mappings":"AAAA,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U,CAAC,EAAE,IAAI,CAAC,CAAC;IAC9D,CAAC;IACD,OAAO,IAAI,EAAE,CAAC;AAChB,CAAC"}
|
package/docs/REFERENCE.md
CHANGED
|
@@ -92,6 +92,10 @@ Those files are encrypted at rest in the `sealed/` sub-directory and are not rea
|
|
|
92
92
|
`readIdentityPrivateVaultProfile(storage, identityOrPrivateKey)` decrypts and returns the current identity profile for the supplied identity or private key.
|
|
93
93
|
|
|
94
94
|
`readIdentityPrivateVaultChildrenState(storage, identityOrPrivateKey)` decrypts and returns the child index state for the supplied identity or private key.
|
|
95
|
+
|
|
96
|
+
`readIdentityMetadata(storage, identityId, [privateKey])` is the unified metadata reader.
|
|
97
|
+
If `privateKey` is provided, it returns the full sealed profile.
|
|
98
|
+
If `privateKey` is missing, it returns the public discovery profile (nickname, publicKey, parentIdentityId).
|
|
95
99
|
|
|
96
100
|
Typical relationship lookup flow when you already have a private key:
|
|
97
101
|
|
package/docs/es/README.md
CHANGED
package/docs/fr/README.md
CHANGED
package/docs/ja/README.md
CHANGED
package/docs/ko/README.md
CHANGED
package/docs/pt/README.md
CHANGED
package/docs/zh/README.md
CHANGED
package/package.json
CHANGED