@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.cjs CHANGED
@@ -45,6 +45,7 @@ __export(index_exports, {
45
45
  DEFAULT_ENCRYPTION_ALG: () => import_sdk_services7.DEFAULT_ENCRYPTION_ALG,
46
46
  DEFAULT_EXPIRY: () => DEFAULT_EXPIRY,
47
47
  DEFAULT_KEY_VERSION: () => import_sdk_services7.DEFAULT_KEY_VERSION,
48
+ DEFAULT_KNOWLEDGE_ROOT: () => DEFAULT_KNOWLEDGE_ROOT,
48
49
  DEFAULT_MANIFEST_SPACE: () => DEFAULT_MANIFEST_SPACE,
49
50
  DEFAULT_MANIFEST_VERSION: () => DEFAULT_MANIFEST_VERSION,
50
51
  DEFAULT_SIGNED_READ_URL_EXPIRY_MS: () => DEFAULT_SIGNED_READ_URL_EXPIRY_MS,
@@ -172,6 +173,7 @@ __export(index_exports, {
172
173
  principalDidEquals: () => principalDidEquals,
173
174
  resolveCloudLocation: () => resolveCloudLocation,
174
175
  resolveManifest: () => resolveManifest,
176
+ resolveManifestKnowledgeRoot: () => resolveManifestKnowledgeRoot,
175
177
  resolveSecretListPrefix: () => import_sdk_services7.resolveSecretListPrefix,
176
178
  resolveSecretPath: () => import_sdk_services7.resolveSecretPath,
177
179
  resolveTinyCloudHosts: () => resolveTinyCloudHosts,
@@ -2357,6 +2359,7 @@ var import_sdk_services5 = require("@tinycloud/sdk-services");
2357
2359
  // src/manifest.ts
2358
2360
  var import_ms = __toESM(require("ms"), 1);
2359
2361
  var import_sdk_services4 = require("@tinycloud/sdk-services");
2362
+ var DEFAULT_KNOWLEDGE_ROOT = "knowledge/index.md";
2360
2363
  var ManifestValidationError = class extends Error {
2361
2364
  constructor(message) {
2362
2365
  super(`Manifest validation failed: ${message}`);
@@ -2411,7 +2414,7 @@ var DEFAULT_ADMIN_ENTRIES = [
2411
2414
  service: "tinycloud.sql",
2412
2415
  space: DEFAULT_MANIFEST_SPACE,
2413
2416
  path: "/",
2414
- actions: ["read", "write", "ddl"]
2417
+ actions: ["read", "write", "schema"]
2415
2418
  }
2416
2419
  ];
2417
2420
  var DEFAULT_ALL_ENTRIES = [
@@ -2425,7 +2428,7 @@ var DEFAULT_ALL_ENTRIES = [
2425
2428
  service: "tinycloud.sql",
2426
2429
  space: DEFAULT_MANIFEST_SPACE,
2427
2430
  path: "/",
2428
- actions: ["read", "write", "ddl"]
2431
+ actions: ["read", "write", "schema"]
2429
2432
  },
2430
2433
  {
2431
2434
  service: "tinycloud.duckdb",
@@ -2583,6 +2586,9 @@ function validateManifest(input) {
2583
2586
  if (m.expiry !== void 0) {
2584
2587
  parseExpiry(m.expiry);
2585
2588
  }
2589
+ if (m.knowledge !== void 0) {
2590
+ resolveManifestKnowledgeRoot(m.knowledge);
2591
+ }
2586
2592
  if (m.permissions !== void 0) {
2587
2593
  if (!Array.isArray(m.permissions)) {
2588
2594
  throw new ManifestValidationError(
@@ -2598,6 +2604,25 @@ function validateManifest(input) {
2598
2604
  }
2599
2605
  return m;
2600
2606
  }
2607
+ function resolveManifestKnowledgeRoot(knowledge) {
2608
+ if (knowledge === void 0) {
2609
+ return void 0;
2610
+ }
2611
+ if (knowledge === true) {
2612
+ return DEFAULT_KNOWLEDGE_ROOT;
2613
+ }
2614
+ if (typeof knowledge !== "string" || knowledge.length === 0) {
2615
+ throw new ManifestValidationError(
2616
+ "manifest.knowledge must be true or a knowledge/*.md root path"
2617
+ );
2618
+ }
2619
+ if (!/^knowledge\/.+\.md$/.test(knowledge)) {
2620
+ throw new ManifestValidationError(
2621
+ "manifest.knowledge must be true or a knowledge/*.md root path"
2622
+ );
2623
+ }
2624
+ return knowledge;
2625
+ }
2601
2626
  function validateManifestSecrets(secrets) {
2602
2627
  if (secrets === null || typeof secrets !== "object" || Array.isArray(secrets)) {
2603
2628
  throw new ManifestValidationError("manifest.secrets must be an object");
@@ -2997,7 +3022,7 @@ function accountRegistryIndexPermission() {
2997
3022
  service: "tinycloud.sql",
2998
3023
  space: ACCOUNT_REGISTRY_SPACE,
2999
3024
  path: "account",
3000
- actions: ["tinycloud.sql/read", "tinycloud.sql/write", "tinycloud.sql/ddl"]
3025
+ actions: ["tinycloud.sql/read", "tinycloud.sql/write", "tinycloud.sql/schema"]
3001
3026
  };
3002
3027
  }
3003
3028
  function composeManifestRequest(inputs, options = {}) {
@@ -6281,6 +6306,7 @@ function parseRecapCapabilities(parseWasm, siwe) {
6281
6306
  DEFAULT_ENCRYPTION_ALG,
6282
6307
  DEFAULT_EXPIRY,
6283
6308
  DEFAULT_KEY_VERSION,
6309
+ DEFAULT_KNOWLEDGE_ROOT,
6284
6310
  DEFAULT_MANIFEST_SPACE,
6285
6311
  DEFAULT_MANIFEST_VERSION,
6286
6312
  DEFAULT_SIGNED_READ_URL_EXPIRY_MS,
@@ -6408,6 +6434,7 @@ function parseRecapCapabilities(parseWasm, siwe) {
6408
6434
  principalDidEquals,
6409
6435
  resolveCloudLocation,
6410
6436
  resolveManifest,
6437
+ resolveManifestKnowledgeRoot,
6411
6438
  resolveSecretListPrefix,
6412
6439
  resolveSecretPath,
6413
6440
  resolveTinyCloudHosts,