@tinycloud/sdk-core 2.4.0-beta.9 → 2.5.0-beta.1
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/bootstrap/index.cjs +25 -0
- package/dist/bootstrap/index.cjs.map +1 -0
- package/dist/bootstrap/index.d.cts +1 -0
- package/dist/bootstrap/index.d.ts +1 -0
- package/dist/bootstrap/index.js +3 -0
- package/dist/bootstrap/index.js.map +1 -0
- package/dist/index.cjs +249 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +119 -9
- package/dist/index.d.ts +119 -9
- package/dist/index.js +246 -63
- package/dist/index.js.map +1 -1
- package/package.json +8 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
3
|
-
export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, discoverNetwork, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, hexDecode, hexEncode, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
2
|
+
import { InvokeFunction, InvokeAnyFunction, ParsedNetworkId, ServiceError, Result as Result$1, ServiceSession, FetchFunction, ServiceConstructor, RetryPolicy, TelemetryConfig, IServiceContext, IService, IKVService, ISQLService, IDuckDbService, IHooksService, IDataVaultService, IEncryptionService, ISecretsService, IDatabaseHandle, SqlValue, QueryResponse } from '@tinycloud/sdk-services';
|
|
3
|
+
export { BatchOptions, BatchResponse, BuildCanonicalDecryptRequestInput, BuildDecryptFactsInput, BuildDecryptInvocationInput, BuiltDecryptInvocation, CanonicalDecryptRequest, CanonicalJson, ColumnInfo, DECRYPT_ACTION, DECRYPT_FACT_TYPE, DECRYPT_RESULT_TYPE, DEFAULT_ENCRYPTION_ALG, DEFAULT_KEY_VERSION, DataVaultConfig, DataVaultService, DatabaseHandle, DecryptCapabilityProof, DecryptEnvelopeOptions, DecryptInvocationFact, DecryptInvocationSigner, DecryptRequestBody, DecryptResponseBody, DecryptTransport, DiscoverNetworkInput, DiscoveredNetwork, DiscoverySource, DuckDbAction, DuckDbActionType, DuckDbBatchOptions, DuckDbBatchResponse, DuckDbDatabaseHandle, DuckDbExecuteOptions, DuckDbExecuteResponse, DuckDbOptions, DuckDbQueryOptions, DuckDbQueryResponse, DuckDbService, DuckDbServiceConfig, DuckDbStatement, DuckDbValue, ENCRYPTION_NETWORK_URN_PREFIX, ENCRYPTION_SERVICE, ENCRYPTION_SERVICE_SHORT, ENVELOPE_VERSION, EncryptToNetworkInput, EncryptToNetworkOptions, EncryptToNetworkResult, EncryptionCrypto, EncryptionError, EncryptionErrorInput, EncryptionService, EncryptionServiceConfig, ErrorCode, ErrorCodes, ExecuteOptions, ExecuteResponse, FetchFunction, HookEvent, HookServiceName, HookStreamEvent, HookSubscription, HookWebhookListOptions, HookWebhookRecord, HookWebhookRegistration, HookWebhookScope, HookWebhookUnregisterOptions, HooksService, HooksServiceConfig, IDataVaultService, IDatabaseHandle, IDuckDbDatabaseHandle, IDuckDbService, IEncryptionService, IHooksService, IKVService, IPrefixedKVService, ISQLService, ISecretsService, IService, IServiceContext, InlineEncryptedEnvelope, InvokeAnyEntry, InvokeAnyFunction, InvokeFunction, KVCreateSignedReadUrlOptions, KVDeleteOptions, KVGetOptions, KVHeadOptions, KVListOptions, KVListResponse, KVPutOptions, KVResponse, KVResponseHeaders, KVService, KVServiceConfig, KVSignedReadUrlResponse, NETWORK_NAME_PATTERN, NetworkDescriptor, NetworkIdError, NodeDescriptorFetcher, ParsedNetworkId, PrefixedKVService, QueryOptions, QueryResponse, RandomReceiverKeyInput, ReceiverKeyPair, ReceiverKeySigner, ResolvedSecretPath, Result, RetryPolicy, SECRET_NAME_RE, SQLAction, SQLActionType, SQLService, SQLServiceConfig, SchemaInfo, SecretPayload, SecretScopeOptions, SecretsError, SecretsService, ServiceContext, ServiceContextConfig, ServiceError, ServiceSession, SignedReceiverKeyInput, SqlStatement, SqlValue, SubscribeOptions, TableInfo, TelemetryConfig, TelemetryEventHandler, TinyCloudDebugEnableOptions, TinyCloudDebugEvent, TinyCloudDebugLevel, TinyCloudDebugLogger, TinyCloudDebugTimer, VaultCrypto, VaultEntry, VaultError, VaultGetOptions, VaultGrantOptions, VaultHeaders, VaultListOptions, VaultPublicSpaceKVActions, VaultPutOptions, VerifyDecryptResponseInput, ViewInfo, WasmVaultFunctions, WellKnownDescriptorFetcher, buildCanonicalDecryptRequest, buildDecryptAttenuation, buildDecryptFacts, buildDecryptInvocation, buildNetworkId, canonicalHashHex, canonicalSignedResponse, canonicalizeEncryptionJson, canonicalizeSecretScope, checkDecryptInvocationInput, clearTinyCloudDebugLogs, createVaultCrypto, decryptEnvelopeWithKey, defaultRetryPolicy, deriveSignedReceiverKey, disableTinyCloudDebug, discoverNetwork, enableTinyCloudDebug, encryptToNetwork, base64Decode as encryptionBase64Decode, base64Encode as encryptionBase64Encode, encryptionError, utf8Decode as encryptionUtf8Decode, utf8Encode as encryptionUtf8Encode, ensureNetworkUsableForDecrypt, err, generateRandomReceiverKey, getTinyCloudDebugLogs, hexDecode, hexEncode, installTinyCloudDebugGlobals, isNetworkId, networkDiscoveryKey, ok, openWrappedKey, parseNetworkId, resolveSecretListPrefix, resolveSecretPath, serviceError, tinyCloudDebugLogger, validateEnvelope, verifyDecryptResponse } from '@tinycloud/sdk-services';
|
|
4
|
+
export { ACCOUNT_INDEX_SCHEMA, BOOTSTRAP_ALLOWLIST, BOOTSTRAP_DEFAULT_SPACE, BOOTSTRAP_ENCRYPTION_NETWORK_NAME, BOOTSTRAP_ENCRYPTION_NETWORK_RESOURCE_TEMPLATE, BOOTSTRAP_MANIFEST, BOOTSTRAP_PERSISTED_APPLICATION_MANIFESTS, BOOTSTRAP_PUBLIC_SPACE, BOOTSTRAP_SESSION_REQUESTS, BOOTSTRAP_SPACE_MANIFESTS, BOOTSTRAP_SPACE_NAMES, BootstrapAllowlistEntry, BootstrapAllowlistKind, BootstrapEncryptionNetworkStep, BootstrapManifest, BootstrapRawAbilityAllowlistEntry, BootstrapSchemaStep, BootstrapSeedApplicationsStep, BootstrapSeedSpacesStep, BootstrapSpaceDescriptor, BootstrapSpaceName, BootstrapSpaceStep, BootstrapStep, BootstrapStepKind, SECRET_RECORDS_SCHEMA, TINYCLOUD_ACCOUNT_SPACE_MANIFEST, TINYCLOUD_APPLICATIONS_SPACE_MANIFEST, TINYCLOUD_DEFAULT_SPACE_MANIFEST, TINYCLOUD_PUBLIC_SPACE_MANIFEST, TINYCLOUD_SECRETS_BOOTSTRAP_MANIFEST, bootstrapEncryptionNetworkId, bootstrapSpaceId, bootstrapSteps, composeBootstrapSpaceManifest } from '@tinycloud/bootstrap';
|
|
4
5
|
export { SiweMessage } from 'siwe';
|
|
5
6
|
|
|
6
7
|
/**
|
|
@@ -218,7 +219,7 @@ interface PermissionEntry {
|
|
|
218
219
|
*/
|
|
219
220
|
path: string;
|
|
220
221
|
/**
|
|
221
|
-
* Short action names (e.g. "get", "put", "read", "
|
|
222
|
+
* Short action names (e.g. "get", "put", "read", "schema"). The SDK expands
|
|
222
223
|
* these to full URNs (e.g. `tinycloud.kv/get`) during resolution.
|
|
223
224
|
* Already-expanded URNs are passed through unchanged.
|
|
224
225
|
*/
|
|
@@ -244,13 +245,22 @@ type ManifestSecretActions = true | string | string[] | {
|
|
|
244
245
|
*
|
|
245
246
|
* - `false` → no auto-included permissions
|
|
246
247
|
* - `true` → standard tier (KV + SQL read/write + capabilities:read)
|
|
247
|
-
* - `"admin"` → standard + SQL
|
|
248
|
+
* - `"admin"` → standard + SQL schema
|
|
248
249
|
* - `"all"` → everything the SDK supports (including DuckDB)
|
|
249
250
|
*
|
|
250
251
|
* Unknown string values silently fall back to `true`. Values are normalized
|
|
251
252
|
* (lowercase + trim) before matching.
|
|
252
253
|
*/
|
|
253
254
|
type ManifestDefaults = boolean | "admin" | "all";
|
|
255
|
+
/**
|
|
256
|
+
* Agent-readable app knowledge bundle pointer.
|
|
257
|
+
*
|
|
258
|
+
* - `true` means the default root: `knowledge/index.md`
|
|
259
|
+
* - string values must point at a markdown root under `knowledge/`
|
|
260
|
+
*/
|
|
261
|
+
type ManifestKnowledge = true | string;
|
|
262
|
+
/** Default root used when `manifest.knowledge === true`. */
|
|
263
|
+
declare const DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
|
|
254
264
|
/**
|
|
255
265
|
* The raw manifest shape an app declares. See `.claude/specs/manifest.md`.
|
|
256
266
|
*/
|
|
@@ -286,6 +296,8 @@ interface Manifest {
|
|
|
286
296
|
defaults?: ManifestDefaults | string;
|
|
287
297
|
/** Whether to include the public-space companion delegation. Default `true`. */
|
|
288
298
|
includePublicSpace?: boolean;
|
|
299
|
+
/** Agent-readable knowledge bundle root. `true` means `knowledge/index.md`. */
|
|
300
|
+
knowledge?: ManifestKnowledge;
|
|
289
301
|
/**
|
|
290
302
|
* Additional permissions beyond the defaults. Use for cross-space access,
|
|
291
303
|
* DuckDB (opt-in), or `skipPrefix: true` entries.
|
|
@@ -404,6 +416,7 @@ declare const DEFAULT_MANIFEST_SPACE = "applications";
|
|
|
404
416
|
declare const ACCOUNT_REGISTRY_SPACE = "account";
|
|
405
417
|
/** Account-space KV prefix used for installed-application registry records. */
|
|
406
418
|
declare const ACCOUNT_REGISTRY_PATH = "applications/";
|
|
419
|
+
declare const SECRETS_SPACE = "secrets";
|
|
407
420
|
/** SDK-only permission service for encrypted vault resources. */
|
|
408
421
|
declare const VAULT_PERMISSION_SERVICE = "tinycloud.vault";
|
|
409
422
|
/**
|
|
@@ -493,6 +506,12 @@ declare function loadManifest(url: string): Promise<Manifest>;
|
|
|
493
506
|
* Throws {@link ManifestValidationError} on any hard failure.
|
|
494
507
|
*/
|
|
495
508
|
declare function validateManifest(input: unknown): Manifest;
|
|
509
|
+
/**
|
|
510
|
+
* Resolve a manifest knowledge pointer to its root markdown file.
|
|
511
|
+
*
|
|
512
|
+
* This is metadata only; app knowledge does not create capabilities.
|
|
513
|
+
*/
|
|
514
|
+
declare function resolveManifestKnowledgeRoot(knowledge: Manifest["knowledge"] | undefined): string | undefined;
|
|
496
515
|
/**
|
|
497
516
|
* Normalize a `defaults` value: lowercase + trim, then match against known
|
|
498
517
|
* tiers. Unknown string values silently fall back to `true` (standard).
|
|
@@ -959,6 +978,14 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
959
978
|
domain?: string | null | undefined;
|
|
960
979
|
avatarUrl?: string | null | undefined;
|
|
961
980
|
}>>;
|
|
981
|
+
/**
|
|
982
|
+
* TinyCloud hosts this session was created against. Persisted so a
|
|
983
|
+
* restored session resolves to the same node without re-running the
|
|
984
|
+
* registry/fallback resolution (or the wallet sign-in flow). Optional
|
|
985
|
+
* for backward compatibility with sessions persisted before this field
|
|
986
|
+
* existed — those restore and lazily re-resolve their hosts.
|
|
987
|
+
*/
|
|
988
|
+
tinycloudHosts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
962
989
|
}, "strip", z.ZodTypeAny, {
|
|
963
990
|
chainId: number;
|
|
964
991
|
address: string;
|
|
@@ -981,6 +1008,7 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
981
1008
|
verificationMethod: string;
|
|
982
1009
|
spaces?: Record<string, string> | undefined;
|
|
983
1010
|
} | undefined;
|
|
1011
|
+
tinycloudHosts?: string[] | undefined;
|
|
984
1012
|
}, {
|
|
985
1013
|
chainId: number;
|
|
986
1014
|
address: string;
|
|
@@ -1003,6 +1031,7 @@ declare const PersistedSessionDataSchema: z.ZodObject<{
|
|
|
1003
1031
|
verificationMethod: string;
|
|
1004
1032
|
spaces?: Record<string, string> | undefined;
|
|
1005
1033
|
} | undefined;
|
|
1034
|
+
tinycloudHosts?: string[] | undefined;
|
|
1006
1035
|
}>;
|
|
1007
1036
|
type PersistedSessionData = z.infer<typeof PersistedSessionDataSchema>;
|
|
1008
1037
|
/**
|
|
@@ -2219,6 +2248,7 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2219
2248
|
/** Human-readable description of what is being shared */
|
|
2220
2249
|
description: z.ZodOptional<z.ZodString>;
|
|
2221
2250
|
}, "strip", z.ZodTypeAny, {
|
|
2251
|
+
schema: "base64" | "compact" | "ipfs";
|
|
2222
2252
|
url: string;
|
|
2223
2253
|
delegation: {
|
|
2224
2254
|
path: string;
|
|
@@ -2235,10 +2265,10 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2235
2265
|
authHeader?: string | undefined;
|
|
2236
2266
|
};
|
|
2237
2267
|
token: string;
|
|
2238
|
-
schema: "base64" | "compact" | "ipfs";
|
|
2239
2268
|
description?: string | undefined;
|
|
2240
2269
|
expiresAt?: Date | undefined;
|
|
2241
2270
|
}, {
|
|
2271
|
+
schema: "base64" | "compact" | "ipfs";
|
|
2242
2272
|
url: string;
|
|
2243
2273
|
delegation: {
|
|
2244
2274
|
path: string;
|
|
@@ -2255,7 +2285,6 @@ declare const ShareLinkSchema: z.ZodObject<{
|
|
|
2255
2285
|
authHeader?: string | undefined;
|
|
2256
2286
|
};
|
|
2257
2287
|
token: string;
|
|
2258
|
-
schema: "base64" | "compact" | "ipfs";
|
|
2259
2288
|
description?: string | undefined;
|
|
2260
2289
|
expiresAt?: Date | undefined;
|
|
2261
2290
|
}>;
|
|
@@ -2312,17 +2341,17 @@ declare const GenerateShareParamsSchema: z.ZodObject<{
|
|
|
2312
2341
|
baseUrl: z.ZodOptional<z.ZodString>;
|
|
2313
2342
|
}, "strip", z.ZodTypeAny, {
|
|
2314
2343
|
path: string;
|
|
2344
|
+
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2315
2345
|
expiry?: Date | undefined;
|
|
2316
2346
|
description?: string | undefined;
|
|
2317
2347
|
actions?: string[] | undefined;
|
|
2318
|
-
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2319
2348
|
baseUrl?: string | undefined;
|
|
2320
2349
|
}, {
|
|
2321
2350
|
path: string;
|
|
2351
|
+
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2322
2352
|
expiry?: Date | undefined;
|
|
2323
2353
|
description?: string | undefined;
|
|
2324
2354
|
actions?: string[] | undefined;
|
|
2325
|
-
schema?: "base64" | "compact" | "ipfs" | undefined;
|
|
2326
2355
|
baseUrl?: string | undefined;
|
|
2327
2356
|
}>;
|
|
2328
2357
|
type GenerateShareParams = z.infer<typeof GenerateShareParamsSchema>;
|
|
@@ -2889,6 +2918,12 @@ interface SignRequest {
|
|
|
2889
2918
|
message: string;
|
|
2890
2919
|
/** Type of sign operation */
|
|
2891
2920
|
type: "siwe" | "message";
|
|
2921
|
+
/**
|
|
2922
|
+
* What the signature is for. Lets strategies apply different policies to
|
|
2923
|
+
* account-bootstrap signatures (which may be auto-signed server-side)
|
|
2924
|
+
* versus the user-initiated sign-in. Absent on requests from older SDKs.
|
|
2925
|
+
*/
|
|
2926
|
+
purpose?: "sign-in" | "bootstrap-session" | "bootstrap-host" | "message";
|
|
2892
2927
|
}
|
|
2893
2928
|
/**
|
|
2894
2929
|
* Sign response from callback or event handlers.
|
|
@@ -2905,6 +2940,56 @@ interface SignResponse {
|
|
|
2905
2940
|
* Callback handler type for sign requests.
|
|
2906
2941
|
*/
|
|
2907
2942
|
type SignCallback = (request: SignRequest) => Promise<SignResponse>;
|
|
2943
|
+
interface OpenKeySigningStrategyOptions {
|
|
2944
|
+
/**
|
|
2945
|
+
* OpenKey signing endpoint URL.
|
|
2946
|
+
*
|
|
2947
|
+
* The SDK sends `POST endpoint` with JSON:
|
|
2948
|
+
* `{ address, chainId, message, type, keyId? }`.
|
|
2949
|
+
*
|
|
2950
|
+
* Expected successful response shape:
|
|
2951
|
+
* `{ signature: "0x..." }` or `{ approved: true, signature: "0x..." }`.
|
|
2952
|
+
*
|
|
2953
|
+
* Explicit-approval-needed response shape:
|
|
2954
|
+
* `{ approved: false, reason?: string }` or
|
|
2955
|
+
* `{ needsApproval: true, reason?: string, approvalUrl?: string }`.
|
|
2956
|
+
*/
|
|
2957
|
+
endpoint: string;
|
|
2958
|
+
/** Optional OpenKey managed key id. */
|
|
2959
|
+
keyId?: string;
|
|
2960
|
+
/** Optional bearer token or async token supplier. */
|
|
2961
|
+
token?: string | (() => string | Promise<string | undefined>) | undefined;
|
|
2962
|
+
/** Extra headers to include on every request. */
|
|
2963
|
+
headers?: Record<string, string> | (() => Record<string, string> | Promise<Record<string, string>>);
|
|
2964
|
+
/** Fetch implementation. Defaults to `globalThis.fetch`. */
|
|
2965
|
+
fetch?: typeof fetch;
|
|
2966
|
+
/** Request credentials mode for browser integrations. */
|
|
2967
|
+
credentials?: "include" | "omit" | "same-origin";
|
|
2968
|
+
}
|
|
2969
|
+
interface OpenKeySigningRequestBody extends SignRequest {
|
|
2970
|
+
keyId?: string;
|
|
2971
|
+
}
|
|
2972
|
+
interface OpenKeySigningResponseBody {
|
|
2973
|
+
approved?: boolean;
|
|
2974
|
+
signature?: string;
|
|
2975
|
+
reason?: string;
|
|
2976
|
+
error?: string;
|
|
2977
|
+
needsApproval?: boolean;
|
|
2978
|
+
approvalUrl?: string;
|
|
2979
|
+
}
|
|
2980
|
+
interface OpenKeyCallbackStrategy extends CallbackStrategy {
|
|
2981
|
+
/** Marker used by SDK runtimes to choose the bootstrap-safe initial SIWE. */
|
|
2982
|
+
openKeyAutoSign: true;
|
|
2983
|
+
}
|
|
2984
|
+
/**
|
|
2985
|
+
* Create a callback signing strategy that delegates message signing to OpenKey.
|
|
2986
|
+
*
|
|
2987
|
+
* The helper deliberately returns the existing `CallbackStrategy` shape. When
|
|
2988
|
+
* OpenKey's policy gate says a request needs explicit approval, the callback
|
|
2989
|
+
* returns `{ approved: false, reason }`; `NodeUserAuthorization` then surfaces
|
|
2990
|
+
* that reason as the sign-in/signing error.
|
|
2991
|
+
*/
|
|
2992
|
+
declare function createOpenKeyCallbackSigningStrategy(options: OpenKeySigningStrategyOptions): OpenKeyCallbackStrategy;
|
|
2908
2993
|
/**
|
|
2909
2994
|
* Auto-sign strategy: automatically signs all requests.
|
|
2910
2995
|
*
|
|
@@ -4070,6 +4155,10 @@ interface ISpace {
|
|
|
4070
4155
|
* Data Vault operations scoped to this space.
|
|
4071
4156
|
*/
|
|
4072
4157
|
readonly vault: IDataVaultService;
|
|
4158
|
+
/**
|
|
4159
|
+
* Secrets operations scoped to this space.
|
|
4160
|
+
*/
|
|
4161
|
+
readonly secrets: ISecretsService;
|
|
4073
4162
|
/**
|
|
4074
4163
|
* Delegation operations scoped to this space.
|
|
4075
4164
|
*/
|
|
@@ -4103,6 +4192,10 @@ interface SpaceConfig {
|
|
|
4103
4192
|
* Factory function to create a space-scoped Data Vault service.
|
|
4104
4193
|
*/
|
|
4105
4194
|
createVault: (spaceId: string) => IDataVaultService;
|
|
4195
|
+
/**
|
|
4196
|
+
* Factory function to create a space-scoped secrets service.
|
|
4197
|
+
*/
|
|
4198
|
+
createSecrets?: (spaceId: string) => ISecretsService;
|
|
4106
4199
|
/**
|
|
4107
4200
|
* Factory function to create space-scoped delegations.
|
|
4108
4201
|
*/
|
|
@@ -4143,6 +4236,7 @@ declare class Space implements ISpace {
|
|
|
4143
4236
|
private readonly _name;
|
|
4144
4237
|
private readonly _kv;
|
|
4145
4238
|
private readonly _vault;
|
|
4239
|
+
private readonly _secrets;
|
|
4146
4240
|
private readonly _delegations;
|
|
4147
4241
|
private readonly _sharing;
|
|
4148
4242
|
private readonly _getInfo;
|
|
@@ -4168,6 +4262,10 @@ declare class Space implements ISpace {
|
|
|
4168
4262
|
* Data Vault operations scoped to this space.
|
|
4169
4263
|
*/
|
|
4170
4264
|
get vault(): IDataVaultService;
|
|
4265
|
+
/**
|
|
4266
|
+
* Secrets operations scoped to this space.
|
|
4267
|
+
*/
|
|
4268
|
+
get secrets(): ISecretsService;
|
|
4171
4269
|
/**
|
|
4172
4270
|
* Delegation operations scoped to this space.
|
|
4173
4271
|
*/
|
|
@@ -4245,6 +4343,8 @@ interface SpaceServiceConfig {
|
|
|
4245
4343
|
createKVService?: (spaceId: string) => IKVService;
|
|
4246
4344
|
/** Factory function to create a space-scoped Data Vault service */
|
|
4247
4345
|
createVaultService?: (spaceId: string) => IDataVaultService;
|
|
4346
|
+
/** Factory function to create a space-scoped secrets service */
|
|
4347
|
+
createSecretsService?: (spaceId: string) => ISecretsService;
|
|
4248
4348
|
/** User's PKH DID (derived from address or provided explicitly) */
|
|
4249
4349
|
userDid?: string;
|
|
4250
4350
|
/** Optional SharingService for v2 sharing links (client-side) */
|
|
@@ -4374,6 +4474,7 @@ declare class SpaceService implements ISpaceService {
|
|
|
4374
4474
|
private capabilityRegistry?;
|
|
4375
4475
|
private createKVServiceFn?;
|
|
4376
4476
|
private createVaultServiceFn?;
|
|
4477
|
+
private createSecretsServiceFn?;
|
|
4377
4478
|
private _userDid?;
|
|
4378
4479
|
private sharingService?;
|
|
4379
4480
|
private createDelegationFn?;
|
|
@@ -4462,6 +4563,10 @@ declare class SpaceService implements ISpaceService {
|
|
|
4462
4563
|
* Create a space-scoped Data Vault service.
|
|
4463
4564
|
*/
|
|
4464
4565
|
private createSpaceScopedVault;
|
|
4566
|
+
/**
|
|
4567
|
+
* Create a space-scoped secrets service.
|
|
4568
|
+
*/
|
|
4569
|
+
private createSpaceScopedSecrets;
|
|
4465
4570
|
/**
|
|
4466
4571
|
* Create space-scoped delegation operations.
|
|
4467
4572
|
*/
|
|
@@ -4532,6 +4637,9 @@ interface AccountIndexRebuildResult {
|
|
|
4532
4637
|
delegations: number;
|
|
4533
4638
|
syncedAt: string;
|
|
4534
4639
|
}
|
|
4640
|
+
interface AccountIndexEnsureResult {
|
|
4641
|
+
database: string;
|
|
4642
|
+
}
|
|
4535
4643
|
interface AccountIndexedReadOptions {
|
|
4536
4644
|
preferIndex?: boolean;
|
|
4537
4645
|
refreshIndex?: boolean;
|
|
@@ -4579,6 +4687,7 @@ declare class AccountService {
|
|
|
4579
4687
|
revoke: (options: AccountDelegationRevokeOptions) => Promise<Result$1<void>>;
|
|
4580
4688
|
};
|
|
4581
4689
|
readonly index: {
|
|
4690
|
+
ensure: () => Promise<Result$1<AccountIndexEnsureResult>>;
|
|
4582
4691
|
rebuild: () => Promise<Result$1<AccountIndexRebuildResult>>;
|
|
4583
4692
|
applications: {
|
|
4584
4693
|
list: () => Promise<Result$1<AccountApplication[]>>;
|
|
@@ -4607,6 +4716,7 @@ declare class AccountService {
|
|
|
4607
4716
|
private replaceApplicationsIndexQuietly;
|
|
4608
4717
|
private replaceSpacesIndexQuietly;
|
|
4609
4718
|
private replaceDelegationsIndexQuietly;
|
|
4719
|
+
private ensureAccountIndex;
|
|
4610
4720
|
}
|
|
4611
4721
|
interface AccountIndexStatus {
|
|
4612
4722
|
database: string;
|
|
@@ -4837,4 +4947,4 @@ declare const EXPIRY: {
|
|
|
4837
4947
|
declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
|
|
4838
4948
|
type ExpiryTier = keyof typeof EXPIRY;
|
|
4839
4949
|
|
|
4840
|
-
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
|
|
4950
|
+
export { ACCOUNT_REGISTRY_PATH, ACCOUNT_REGISTRY_SPACE, type AbilitiesMap, type AccountApplication, type AccountApplicationListOptions, type AccountDelegation, type AccountDelegationListOptions, type AccountDelegationRevokeOptions, type AccountIndexEnsureResult, type AccountIndexRebuildResult, type AccountIndexStatus, type AccountIndexedReadOptions, AccountService, type AccountServiceConfig, type AccountSpace, type AccountSpaceListOptions, type AccountStatus, AutoApproveSpaceCreationHandler, type AutoRejectStrategy, type AutoSignStrategy, type Bytes, type CallbackStrategy, type CanonicalAddress, type CanonicalParsedNetworkId, type CapabilityEntry, CapabilityKeyRegistry, type CapabilityKeyRegistryErrorCode, CapabilityKeyRegistryErrorCodes, type ClientSession, ClientSessionSchema, CloudLocationResolutionError, type ComposeManifestOptions, type ComposedManifestRequest, type CreateDelegationFunction, type CreateDelegationParams, type CreateDelegationWasmParams, type CreateDelegationWasmResult, DEFAULT_DEFAULTS, DEFAULT_EXPIRY, DEFAULT_KNOWLEDGE_ROOT, DEFAULT_MANIFEST_SPACE, DEFAULT_MANIFEST_VERSION, DEFAULT_SIGNED_READ_URL_EXPIRY_MS, DEFAULT_TINYCLOUD_FALLBACK_HOST, DEFAULT_TINYCLOUD_LOCATION_REGISTRY_URL, type DelegatedResource, type Delegation, type DelegationApiResponse, type DelegationChain, type DelegationChainV2, type DelegationDirection, type DelegationError, type DelegationErrorCode, DelegationErrorCodes, type DelegationFilters, DelegationManager, type DelegationManagerConfig, type DelegationRecord, type Result as DelegationResult, type DidCacheKeyOptions, type DidEqualsOptions, ENCRYPTION_MANIFEST_SPACE, ENCRYPTION_PERMISSION_SERVICE, EXPIRY, type EncodedShareData, type EnsData, EnsDataSchema, type EventEmitterStrategy, type ExpiryTier, type Extension, type GenerateShareParams, type ICapabilityKeyRegistry, type IENSResolver, type INotificationHandler, type ISessionManager, type ISessionStorage, type ISharingService, type ISigner, type ISpace, type ISpaceCreationHandler, type ISpaceScopedDelegations, type ISpaceScopedSharing, type ISpaceService, type IUserAuthorization, type IWasmBindings, IdentityParseError, type IngestOptions, type JWK, type KeyInfo, type KeyProvider, type KeyType, type LocationCandidate, type LocationCandidateInput, type LocationRecord, type LocationRecordPayload, type LocationRecordSigner, LocationRecordValidationError, type LocationResolutionAttempt, type LocationSource, type Manifest, type ManifestDefaults, type ManifestKnowledge, type ManifestRegistryRecord, type ManifestSecretActions, ManifestValidationError, type NodeInfo, type OpenKeyCallbackStrategy, type OpenKeySigningRequestBody, type OpenKeySigningResponseBody, type OpenKeySigningStrategyOptions, type ParseRecapFromSiwe, type PartialSiweMessage, type PermissionEntry, PermissionNotInManifestError, type PersistedSessionData, type PersistedTinyCloudSession, type PkhDidParts, ProtocolMismatchError, type ReceiveOptions, type ResolveCloudLocationOptions, type ResolveTinyCloudHostsOptions, type ResolvedCapabilities, type ResolvedCloudLocation, type ResolvedDelegate, type ResolvedTinyCloudHosts, type ResourceCapability, SECRETS_SPACE, SERVICE_LONG_TO_SHORT, SERVICE_SHORT_TO_LONG, type ServerHost, SessionExpiredError, type ShareAccess, type ShareLink, type ShareLinkData, type ShareSchema, SharingService, type SharingServiceConfig, type SignCallback, type SignInOptions, type SignRequest, type SignResponse, type SignStrategy, SilentNotificationHandler, type SiweConfig, SiweConfigSchema, Space, type SpaceAbilitiesMap, type SpaceConfig, type SpaceCreationContext, type SpaceDelegationParams, type SpaceErrorCode, SpaceErrorCodes, type SpaceHostResult, type SpaceInfo, type SpaceOwnership, SpaceService, type SpaceServiceConfig, type StoredDelegationChain, type SubsetCheckResult, TinyCloud, type TinyCloudConfig, type TinyCloudSession, UnsupportedFeatureError, type UserAuthorizationConfig, VAULT_PERMISSION_SERVICE, type ValidationError, VersionCheckError, type WasmRecapEntry, activateSessionWithHost, addressStorageKey, applyPrefix, buildSpaceUri, canonicalLocationPayload, canonicalizeAddress, canonicalizeDid, canonicalizeDidUrl, canonicalizeNetworkId, checkNodeInfo, composeManifestRequest, createCapabilityKeyRegistry, createOpenKeyCallbackSigningStrategy, createSharingService, createSpaceService, defaultSignStrategy, defaultSpaceCreationHandler, didCacheKey, didEquals, expandActionShortNames, expandPermissionEntries, expandPermissionEntry, fetchLocationRecord, fetchPeerId, httpUrlToMultiaddr, isCapabilitySubset, isEvmAddress, loadManifest, locationPayloadForRecord, makePkhSpaceId, makePublicSpaceId, manifestAbilitiesUnion, multiaddrToHttpUrl, normalizeDefaults, parseCanonicalNetworkId, parseExpiry, parsePkhDid, parseRecapCapabilities, parseSpaceUri, pkhDid, principalDid, principalDidEquals, resolveCloudLocation, resolveManifest, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
|