@the-ai-company/cbio-node-runtime 1.63.2 → 1.63.5
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 +48 -209
- package/dist/clients/agent/client.d.ts +18 -40
- package/dist/clients/agent/client.js +22 -109
- package/dist/clients/agent/client.js.map +1 -1
- package/dist/clients/agent/contracts.d.ts +1 -8
- package/dist/clients/agent/index.d.ts +1 -1
- package/dist/clients/owner/client.d.ts +2 -102
- package/dist/clients/owner/client.js +119 -240
- package/dist/clients/owner/client.js.map +1 -1
- package/dist/clients/owner/contracts.d.ts +37 -70
- package/dist/clients/owner/index.d.ts +2 -4
- package/dist/clients/owner/index.js +1 -2
- package/dist/clients/owner/index.js.map +1 -1
- package/dist/internal/id-factory.d.ts +0 -2
- package/dist/internal/id-factory.js +0 -6
- package/dist/internal/id-factory.js.map +1 -1
- package/dist/protocol/identity.d.ts +1 -1
- package/dist/protocol/identity.js +3 -3
- package/dist/protocol/identity.js.map +1 -1
- package/dist/public-types.d.ts +5 -0
- package/dist/public-types.js +2 -0
- package/dist/public-types.js.map +1 -0
- package/dist/runtime/bootstrap.js.map +1 -1
- package/dist/runtime/identity.d.ts +2 -2
- package/dist/runtime/identity.js +3 -5
- package/dist/runtime/identity.js.map +1 -1
- package/dist/runtime/index.d.ts +10 -11
- package/dist/runtime/index.js +7 -8
- package/dist/runtime/index.js.map +1 -1
- package/dist/runtime/owner-session.d.ts +7 -6
- package/dist/runtime/owner-session.js +5 -6
- package/dist/runtime/owner-session.js.map +1 -1
- package/dist/storage/fs.d.ts +3 -2
- package/dist/storage/fs.js +8 -5
- package/dist/storage/fs.js.map +1 -1
- package/dist/storage/prefix.d.ts +1 -0
- package/dist/storage/prefix.js +7 -0
- package/dist/storage/prefix.js.map +1 -1
- package/dist/storage/provider.d.ts +2 -0
- package/dist/vault-core/contracts.d.ts +112 -193
- package/dist/vault-core/contracts.js +5 -8
- package/dist/vault-core/contracts.js.map +1 -1
- package/dist/vault-core/core.d.ts +127 -62
- package/dist/vault-core/core.js +500 -1182
- package/dist/vault-core/core.js.map +1 -1
- package/dist/vault-core/defaults.d.ts +26 -42
- package/dist/vault-core/defaults.js +73 -229
- package/dist/vault-core/defaults.js.map +1 -1
- package/dist/vault-core/errors.d.ts +3 -2
- package/dist/vault-core/errors.js.map +1 -1
- package/dist/vault-core/index.d.ts +5 -5
- package/dist/vault-core/index.js +2 -2
- package/dist/vault-core/index.js.map +1 -1
- package/dist/vault-core/persistence.d.ts +78 -118
- package/dist/vault-core/persistence.js +329 -421
- package/dist/vault-core/persistence.js.map +1 -1
- package/dist/vault-core/ports.d.ts +19 -24
- package/dist/vault-core/read-policy.d.ts +3 -2
- package/dist/vault-core/read-policy.js.map +1 -1
- package/dist/vault-core/tool-metadata.js +2 -2
- package/dist/vault-core/tool-metadata.js.map +1 -1
- package/dist/vault-ingress/defaults.d.ts +4 -2
- package/dist/vault-ingress/defaults.js +14 -8
- package/dist/vault-ingress/defaults.js.map +1 -1
- package/dist/vault-ingress/index.d.ts +43 -117
- package/dist/vault-ingress/index.js +98 -453
- package/dist/vault-ingress/index.js.map +1 -1
- package/dist/vault-ingress/remote-transport.d.ts +5 -3
- package/dist/vault-ingress/remote-transport.js +8 -28
- package/dist/vault-ingress/remote-transport.js.map +1 -1
- package/docs/ARCHITECTURE.md +39 -22
- package/docs/CUSTODY_MODEL.md +1 -1
- package/docs/IDENTITY_MODEL.md +5 -5
- package/docs/MIGRATION-1.51.md +19 -19
- package/docs/MIGRATION-1.65.md +61 -0
- package/docs/PROCESS_ISOLATION.md +2 -2
- package/docs/REFERENCE.md +42 -200
- package/docs/api/README.md +50 -22
- package/docs/api/classes/IdentityError.md +1 -1
- package/docs/api/classes/OwnerClientError.md +1 -1
- package/docs/api/classes/PersistentVaultAgentIdentityRegistry.md +89 -0
- package/docs/api/classes/PersistentVaultAgentSecretGrantRegistry.md +125 -0
- package/docs/api/classes/PersistentVaultAuditLog.md +65 -0
- package/docs/api/classes/PersistentVaultCustomHttpFlowRegistry.md +69 -0
- package/docs/api/classes/PersistentVaultSecretCustody.md +93 -0
- package/docs/api/classes/PersistentVaultSecretDestinationGrantRegistry.md +125 -0
- package/docs/api/classes/PersistentVaultSecretRepository.md +127 -0
- package/docs/api/classes/VaultCore.md +299 -214
- package/docs/api/classes/VaultCoreError.md +3 -3
- package/docs/api/enumerations/AuditAction.md +143 -0
- package/docs/api/enumerations/AuditOutcome.md +35 -0
- package/docs/api/enumerations/DispatchStatus.md +35 -0
- package/docs/api/enumerations/IdentityErrorCode.md +1 -1
- package/docs/api/enumerations/OwnerClientErrorCode.md +1 -1
- package/docs/api/functions/createAgentClient.md +1 -15
- package/docs/api/functions/createIdentity.md +2 -2
- package/docs/api/functions/createOwnerClient.md +17 -0
- package/docs/api/functions/createOwnerSession.md +1 -1
- package/docs/api/functions/createPersistentVaultCoreDependencies.md +4 -4
- package/docs/api/functions/createVault.md +1 -1
- package/docs/api/functions/createVaultCore.md +1 -1
- package/docs/api/functions/createVaultCoreDependencies.md +1 -1
- package/docs/api/functions/createVaultService.md +5 -9
- package/docs/api/functions/createWorkspaceStorage.md +1 -1
- package/docs/api/functions/deriveRootAgentId.md +17 -0
- package/docs/api/functions/deriveVaultWorkingKeyFromPassword.md +1 -1
- package/docs/api/functions/getDefaultWorkspaceDir.md +1 -1
- package/docs/api/functions/handleVaultAgentControlHttp.md +2 -2
- package/docs/api/functions/handleVaultHttpDispatch.md +2 -2
- package/docs/api/functions/initializeVaultCustody.md +7 -3
- package/docs/api/functions/listVaults.md +1 -1
- package/docs/api/functions/readVaultProfile.md +1 -1
- package/docs/api/functions/recoverVault.md +1 -1
- package/docs/api/functions/recoverVaultWorkingKey.md +4 -8
- package/docs/api/functions/restoreIdentity.md +1 -1
- package/docs/api/functions/updateVaultMetadata.md +1 -1
- package/docs/api/functions/writeVaultProfile.md +1 -1
- package/docs/api/interfaces/AgentClient.md +20 -59
- package/docs/api/interfaces/AgentDispatchIntent.md +1 -1
- package/docs/api/interfaces/AgentDispatchTransport.md +12 -44
- package/docs/api/interfaces/AgentIdentity.md +3 -3
- package/docs/api/interfaces/AgentIdentityRecord.md +47 -0
- package/docs/api/interfaces/AgentRequestResult.md +35 -0
- package/docs/api/interfaces/AgentRuntimeManifest.md +55 -0
- package/docs/api/interfaces/AgentSecretGrant.md +41 -0
- package/docs/api/interfaces/AgentSigner.md +1 -1
- package/docs/api/interfaces/AgentVisibleRequestRecord.md +53 -0
- package/docs/api/interfaces/AgentVisibleSecretRecord.md +65 -0
- package/docs/api/interfaces/AuditEntry.md +83 -0
- package/docs/api/interfaces/CbioRuntime.md +13 -150
- package/docs/api/interfaces/CreateAgentClientOptions.md +4 -10
- package/docs/api/interfaces/CreateIdentityOptions.md +1 -1
- package/docs/api/interfaces/{CreateVaultClientOptions.md → CreateOwnerClientOptions.md} +9 -11
- package/docs/api/interfaces/CreateOwnerSessionOptions.md +3 -117
- package/docs/api/interfaces/CreatePersistentVaultCoreDependenciesOptions.md +3 -131
- package/docs/api/interfaces/CreateVaultOptions.md +1 -121
- package/docs/api/interfaces/CreatedVault.md +2 -2
- package/docs/api/interfaces/CustomHttpFlowDefinition.md +71 -0
- package/docs/api/interfaces/DefaultPolicyEngineOptions.md +1 -13
- package/docs/api/interfaces/DispatchAuthorization.md +43 -0
- package/docs/api/interfaces/DispatchInstruction.md +47 -0
- package/docs/api/interfaces/DispatchRequest.md +83 -0
- package/docs/api/interfaces/DispatchResult.md +53 -0
- package/docs/api/interfaces/IStorageProvider.md +13 -1
- package/docs/api/interfaces/InitializeVaultCustodyOptions.md +31 -11
- package/docs/api/interfaces/InitializedVaultCustody.md +1 -7
- package/docs/api/interfaces/OwnerAgentProvisionResult.md +2 -2
- package/docs/api/interfaces/OwnerClient.md +417 -0
- package/docs/api/interfaces/OwnerCreateSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerRemoveSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerRequestRecord.md +97 -0
- package/docs/api/interfaces/OwnerSensitiveActionConfirmation.md +1 -1
- package/docs/api/interfaces/OwnerSensitiveActionContext.md +1 -1
- package/docs/api/interfaces/OwnerSession.md +3 -3
- package/docs/api/interfaces/OwnerUpdateSecretInput.md +1 -1
- package/docs/api/interfaces/OwnerVisibleRequestRecord.md +73 -0
- package/docs/api/interfaces/RecoverVaultOptions.md +1 -121
- package/docs/api/interfaces/RecoveredVault.md +2 -2
- package/docs/api/interfaces/RequestRecord.md +107 -0
- package/docs/api/interfaces/RestoreIdentityOptions.md +1 -1
- package/docs/api/interfaces/SecretAlias.md +11 -0
- package/docs/api/interfaces/SecretDestinationGrant.md +41 -0
- package/docs/api/interfaces/SecretId.md +11 -0
- package/docs/api/interfaces/SecretRecord.md +89 -0
- package/docs/api/interfaces/Signer.md +1 -1
- package/docs/api/interfaces/VaultApproveDispatchInput.md +3 -9
- package/docs/api/interfaces/VaultAuditQueryInput.md +1 -1
- package/docs/api/interfaces/VaultCoreDependenciesOptions.md +1 -5
- package/docs/api/interfaces/VaultCreateAgentInput.md +1 -1
- package/docs/api/interfaces/VaultExportSecretInput.md +1 -1
- package/docs/api/interfaces/VaultGetRequestInput.md +17 -0
- package/docs/api/interfaces/VaultGrantAgentSecretInput.md +23 -0
- package/docs/api/interfaces/VaultGrantSecretDestinationInput.md +23 -0
- package/docs/api/interfaces/VaultId.md +11 -0
- package/docs/api/interfaces/VaultImportAgentInput.md +1 -1
- package/docs/api/interfaces/VaultIssueSessionTokenInput.md +5 -5
- package/docs/api/interfaces/VaultListAgentsInput.md +1 -1
- package/docs/api/interfaces/VaultListGrantsInput.md +23 -0
- package/docs/api/interfaces/VaultListRequestsInput.md +17 -0
- package/docs/api/interfaces/VaultListSecretsInput.md +1 -1
- package/docs/api/interfaces/VaultMetadata.md +1 -1
- package/docs/api/interfaces/VaultObject.md +2 -2
- package/docs/api/interfaces/VaultPrincipal.md +17 -0
- package/docs/api/interfaces/VaultProfile.md +1 -1
- package/docs/api/interfaces/VaultReadAgentPrivateKeyInput.md +7 -7
- package/docs/api/interfaces/VaultReadSecretPlaintextInput.md +1 -1
- package/docs/api/interfaces/VaultRegisterFlowInput.md +1 -1
- package/docs/api/interfaces/VaultRevokeAgentSecretInput.md +23 -0
- package/docs/api/interfaces/VaultRevokeSecretDestinationInput.md +23 -0
- package/docs/api/interfaces/VaultRevokeSessionTokenInput.md +1 -1
- package/docs/api/interfaces/VaultService.md +547 -0
- package/docs/api/interfaces/VaultUpdateAgentInput.md +7 -7
- package/docs/api/type-aliases/AgentId.md +7 -0
- package/docs/api/type-aliases/CbioRuntimeModule.md +1 -1
- package/docs/api/type-aliases/DispatchApprovalDecision.md +7 -0
- package/docs/api/type-aliases/GrantStatus.md +7 -0
- package/docs/api/type-aliases/SecretLifecycleStatus.md +7 -0
- package/docs/api/type-aliases/VaultPrincipalKind.md +7 -0
- package/docs/api/variables/DEFAULT_VAULT_KEY_CUSTODY_BLOB_KEY.md +2 -2
- package/docs/es/README.md +3 -3
- package/docs/fr/README.md +3 -3
- package/docs/ja/README.md +5 -5
- package/docs/ko/README.md +5 -5
- package/docs/pt/README.md +3 -3
- package/docs/zh/PROCESS_ISOLATION.md +2 -2
- package/docs/zh/README.md +24 -24
- package/examples/process-isolation.ts +26 -35
- package/package.json +3 -2
- package/docs/api/functions/createOwnerHttpFlowBoundary.md +0 -17
- package/docs/api/functions/createStandardAcquireBoundary.md +0 -31
- package/docs/api/functions/createStandardDispatchBoundary.md +0 -23
- package/docs/api/functions/createVaultClient.md +0 -32
- package/docs/api/functions/deriveIdentityId.md +0 -17
- package/docs/api/functions/wrapVaultCoreAsVaultService.md +0 -31
- package/docs/api/interfaces/AgentSubmitCapabilityRequestInput.md +0 -41
- package/docs/api/interfaces/VaultApproveCapabilityRequestInput.md +0 -23
- package/docs/api/interfaces/VaultClient.md +0 -473
- package/docs/api/interfaces/VaultGrantCapabilityInput.md +0 -79
- package/docs/api/interfaces/VaultGrantCapabilityRequest.md +0 -23
- package/docs/api/interfaces/VaultIdentity.md +0 -11
- package/docs/api/interfaces/VaultListCapabilitiesInput.md +0 -17
- package/docs/api/interfaces/VaultRevokeCapabilityInput.md +0 -23
- package/docs/api/interfaces/VaultSigner.md +0 -21
- package/docs/api/interfaces/VaultSubmitCapabilityRequestInput.md +0 -73
- package/docs/api/type-aliases/AgentCapabilityEnvelope.md +0 -7
- package/docs/api/type-aliases/AgentVisibleSecretRecord.md +0 -7
- package/docs/api/type-aliases/OwnerGrantCapabilityInput.md +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.
|
|
1
|
+
[**CBIO Node Runtime Agent API v1.63.5**](../README.md)
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
5
5
|
# Variable: DEFAULT\_VAULT\_KEY\_CUSTODY\_BLOB\_KEY
|
|
6
6
|
|
|
7
|
-
> `const` **DEFAULT\_VAULT\_KEY\_CUSTODY\_BLOB\_KEY**: `"
|
|
7
|
+
> `const` **DEFAULT\_VAULT\_KEY\_CUSTODY\_BLOB\_KEY**: `"master_key.sealed"` = `"master_key.sealed"`
|
package/docs/es/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listVaults,
|
|
24
24
|
recoverVault,
|
|
25
25
|
createOwnerSession,
|
|
26
|
-
|
|
26
|
+
createOwnerClient,
|
|
27
27
|
createAgentClient,
|
|
28
28
|
FsStorageProvider,
|
|
29
29
|
} from '@the-ai-company/cbio-node-runtime';
|
|
@@ -40,8 +40,8 @@ Ruta principal recomendada para vault persistente:
|
|
|
40
40
|
|
|
41
41
|
- crear el vault persistente con `createVault(...)`
|
|
42
42
|
- recuperar el vault persistente con `recoverVault(...)` usando `vaultId` + `password`
|
|
43
|
-
- para GUIs o procesos de larga duración, conservar `createOwnerSession(...)` en lugar de cachear un `
|
|
44
|
-
- usar `
|
|
43
|
+
- para GUIs o procesos de larga duración, conservar `createOwnerSession(...)` en lugar de cachear un `createOwnerClient(...)` crudo
|
|
44
|
+
- usar `createOwnerClient(...)` solo para scripts breves o tareas puntuales en el runtime actual
|
|
45
45
|
|
|
46
46
|
La API antigua centrada en `CbioIdentity` ya no es la superficie principal del producto.
|
|
47
47
|
|
package/docs/fr/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listVaults,
|
|
24
24
|
recoverVault,
|
|
25
25
|
createOwnerSession,
|
|
26
|
-
|
|
26
|
+
createOwnerClient,
|
|
27
27
|
createAgentClient,
|
|
28
28
|
FsStorageProvider,
|
|
29
29
|
} from '@the-ai-company/cbio-node-runtime';
|
|
@@ -40,8 +40,8 @@ Chemin principal recommande pour un vault persistant :
|
|
|
40
40
|
|
|
41
41
|
- créer le coffre persistant avec `createVault(...)`
|
|
42
42
|
- restaurer le coffre persistant avec `recoverVault(...)` via `vaultId` + `password`
|
|
43
|
-
- pour les GUIs ou processus longs, conserver `createOwnerSession(...)` plutôt qu'un `
|
|
44
|
-
- réserver `
|
|
43
|
+
- pour les GUIs ou processus longs, conserver `createOwnerSession(...)` plutôt qu'un `createOwnerClient(...)` brut en cache
|
|
44
|
+
- réserver `createOwnerClient(...)` aux scripts courts ou aux tâches ponctuelles dans le runtime courant
|
|
45
45
|
|
|
46
46
|
L'ancienne API centree sur `CbioIdentity` n'est plus la surface principale du produit.
|
|
47
47
|
|
package/docs/ja/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listVaults,
|
|
24
24
|
recoverVault,
|
|
25
25
|
createOwnerSession,
|
|
26
|
-
|
|
26
|
+
createOwnerClient,
|
|
27
27
|
createAgentClient,
|
|
28
28
|
FsStorageProvider,
|
|
29
29
|
} from '@the-ai-company/cbio-node-runtime';
|
|
@@ -32,16 +32,16 @@ import {
|
|
|
32
32
|
## アーキテクチャ
|
|
33
33
|
|
|
34
34
|
1. secret の平文は `vault-core` の内部にのみ存在します
|
|
35
|
-
2. `clients/owner` は、オーナーによる書き込み、平文エクスポート、監査の読み取り、および **Agent/権限管理** (`listAgents`, `
|
|
35
|
+
2. `clients/owner` は、オーナーによる書き込み、平文エクスポート、監査の読み取り、および **Agent/権限管理** (`listAgents`, `listGrants`, `revokeGrant`) を担当します。
|
|
36
36
|
3. `clients/agent` は agent の signed dispatch request を作ります
|
|
37
|
-
4. `vault-ingress` は vault 境界の内側で
|
|
37
|
+
4. `vault-ingress` は vault 境界の内側で grant 解決と dispatch ingress を扱います
|
|
38
38
|
|
|
39
39
|
推奨される persistent-vault の主経路:
|
|
40
40
|
|
|
41
41
|
- `createVault(...)` で persistent vault を作成する
|
|
42
42
|
- `recoverVault(...)` で `vaultId` と `password` を使って persistent vault を復旧する
|
|
43
|
-
- GUI や長寿命プロセスでは、生の `
|
|
44
|
-
- `
|
|
43
|
+
- GUI や長寿命プロセスでは、生の `createOwnerClient(...)` をキャッシュせず `createOwnerSession(...)` を保持する
|
|
44
|
+
- `createOwnerClient(...)` は短命スクリプトやその runtime 限定の単発処理に使う
|
|
45
45
|
|
|
46
46
|
旧 `CbioIdentity` 中心 API は、もはや主要な公開面ではありません。
|
|
47
47
|
|
package/docs/ko/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listVaults,
|
|
24
24
|
recoverVault,
|
|
25
25
|
createOwnerSession,
|
|
26
|
-
|
|
26
|
+
createOwnerClient,
|
|
27
27
|
createAgentClient,
|
|
28
28
|
FsStorageProvider,
|
|
29
29
|
} from '@the-ai-company/cbio-node-runtime';
|
|
@@ -32,16 +32,16 @@ import {
|
|
|
32
32
|
## 아키텍처
|
|
33
33
|
|
|
34
34
|
1. secret 평문은 `vault-core` 내부에만 존재합니다
|
|
35
|
-
2. `clients/owner`는 소유자 쓰기, 평문 내보내기, 감사 읽기 및 **Agent/권한 관리** (`listAgents`, `
|
|
35
|
+
2. `clients/owner`는 소유자 쓰기, 평문 내보내기, 감사 읽기 및 **Agent/권한 관리** (`listAgents`, `listGrants`, `revokeGrant`)를 담당합니다.
|
|
36
36
|
3. `clients/agent` 는 agent 서명 dispatch 요청을 만듭니다
|
|
37
|
-
4. `vault-ingress` 는 vault 경계 내부에서
|
|
37
|
+
4. `vault-ingress` 는 vault 경계 내부에서 grant 해석과 dispatch ingress 를 처리합니다
|
|
38
38
|
|
|
39
39
|
권장되는 persistent-vault 주 경로:
|
|
40
40
|
|
|
41
41
|
- `createVault(...)` 로 persistent vault 를 생성합니다
|
|
42
42
|
- `recoverVault(...)` 로 `vaultId` 와 `password` 를 사용해 persistent vault 를 복구합니다
|
|
43
|
-
- GUI 나 장수명 프로세스에서는 raw `
|
|
44
|
-
- `
|
|
43
|
+
- GUI 나 장수명 프로세스에서는 raw `createOwnerClient(...)` 를 캐시하지 말고 `createOwnerSession(...)` 을 유지합니다
|
|
44
|
+
- `createOwnerClient(...)` 는 현재 runtime 안의 짧은 스크립트나 일회성 작업에 사용합니다
|
|
45
45
|
|
|
46
46
|
이전 `CbioIdentity` 중심 API 는 더 이상 주요 제품 표면이 아닙니다.
|
|
47
47
|
|
package/docs/pt/README.md
CHANGED
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
listVaults,
|
|
24
24
|
recoverVault,
|
|
25
25
|
createOwnerSession,
|
|
26
|
-
|
|
26
|
+
createOwnerClient,
|
|
27
27
|
createAgentClient,
|
|
28
28
|
FsStorageProvider,
|
|
29
29
|
} from '@the-ai-company/cbio-node-runtime';
|
|
@@ -40,8 +40,8 @@ Caminho principal recomendado para vault persistente:
|
|
|
40
40
|
|
|
41
41
|
- criar o cofre persistente com `createVault(...)`
|
|
42
42
|
- recuperar o cofre persistente com `recoverVault(...)` usando `vaultId` + `password`
|
|
43
|
-
- para GUIs ou processos longos, manter `createOwnerSession(...)` em vez de cachear um `
|
|
44
|
-
- usar `
|
|
43
|
+
- para GUIs ou processos longos, manter `createOwnerSession(...)` em vez de cachear um `createOwnerClient(...)` bruto
|
|
44
|
+
- usar `createOwnerClient(...)` apenas para scripts curtos ou tarefas pontuais no runtime atual
|
|
45
45
|
|
|
46
46
|
A antiga API centrada em `CbioIdentity` nao e mais a superficie principal do produto.
|
|
47
47
|
|
|
@@ -20,8 +20,8 @@ import { createAgentClient, AgentDispatchHttpTransport } from '@the-ai-company/c
|
|
|
20
20
|
const transport = new AgentDispatchHttpTransport('http://localhost:3000/dispatch');
|
|
21
21
|
|
|
22
22
|
const agent = createAgentClient({
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
rootAgentIdentity, // 进程 A 仅持有自己的身份私钥
|
|
24
|
+
grant, // 进程 A 仅了解被授予的权限
|
|
25
25
|
transport,
|
|
26
26
|
});
|
|
27
27
|
|
package/docs/zh/README.md
CHANGED
|
@@ -49,9 +49,9 @@ const vault = await recoverVault(storage, {
|
|
|
49
49
|
|
|
50
50
|
### 3. GUI 的 Owner Session
|
|
51
51
|
|
|
52
|
-
对于 GUI 这类长生命周期进程,应该持有 `OwnerSession`,而不是长期缓存裸 `
|
|
52
|
+
对于 GUI 这类长生命周期进程,应该持有 `OwnerSession`,而不是长期缓存裸 `OwnerClient`。
|
|
53
53
|
|
|
54
|
-
`
|
|
54
|
+
`createOwnerClient(...)` 只负责基于当前 runtime 创建 owner client;它不应该跨 HMR、模块重载或 runtime 替换被长期复用。`OwnerSession` 会提供稳定的 SDK 句柄,并按需重新创建 owner client。
|
|
55
55
|
|
|
56
56
|
```ts
|
|
57
57
|
import { createOwnerSession } from '@the-ai-company/cbio-node-runtime';
|
|
@@ -67,18 +67,19 @@ const createdAgent = await session.withClient((client) =>
|
|
|
67
67
|
|
|
68
68
|
const ownerClient = await session.client();
|
|
69
69
|
const agents = await ownerClient.ownerListAgents();
|
|
70
|
+
// ownerListAgents() 会直接返回每个 agent 当前的 sessionTokens
|
|
70
71
|
|
|
71
72
|
session.invalidate();
|
|
72
73
|
```
|
|
73
74
|
|
|
74
|
-
如果你写的是一次性脚本,`recoverVault(...)` 配合 `
|
|
75
|
+
如果你写的是一次性脚本,`recoverVault(...)` 配合 `createOwnerClient(...)` 仍然是合适的。
|
|
75
76
|
|
|
76
77
|
### 4. 托管 Agent 身份
|
|
77
78
|
|
|
78
79
|
```ts
|
|
79
|
-
import {
|
|
80
|
+
import { createOwnerClient } from '@the-ai-company/cbio-node-runtime';
|
|
80
81
|
|
|
81
|
-
const client =
|
|
82
|
+
const client = createOwnerClient({
|
|
82
83
|
vault: vault.vault,
|
|
83
84
|
passwordVerifier: vault.verifyPassword,
|
|
84
85
|
});
|
|
@@ -87,26 +88,26 @@ const createdAgent = await client.ownerCreateAgent({
|
|
|
87
88
|
nickname: '后台处理插件',
|
|
88
89
|
});
|
|
89
90
|
|
|
90
|
-
const
|
|
91
|
+
const rootAgentId = createdAgent.agent.rootAgentId;
|
|
91
92
|
const sessionToken = createdAgent.sessionToken;
|
|
92
93
|
```
|
|
93
94
|
|
|
94
95
|
### 5. 机密管理
|
|
95
96
|
|
|
96
97
|
```ts
|
|
97
|
-
const record = await client.
|
|
98
|
+
const record = await client.ownerCreateSecret({
|
|
98
99
|
alias: 'api-token',
|
|
99
100
|
plaintext: 'secret-value'
|
|
100
101
|
});
|
|
101
102
|
|
|
102
|
-
await client.
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
await client.ownerGrantAgentSecret({
|
|
104
|
+
rootAgentId,
|
|
105
|
+
secretAlias: 'api-token',
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
await client.ownerGrantSecretDestination({
|
|
109
|
+
secretAlias: 'api-token',
|
|
110
|
+
domain: 'api.example.com',
|
|
110
111
|
});
|
|
111
112
|
```
|
|
112
113
|
|
|
@@ -116,8 +117,7 @@ await client.ownerGrantCapability({
|
|
|
116
117
|
import { createAgentClient } from '@the-ai-company/cbio-node-runtime';
|
|
117
118
|
|
|
118
119
|
const agent = createAgentClient({
|
|
119
|
-
|
|
120
|
-
capability: myCapability,
|
|
120
|
+
rootAgentIdentity: { rootAgentId },
|
|
121
121
|
token: sessionToken.token,
|
|
122
122
|
vault: vault.vault
|
|
123
123
|
});
|
|
@@ -133,8 +133,8 @@ Agent 进程不会直接使用原始私钥执行请求。即使 Agent 拥有身
|
|
|
133
133
|
给 LLM 的直白规则:
|
|
134
134
|
- `agentDispatch(...)` = 立刻尝试执行真实任务
|
|
135
135
|
- `agentDispatch(...)` 必须带一条给 owner 看的 `reason`,说明为什么要发这个请求
|
|
136
|
-
- `
|
|
137
|
-
- `
|
|
136
|
+
- `agentSubmitGrantRequest(...)` = 只申请权限,不会执行任务
|
|
137
|
+
- `agentSubmitGrantRequest(...)` 也必须带 `reason`,说明为什么需要这项权限
|
|
138
138
|
- `agentListRequests()` / `agentGetRequest(...)` = 在请求执行后查看异步结果
|
|
139
139
|
- `ownerListRequests()` / `ownerGetRequest(...)` = owner 查看完整请求记录,用于决定是否放行 read
|
|
140
140
|
- `read.paths` 只控制哪些响应值可见;响应结构始终可见,`['$']` 表示整个 body 都可见
|
|
@@ -142,8 +142,8 @@ Agent 进程不会直接使用原始私钥执行请求。即使 Agent 拥有身
|
|
|
142
142
|
```ts
|
|
143
143
|
const manifest = await agent.agentIntrospect();
|
|
144
144
|
|
|
145
|
-
console.log(manifest.agent.
|
|
146
|
-
console.log(manifest.agent.
|
|
145
|
+
console.log(manifest.agent.rootAgentId);
|
|
146
|
+
console.log(manifest.agent.rootAgentId);
|
|
147
147
|
console.log(manifest.agent.nickname);
|
|
148
148
|
console.log(manifest.capabilities); // 同一组能力载体里包含 write/read 动作状态
|
|
149
149
|
```
|
|
@@ -160,18 +160,18 @@ if (result.status === 'PENDING') {
|
|
|
160
160
|
console.log('触发发现流程:等待所有者审批...');
|
|
161
161
|
}
|
|
162
162
|
|
|
163
|
-
client.
|
|
163
|
+
client.ownerOnGrantState((state) => {
|
|
164
164
|
if (state.writeGrant === null) {
|
|
165
165
|
console.log('收到新的待审批能力状态:', state.requestId);
|
|
166
166
|
}
|
|
167
167
|
});
|
|
168
168
|
|
|
169
|
-
const pending = await client.
|
|
169
|
+
const pending = await client.ownerListGrantStates({ writeGranted: false });
|
|
170
170
|
if (pending.length > 0) {
|
|
171
171
|
await client.ownerAllowAlways({
|
|
172
172
|
requestId: pending[0].requestId
|
|
173
173
|
});
|
|
174
|
-
await client.
|
|
174
|
+
await client.ownerApproveGrantRead({
|
|
175
175
|
requestId: pending[0].requestId,
|
|
176
176
|
read: { paths: ['data.id', 'data.status'] }
|
|
177
177
|
});
|
|
@@ -59,14 +59,13 @@ async function startVaultServer(port: number) {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
// --- Process A: The LLM Agent Logic ---
|
|
62
|
-
async function runAgentDemo(port: number,
|
|
62
|
+
async function runAgentDemo(port: number, agentRecord: any, token: string) {
|
|
63
63
|
// Process A ONLY knows the remote URL and its own Agent Identity.
|
|
64
64
|
// It has NO access to the Vault's master key or storage.
|
|
65
65
|
const transport = new AgentDispatchHttpTransport(`http://localhost:${port}/dispatch`);
|
|
66
66
|
|
|
67
67
|
const agentClient = createAgentClient({
|
|
68
|
-
|
|
69
|
-
capability,
|
|
68
|
+
agentRecord: agentRecord,
|
|
70
69
|
transport,
|
|
71
70
|
token,
|
|
72
71
|
});
|
|
@@ -78,6 +77,7 @@ async function runAgentDemo(port: number, agentIdentity: any, capability: any, t
|
|
|
78
77
|
secretAlias: "api-token",
|
|
79
78
|
targetUrl: "https://httpbin.org/post",
|
|
80
79
|
method: "POST",
|
|
80
|
+
reason: "LLM agent needs to perform isolated dispatch",
|
|
81
81
|
body: JSON.stringify({ message: "Hello from isolated Process A" }),
|
|
82
82
|
});
|
|
83
83
|
|
|
@@ -97,65 +97,56 @@ async function main() {
|
|
|
97
97
|
const { ownerIdentity, vault, server } = await startVaultServer(PORT);
|
|
98
98
|
|
|
99
99
|
// 2. Setup: Owner (in Process B's context) grants permission to an Agent
|
|
100
|
-
const
|
|
100
|
+
const agentRecord = createIdentity({ nickname: "llm-agent-1" });
|
|
101
101
|
|
|
102
|
-
// Owner registers the agent and a
|
|
102
|
+
// Owner registers the agent and a grant (simulated local call for setup)
|
|
103
103
|
await vault.ownerRegisterAgentIdentity({
|
|
104
104
|
vaultId: vault.vaultId,
|
|
105
105
|
requestId: `setup:${Date.now()}:register_agent`,
|
|
106
|
-
owner: { kind: "owner", id: ownerIdentity.
|
|
107
|
-
|
|
106
|
+
owner: { kind: "owner", id: ownerIdentity.rootAgentId },
|
|
107
|
+
agentRecord: {
|
|
108
108
|
vaultId: vault.vaultId,
|
|
109
|
-
|
|
110
|
-
publicKey:
|
|
109
|
+
rootAgentId: agentRecord.rootAgentId,
|
|
110
|
+
publicKey: agentRecord.publicKey,
|
|
111
111
|
},
|
|
112
112
|
requestedAt: new Date().toISOString(),
|
|
113
113
|
});
|
|
114
114
|
|
|
115
115
|
// Owner writes a secret (simulated local call for setup)
|
|
116
|
-
const secret = await vault.
|
|
117
|
-
kind: "owner.
|
|
116
|
+
const secret = await vault.ownerCreateSecret({
|
|
117
|
+
kind: "owner.create_secret",
|
|
118
118
|
vaultId: vault.vaultId,
|
|
119
119
|
requestId: `setup:${Date.now()}:write_secret`,
|
|
120
|
-
owner: { kind: "owner", id: ownerIdentity.
|
|
120
|
+
owner: { kind: "owner", id: ownerIdentity.rootAgentId },
|
|
121
121
|
alias: "api-token",
|
|
122
122
|
plaintext: "SK-PROD-12345",
|
|
123
123
|
source: { kind: "manual" },
|
|
124
124
|
requestedAt: new Date().toISOString(),
|
|
125
125
|
});
|
|
126
126
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
secretIds: [secret.secretId.value],
|
|
134
|
-
scope: "https://httpbin.org/post",
|
|
135
|
-
methods: ["POST"],
|
|
136
|
-
},
|
|
137
|
-
read: { mode: "full" },
|
|
138
|
-
issuedAt: new Date().toISOString(),
|
|
139
|
-
};
|
|
127
|
+
// Owner grants permissions (New Grant-based API)
|
|
128
|
+
await vault.ownerGrantAgentSecret(
|
|
129
|
+
{ kind: "owner", id: ownerIdentity.rootAgentId },
|
|
130
|
+
agentRecord.rootAgentId,
|
|
131
|
+
"api-token"
|
|
132
|
+
);
|
|
140
133
|
|
|
141
|
-
await vault.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
requestedAt: new Date().toISOString(),
|
|
147
|
-
});
|
|
134
|
+
await vault.ownerGrantSecretDestination(
|
|
135
|
+
{ kind: "owner", id: ownerIdentity.rootAgentId },
|
|
136
|
+
"api-token",
|
|
137
|
+
"httpbin.org"
|
|
138
|
+
);
|
|
148
139
|
|
|
149
140
|
const session = await vault.ownerIssueSessionToken({
|
|
150
141
|
vaultId: vault.vaultId,
|
|
151
142
|
requestId: `setup:${Date.now()}:issue_session_token`,
|
|
152
|
-
actor: { kind: "owner", id: ownerIdentity.
|
|
153
|
-
|
|
143
|
+
actor: { kind: "owner", id: ownerIdentity.rootAgentId },
|
|
144
|
+
rootAgentId: agentRecord.rootAgentId,
|
|
154
145
|
requestedAt: new Date().toISOString(),
|
|
155
146
|
});
|
|
156
147
|
|
|
157
148
|
// 3. Run the "LLM Agent" (Process A)
|
|
158
|
-
await runAgentDemo(PORT,
|
|
149
|
+
await runAgentDemo(PORT, agentRecord, session.token);
|
|
159
150
|
|
|
160
151
|
// 4. Cleanup
|
|
161
152
|
server.close();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@the-ai-company/cbio-node-runtime",
|
|
3
|
-
"version": "1.63.
|
|
3
|
+
"version": "1.63.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,7 +30,8 @@
|
|
|
30
30
|
"build:docs": "npx typedoc --options typedoc.json",
|
|
31
31
|
"release": "npx standard-version && npm publish",
|
|
32
32
|
"prepare": "npm run build && npm run build:docs",
|
|
33
|
-
"test": "npm run build && npm run test:acceptance",
|
|
33
|
+
"test": "npm run build && npm run test:types && npm run test:acceptance",
|
|
34
|
+
"test:types": "tsc -p tsconfig.type-tests.json --noEmit",
|
|
34
35
|
"test:acceptance": "node tests/smoke/runtime-surface.js && node tests/smoke/policy-and-persistence.js && node tests/smoke/replay-guard.js && node tests/smoke/security-guards.js"
|
|
35
36
|
},
|
|
36
37
|
"keywords": [
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Function: createOwnerHttpFlowBoundary()
|
|
6
|
-
|
|
7
|
-
> **createOwnerHttpFlowBoundary**(`boundary`): `OwnerHttpFlowBoundary`
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
### boundary
|
|
12
|
-
|
|
13
|
-
`OwnerHttpFlowBoundary`
|
|
14
|
-
|
|
15
|
-
## Returns
|
|
16
|
-
|
|
17
|
-
`OwnerHttpFlowBoundary`
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Function: createStandardAcquireBoundary()
|
|
6
|
-
|
|
7
|
-
> **createStandardAcquireBoundary**(`input`): `OwnerHttpFlowBoundary`
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
### input
|
|
12
|
-
|
|
13
|
-
#### method?
|
|
14
|
-
|
|
15
|
-
`string`
|
|
16
|
-
|
|
17
|
-
#### responseField
|
|
18
|
-
|
|
19
|
-
`"access_token"` \| `"refresh_token"` \| `"id_token"`
|
|
20
|
-
|
|
21
|
-
#### storeAlias
|
|
22
|
-
|
|
23
|
-
`string`
|
|
24
|
-
|
|
25
|
-
#### targetUrl
|
|
26
|
-
|
|
27
|
-
`string`
|
|
28
|
-
|
|
29
|
-
## Returns
|
|
30
|
-
|
|
31
|
-
`OwnerHttpFlowBoundary`
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Function: createStandardDispatchBoundary()
|
|
6
|
-
|
|
7
|
-
> **createStandardDispatchBoundary**(`input`): `OwnerHttpFlowBoundary`
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
### input
|
|
12
|
-
|
|
13
|
-
#### method
|
|
14
|
-
|
|
15
|
-
`string`
|
|
16
|
-
|
|
17
|
-
#### targetUrl
|
|
18
|
-
|
|
19
|
-
`string`
|
|
20
|
-
|
|
21
|
-
## Returns
|
|
22
|
-
|
|
23
|
-
`OwnerHttpFlowBoundary`
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Function: createVaultClient()
|
|
6
|
-
|
|
7
|
-
> **createVaultClient**(`options`): [`VaultClient`](../interfaces/VaultClient.md)
|
|
8
|
-
|
|
9
|
-
Creates a [VaultClient](../interfaces/VaultClient.md) instance for a specific vault owner.
|
|
10
|
-
|
|
11
|
-
## Parameters
|
|
12
|
-
|
|
13
|
-
### options
|
|
14
|
-
|
|
15
|
-
[`CreateVaultClientOptions`](../interfaces/CreateVaultClientOptions.md)
|
|
16
|
-
|
|
17
|
-
Configuration including optional owner identity and the vault service.
|
|
18
|
-
|
|
19
|
-
## Returns
|
|
20
|
-
|
|
21
|
-
[`VaultClient`](../interfaces/VaultClient.md)
|
|
22
|
-
|
|
23
|
-
An initialized [VaultClient](../interfaces/VaultClient.md).
|
|
24
|
-
|
|
25
|
-
## Example
|
|
26
|
-
|
|
27
|
-
```ts
|
|
28
|
-
const client = createVaultClient({
|
|
29
|
-
ownerIdentity,
|
|
30
|
-
vault
|
|
31
|
-
});
|
|
32
|
-
```
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Function: wrapVaultCoreAsVaultService()
|
|
6
|
-
|
|
7
|
-
> **wrapVaultCoreAsVaultService**(`core`, `options?`): `VaultService`
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
### core
|
|
12
|
-
|
|
13
|
-
[`VaultCore`](../classes/VaultCore.md)
|
|
14
|
-
|
|
15
|
-
### options?
|
|
16
|
-
|
|
17
|
-
#### clock?
|
|
18
|
-
|
|
19
|
-
`Clock`
|
|
20
|
-
|
|
21
|
-
#### customFlows?
|
|
22
|
-
|
|
23
|
-
`VaultCustomFlowResolver`
|
|
24
|
-
|
|
25
|
-
#### fetchImpl?
|
|
26
|
-
|
|
27
|
-
\{(`input`, `init?`): `Promise`\<`Response`\>; (`input`, `init?`): `Promise`\<`Response`\>; \}
|
|
28
|
-
|
|
29
|
-
## Returns
|
|
30
|
-
|
|
31
|
-
`VaultService`
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Interface: AgentSubmitCapabilityRequestInput
|
|
6
|
-
|
|
7
|
-
## Properties
|
|
8
|
-
|
|
9
|
-
### operation?
|
|
10
|
-
|
|
11
|
-
> `optional` **operation?**: `"dispatch_http"` \| `"custom_http"`
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### read
|
|
16
|
-
|
|
17
|
-
> **read**: `CapabilityReadPolicy`
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### reason
|
|
22
|
-
|
|
23
|
-
> **reason**: `string`
|
|
24
|
-
|
|
25
|
-
***
|
|
26
|
-
|
|
27
|
-
### requestedAt?
|
|
28
|
-
|
|
29
|
-
> `optional` **requestedAt?**: `string`
|
|
30
|
-
|
|
31
|
-
***
|
|
32
|
-
|
|
33
|
-
### secretAliases?
|
|
34
|
-
|
|
35
|
-
> `optional` **secretAliases?**: readonly `string`[]
|
|
36
|
-
|
|
37
|
-
***
|
|
38
|
-
|
|
39
|
-
### write
|
|
40
|
-
|
|
41
|
-
> **write**: `Omit`\<`CapabilityWritePolicy`, `"secretIds"`\>
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
[**CBIO Node Runtime Agent API v1.63.2**](../README.md)
|
|
2
|
-
|
|
3
|
-
***
|
|
4
|
-
|
|
5
|
-
# Interface: VaultApproveCapabilityRequestInput
|
|
6
|
-
|
|
7
|
-
## Properties
|
|
8
|
-
|
|
9
|
-
### read?
|
|
10
|
-
|
|
11
|
-
> `optional` **read?**: `CapabilityReadPolicy`
|
|
12
|
-
|
|
13
|
-
***
|
|
14
|
-
|
|
15
|
-
### requestedAt?
|
|
16
|
-
|
|
17
|
-
> `optional` **requestedAt?**: `string`
|
|
18
|
-
|
|
19
|
-
***
|
|
20
|
-
|
|
21
|
-
### requestId
|
|
22
|
-
|
|
23
|
-
> **requestId**: `string`
|