@tinycloud/sdk-core 2.4.0-beta.12 → 2.4.0-beta.14

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/index.d.cts CHANGED
@@ -218,7 +218,7 @@ interface PermissionEntry {
218
218
  */
219
219
  path: string;
220
220
  /**
221
- * Short action names (e.g. "get", "put", "read", "ddl"). The SDK expands
221
+ * Short action names (e.g. "get", "put", "read", "schema"). The SDK expands
222
222
  * these to full URNs (e.g. `tinycloud.kv/get`) during resolution.
223
223
  * Already-expanded URNs are passed through unchanged.
224
224
  */
@@ -244,13 +244,22 @@ type ManifestSecretActions = true | string | string[] | {
244
244
  *
245
245
  * - `false` → no auto-included permissions
246
246
  * - `true` → standard tier (KV + SQL read/write + capabilities:read)
247
- * - `"admin"` → standard + SQL ddl
247
+ * - `"admin"` → standard + SQL schema
248
248
  * - `"all"` → everything the SDK supports (including DuckDB)
249
249
  *
250
250
  * Unknown string values silently fall back to `true`. Values are normalized
251
251
  * (lowercase + trim) before matching.
252
252
  */
253
253
  type ManifestDefaults = boolean | "admin" | "all";
254
+ /**
255
+ * Agent-readable app knowledge bundle pointer.
256
+ *
257
+ * - `true` means the default root: `knowledge/index.md`
258
+ * - string values must point at a markdown root under `knowledge/`
259
+ */
260
+ type ManifestKnowledge = true | string;
261
+ /** Default root used when `manifest.knowledge === true`. */
262
+ declare const DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
254
263
  /**
255
264
  * The raw manifest shape an app declares. See `.claude/specs/manifest.md`.
256
265
  */
@@ -286,6 +295,8 @@ interface Manifest {
286
295
  defaults?: ManifestDefaults | string;
287
296
  /** Whether to include the public-space companion delegation. Default `true`. */
288
297
  includePublicSpace?: boolean;
298
+ /** Agent-readable knowledge bundle root. `true` means `knowledge/index.md`. */
299
+ knowledge?: ManifestKnowledge;
289
300
  /**
290
301
  * Additional permissions beyond the defaults. Use for cross-space access,
291
302
  * DuckDB (opt-in), or `skipPrefix: true` entries.
@@ -493,6 +504,12 @@ declare function loadManifest(url: string): Promise<Manifest>;
493
504
  * Throws {@link ManifestValidationError} on any hard failure.
494
505
  */
495
506
  declare function validateManifest(input: unknown): Manifest;
507
+ /**
508
+ * Resolve a manifest knowledge pointer to its root markdown file.
509
+ *
510
+ * This is metadata only; app knowledge does not create capabilities.
511
+ */
512
+ declare function resolveManifestKnowledgeRoot(knowledge: Manifest["knowledge"] | undefined): string | undefined;
496
513
  /**
497
514
  * Normalize a `defaults` value: lowercase + trim, then match against known
498
515
  * tiers. Unknown string values silently fall back to `true` (standard).
@@ -2229,6 +2246,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2229
2246
  /** Human-readable description of what is being shared */
2230
2247
  description: z.ZodOptional<z.ZodString>;
2231
2248
  }, "strip", z.ZodTypeAny, {
2249
+ schema: "base64" | "compact" | "ipfs";
2232
2250
  url: string;
2233
2251
  delegation: {
2234
2252
  path: string;
@@ -2245,10 +2263,10 @@ declare const ShareLinkSchema: z.ZodObject<{
2245
2263
  authHeader?: string | undefined;
2246
2264
  };
2247
2265
  token: string;
2248
- schema: "base64" | "compact" | "ipfs";
2249
2266
  description?: string | undefined;
2250
2267
  expiresAt?: Date | undefined;
2251
2268
  }, {
2269
+ schema: "base64" | "compact" | "ipfs";
2252
2270
  url: string;
2253
2271
  delegation: {
2254
2272
  path: string;
@@ -2265,7 +2283,6 @@ declare const ShareLinkSchema: z.ZodObject<{
2265
2283
  authHeader?: string | undefined;
2266
2284
  };
2267
2285
  token: string;
2268
- schema: "base64" | "compact" | "ipfs";
2269
2286
  description?: string | undefined;
2270
2287
  expiresAt?: Date | undefined;
2271
2288
  }>;
@@ -2322,17 +2339,17 @@ declare const GenerateShareParamsSchema: z.ZodObject<{
2322
2339
  baseUrl: z.ZodOptional<z.ZodString>;
2323
2340
  }, "strip", z.ZodTypeAny, {
2324
2341
  path: string;
2342
+ schema?: "base64" | "compact" | "ipfs" | undefined;
2325
2343
  expiry?: Date | undefined;
2326
2344
  description?: string | undefined;
2327
2345
  actions?: string[] | undefined;
2328
- schema?: "base64" | "compact" | "ipfs" | undefined;
2329
2346
  baseUrl?: string | undefined;
2330
2347
  }, {
2331
2348
  path: string;
2349
+ schema?: "base64" | "compact" | "ipfs" | undefined;
2332
2350
  expiry?: Date | undefined;
2333
2351
  description?: string | undefined;
2334
2352
  actions?: string[] | undefined;
2335
- schema?: "base64" | "compact" | "ipfs" | undefined;
2336
2353
  baseUrl?: string | undefined;
2337
2354
  }>;
2338
2355
  type GenerateShareParams = z.infer<typeof GenerateShareParamsSchema>;
@@ -4848,4 +4865,4 @@ declare const EXPIRY: {
4848
4865
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
4849
4866
  type ExpiryTier = keyof typeof EXPIRY;
4850
4867
 
4851
- 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 };
4868
+ 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_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 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, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
package/dist/index.d.ts CHANGED
@@ -218,7 +218,7 @@ interface PermissionEntry {
218
218
  */
219
219
  path: string;
220
220
  /**
221
- * Short action names (e.g. "get", "put", "read", "ddl"). The SDK expands
221
+ * Short action names (e.g. "get", "put", "read", "schema"). The SDK expands
222
222
  * these to full URNs (e.g. `tinycloud.kv/get`) during resolution.
223
223
  * Already-expanded URNs are passed through unchanged.
224
224
  */
@@ -244,13 +244,22 @@ type ManifestSecretActions = true | string | string[] | {
244
244
  *
245
245
  * - `false` → no auto-included permissions
246
246
  * - `true` → standard tier (KV + SQL read/write + capabilities:read)
247
- * - `"admin"` → standard + SQL ddl
247
+ * - `"admin"` → standard + SQL schema
248
248
  * - `"all"` → everything the SDK supports (including DuckDB)
249
249
  *
250
250
  * Unknown string values silently fall back to `true`. Values are normalized
251
251
  * (lowercase + trim) before matching.
252
252
  */
253
253
  type ManifestDefaults = boolean | "admin" | "all";
254
+ /**
255
+ * Agent-readable app knowledge bundle pointer.
256
+ *
257
+ * - `true` means the default root: `knowledge/index.md`
258
+ * - string values must point at a markdown root under `knowledge/`
259
+ */
260
+ type ManifestKnowledge = true | string;
261
+ /** Default root used when `manifest.knowledge === true`. */
262
+ declare const DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
254
263
  /**
255
264
  * The raw manifest shape an app declares. See `.claude/specs/manifest.md`.
256
265
  */
@@ -286,6 +295,8 @@ interface Manifest {
286
295
  defaults?: ManifestDefaults | string;
287
296
  /** Whether to include the public-space companion delegation. Default `true`. */
288
297
  includePublicSpace?: boolean;
298
+ /** Agent-readable knowledge bundle root. `true` means `knowledge/index.md`. */
299
+ knowledge?: ManifestKnowledge;
289
300
  /**
290
301
  * Additional permissions beyond the defaults. Use for cross-space access,
291
302
  * DuckDB (opt-in), or `skipPrefix: true` entries.
@@ -493,6 +504,12 @@ declare function loadManifest(url: string): Promise<Manifest>;
493
504
  * Throws {@link ManifestValidationError} on any hard failure.
494
505
  */
495
506
  declare function validateManifest(input: unknown): Manifest;
507
+ /**
508
+ * Resolve a manifest knowledge pointer to its root markdown file.
509
+ *
510
+ * This is metadata only; app knowledge does not create capabilities.
511
+ */
512
+ declare function resolveManifestKnowledgeRoot(knowledge: Manifest["knowledge"] | undefined): string | undefined;
496
513
  /**
497
514
  * Normalize a `defaults` value: lowercase + trim, then match against known
498
515
  * tiers. Unknown string values silently fall back to `true` (standard).
@@ -2229,6 +2246,7 @@ declare const ShareLinkSchema: z.ZodObject<{
2229
2246
  /** Human-readable description of what is being shared */
2230
2247
  description: z.ZodOptional<z.ZodString>;
2231
2248
  }, "strip", z.ZodTypeAny, {
2249
+ schema: "base64" | "compact" | "ipfs";
2232
2250
  url: string;
2233
2251
  delegation: {
2234
2252
  path: string;
@@ -2245,10 +2263,10 @@ declare const ShareLinkSchema: z.ZodObject<{
2245
2263
  authHeader?: string | undefined;
2246
2264
  };
2247
2265
  token: string;
2248
- schema: "base64" | "compact" | "ipfs";
2249
2266
  description?: string | undefined;
2250
2267
  expiresAt?: Date | undefined;
2251
2268
  }, {
2269
+ schema: "base64" | "compact" | "ipfs";
2252
2270
  url: string;
2253
2271
  delegation: {
2254
2272
  path: string;
@@ -2265,7 +2283,6 @@ declare const ShareLinkSchema: z.ZodObject<{
2265
2283
  authHeader?: string | undefined;
2266
2284
  };
2267
2285
  token: string;
2268
- schema: "base64" | "compact" | "ipfs";
2269
2286
  description?: string | undefined;
2270
2287
  expiresAt?: Date | undefined;
2271
2288
  }>;
@@ -2322,17 +2339,17 @@ declare const GenerateShareParamsSchema: z.ZodObject<{
2322
2339
  baseUrl: z.ZodOptional<z.ZodString>;
2323
2340
  }, "strip", z.ZodTypeAny, {
2324
2341
  path: string;
2342
+ schema?: "base64" | "compact" | "ipfs" | undefined;
2325
2343
  expiry?: Date | undefined;
2326
2344
  description?: string | undefined;
2327
2345
  actions?: string[] | undefined;
2328
- schema?: "base64" | "compact" | "ipfs" | undefined;
2329
2346
  baseUrl?: string | undefined;
2330
2347
  }, {
2331
2348
  path: string;
2349
+ schema?: "base64" | "compact" | "ipfs" | undefined;
2332
2350
  expiry?: Date | undefined;
2333
2351
  description?: string | undefined;
2334
2352
  actions?: string[] | undefined;
2335
- schema?: "base64" | "compact" | "ipfs" | undefined;
2336
2353
  baseUrl?: string | undefined;
2337
2354
  }>;
2338
2355
  type GenerateShareParams = z.infer<typeof GenerateShareParamsSchema>;
@@ -4848,4 +4865,4 @@ declare const EXPIRY: {
4848
4865
  declare const DEFAULT_SIGNED_READ_URL_EXPIRY_MS: number;
4849
4866
  type ExpiryTier = keyof typeof EXPIRY;
4850
4867
 
4851
- 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 };
4868
+ 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_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 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, resolveManifestKnowledgeRoot, resolveTinyCloudHosts, resourceCapabilitiesToAbilitiesMap, resourceCapabilitiesToSpaceAbilitiesMap, signLocationRecord, submitHostDelegation, validateClientSession, validateLocationRecord, validateLocationRecordPayload, validateManifest, validatePersistedSessionData, verifyDidKeyEd25519Signature, verifyLocationRecord };
package/dist/index.js CHANGED
@@ -2180,6 +2180,7 @@ import {
2180
2180
  // src/manifest.ts
2181
2181
  import ms from "ms";
2182
2182
  import { resolveSecretPath, SECRET_NAME_RE } from "@tinycloud/sdk-services";
2183
+ var DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
2183
2184
  var ManifestValidationError = class extends Error {
2184
2185
  constructor(message) {
2185
2186
  super(`Manifest validation failed: ${message}`);
@@ -2234,7 +2235,7 @@ var DEFAULT_ADMIN_ENTRIES = [
2234
2235
  service: "tinycloud.sql",
2235
2236
  space: DEFAULT_MANIFEST_SPACE,
2236
2237
  path: "/",
2237
- actions: ["read", "write", "ddl"]
2238
+ actions: ["read", "write", "schema"]
2238
2239
  }
2239
2240
  ];
2240
2241
  var DEFAULT_ALL_ENTRIES = [
@@ -2248,7 +2249,7 @@ var DEFAULT_ALL_ENTRIES = [
2248
2249
  service: "tinycloud.sql",
2249
2250
  space: DEFAULT_MANIFEST_SPACE,
2250
2251
  path: "/",
2251
- actions: ["read", "write", "ddl"]
2252
+ actions: ["read", "write", "schema"]
2252
2253
  },
2253
2254
  {
2254
2255
  service: "tinycloud.duckdb",
@@ -2406,6 +2407,9 @@ function validateManifest(input) {
2406
2407
  if (m.expiry !== void 0) {
2407
2408
  parseExpiry(m.expiry);
2408
2409
  }
2410
+ if (m.knowledge !== void 0) {
2411
+ resolveManifestKnowledgeRoot(m.knowledge);
2412
+ }
2409
2413
  if (m.permissions !== void 0) {
2410
2414
  if (!Array.isArray(m.permissions)) {
2411
2415
  throw new ManifestValidationError(
@@ -2421,6 +2425,25 @@ function validateManifest(input) {
2421
2425
  }
2422
2426
  return m;
2423
2427
  }
2428
+ function resolveManifestKnowledgeRoot(knowledge) {
2429
+ if (knowledge === void 0) {
2430
+ return void 0;
2431
+ }
2432
+ if (knowledge === true) {
2433
+ return DEFAULT_KNOWLEDGE_ROOT;
2434
+ }
2435
+ if (typeof knowledge !== "string" || knowledge.length === 0) {
2436
+ throw new ManifestValidationError(
2437
+ "manifest.knowledge must be true or a knowledge/*.md root path"
2438
+ );
2439
+ }
2440
+ if (!/^knowledge\/.+\.md$/.test(knowledge)) {
2441
+ throw new ManifestValidationError(
2442
+ "manifest.knowledge must be true or a knowledge/*.md root path"
2443
+ );
2444
+ }
2445
+ return knowledge;
2446
+ }
2424
2447
  function validateManifestSecrets(secrets) {
2425
2448
  if (secrets === null || typeof secrets !== "object" || Array.isArray(secrets)) {
2426
2449
  throw new ManifestValidationError("manifest.secrets must be an object");
@@ -2820,7 +2843,7 @@ function accountRegistryIndexPermission() {
2820
2843
  service: "tinycloud.sql",
2821
2844
  space: ACCOUNT_REGISTRY_SPACE,
2822
2845
  path: "account",
2823
- actions: ["tinycloud.sql/read", "tinycloud.sql/write", "tinycloud.sql/ddl"]
2846
+ actions: ["tinycloud.sql/read", "tinycloud.sql/write", "tinycloud.sql/schema"]
2824
2847
  };
2825
2848
  }
2826
2849
  function composeManifestRequest(inputs, options = {}) {
@@ -6168,6 +6191,7 @@ export {
6168
6191
  DEFAULT_ENCRYPTION_ALG,
6169
6192
  DEFAULT_EXPIRY,
6170
6193
  DEFAULT_KEY_VERSION,
6194
+ DEFAULT_KNOWLEDGE_ROOT,
6171
6195
  DEFAULT_MANIFEST_SPACE,
6172
6196
  DEFAULT_MANIFEST_VERSION,
6173
6197
  DEFAULT_SIGNED_READ_URL_EXPIRY_MS,
@@ -6295,6 +6319,7 @@ export {
6295
6319
  principalDidEquals,
6296
6320
  resolveCloudLocation,
6297
6321
  resolveManifest,
6322
+ resolveManifestKnowledgeRoot,
6298
6323
  resolveSecretListPrefix,
6299
6324
  resolveSecretPath2 as resolveSecretPath,
6300
6325
  resolveTinyCloudHosts,