buckyos 0.7.138 → 0.7.142

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.
Files changed (91) hide show
  1. package/cli/core/app.ts +4 -0
  2. package/cli/core/auth.ts +2 -3
  3. package/cli/dist/cli.mjs +547 -127
  4. package/cli/dist/cli.mjs.map +1 -1
  5. package/cli/modules/aiws.ts +294 -0
  6. package/cli/modules/executor.ts +98 -0
  7. package/cli/version.ts +1 -1
  8. package/dist/account.d.ts +0 -2
  9. package/dist/account.d.ts.map +1 -1
  10. package/dist/aiworkspace_client.d.ts +91 -0
  11. package/dist/aiworkspace_client.d.ts.map +1 -0
  12. package/dist/app-frame.cjs +1 -1
  13. package/dist/app-frame.cjs.map +1 -1
  14. package/dist/app-frame.d.ts +103 -3
  15. package/dist/app-frame.d.ts.map +1 -1
  16. package/dist/app-frame.mjs +189 -8
  17. package/dist/app-frame.mjs.map +1 -1
  18. package/dist/browser.cjs +1 -1
  19. package/dist/browser.cjs.map +1 -1
  20. package/dist/browser.d.ts +2 -0
  21. package/dist/browser.d.ts.map +1 -1
  22. package/dist/browser.mjs +18 -15
  23. package/dist/browser.mjs.map +1 -1
  24. package/dist/content.cjs +1 -1
  25. package/dist/content.cjs.map +1 -1
  26. package/dist/content.d.ts +18 -0
  27. package/dist/content.d.ts.map +1 -1
  28. package/dist/content.mjs +61 -1
  29. package/dist/content.mjs.map +1 -1
  30. package/dist/executor_client-b3ff97ba.js +13 -0
  31. package/dist/executor_client-b3ff97ba.js.map +1 -0
  32. package/dist/{ndm_proxy-6b03b9ec.mjs → executor_client-eb372968.mjs} +901 -396
  33. package/dist/executor_client-eb372968.mjs.map +1 -0
  34. package/dist/executor_client.d.ts +138 -0
  35. package/dist/executor_client.d.ts.map +1 -0
  36. package/dist/index.cjs +1 -1
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.ts +4 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.mjs +23 -15
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/internal/hash_worker.d.ts +2 -1
  43. package/dist/internal/hash_worker.d.ts.map +1 -1
  44. package/dist/internal/tus_client.d.ts +3 -0
  45. package/dist/internal/tus_client.d.ts.map +1 -1
  46. package/dist/namelib.d.ts +1 -10
  47. package/dist/namelib.d.ts.map +1 -1
  48. package/dist/ndm_client.d.ts +56 -7
  49. package/dist/ndm_client.d.ts.map +1 -1
  50. package/dist/ndn_types-08dc9ef1.js +2 -0
  51. package/dist/ndn_types-08dc9ef1.js.map +1 -0
  52. package/dist/{ndn_types-ac9c1e48.mjs → ndn_types-bbb1f6a6.mjs} +53 -100
  53. package/dist/ndn_types-bbb1f6a6.mjs.map +1 -0
  54. package/dist/nfsp.cjs +1 -1
  55. package/dist/nfsp.cjs.map +1 -1
  56. package/dist/nfsp.d.ts +16 -0
  57. package/dist/nfsp.d.ts.map +1 -1
  58. package/dist/nfsp.mjs +6 -0
  59. package/dist/nfsp.mjs.map +1 -1
  60. package/dist/node.cjs +1 -1
  61. package/dist/node.cjs.map +1 -1
  62. package/dist/node.d.ts +2 -0
  63. package/dist/node.d.ts.map +1 -1
  64. package/dist/node.mjs +18 -15
  65. package/dist/node.mjs.map +1 -1
  66. package/dist/provision.cjs +2 -2
  67. package/dist/provision.cjs.map +1 -1
  68. package/dist/provision.mjs +18 -12
  69. package/dist/provision.mjs.map +1 -1
  70. package/dist/provision_activate.d.ts.map +1 -1
  71. package/dist/runtime.d.ts +3 -4
  72. package/dist/runtime.d.ts.map +1 -1
  73. package/dist/sdk_core.d.ts +4 -0
  74. package/dist/sdk_core.d.ts.map +1 -1
  75. package/dist/{tus_client-2b915a81.js → tus_client-65c5fc5e.js} +4 -4
  76. package/dist/tus_client-65c5fc5e.js.map +1 -0
  77. package/dist/{tus_client-19baa342.mjs → tus_client-d313689e.mjs} +40 -2
  78. package/dist/tus_client-d313689e.mjs.map +1 -0
  79. package/dist/types.d.ts +0 -9
  80. package/dist/types.d.ts.map +1 -1
  81. package/dist/verify-hub-client.d.ts +1 -9
  82. package/dist/verify-hub-client.d.ts.map +1 -1
  83. package/package.json +1 -1
  84. package/dist/ndm_proxy-67651066.js +0 -13
  85. package/dist/ndm_proxy-67651066.js.map +0 -1
  86. package/dist/ndm_proxy-6b03b9ec.mjs.map +0 -1
  87. package/dist/ndn_types-324121ae.js +0 -2
  88. package/dist/ndn_types-324121ae.js.map +0 -1
  89. package/dist/ndn_types-ac9c1e48.mjs.map +0 -1
  90. package/dist/tus_client-19baa342.mjs.map +0 -1
  91. package/dist/tus_client-2b915a81.js.map +0 -1
@@ -5,7 +5,7 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  var _a;
8
- import { N as NODE_IDENTITY_SCHEMA_V2, v as DID, L as newDeviceDocumentByJwk, M as verifyJwtEdDSA, P as deviceDocumentToOrderedJson, Q as decodeJwtClaimWithoutVerify, R as commonjsGlobal, T as DEFAULT_EXPIRE_TIME, h as hashPassword, U as buckyosGetUnixTimestamp, V as getPublicKeyXFromPrivatePem, W as getXFromJwk, X as createJwkByX, Y as newOwnerDocument, Z as ownerDocumentSetDefaultZoneDid, _ as ownerDocumentToOrderedJson, $ as oodDescriptionToString, a0 as parseOODDescription, a1 as encodeZoneBootDocument, a2 as newZoneBootDocument, a3 as encodeDeviceDocument, a4 as newDeviceMiniDocumentByDeviceDocument, a5 as deviceMiniDocumentToJwt, a6 as newZoneDocument, a7 as encodeZoneDocument, a8 as zoneDocumentToOrderedJson, a9 as newDeviceMiniDocument, aa as newDeviceDocumentByMiniDocument, ab as buildNamedObjectByJson } from "./ndn_types-ac9c1e48.mjs";
8
+ import { N as NODE_IDENTITY_SCHEMA_V2, u as DID, K as newDeviceDocumentByJwk, L as verifyJwtEdDSA, M as deviceDocumentToOrderedJson, P as decodeJwtClaimWithoutVerify, Q as commonjsGlobal, R as DEFAULT_EXPIRE_TIME, h as hashPassword, T as buckyosGetUnixTimestamp, U as getPublicKeyXFromPrivatePem, V as getXFromJwk, W as createJwkByX, X as newOwnerDocument, Y as ownerDocumentSetDefaultZoneDid, Z as ownerDocumentToOrderedJson, _ as oodDescriptionToString, $ as parseOODDescription, a0 as encodeZoneBootDocument, a1 as newZoneBootDocument, a2 as encodeDeviceDocument, a3 as newDeviceMiniDocumentByDeviceDocument, a4 as deviceMiniDocumentToJwt, a5 as newZoneDocument, a6 as encodeZoneDocument, a7 as zoneDocumentToOrderedJson, a8 as newDeviceMiniDocument, a9 as newDeviceDocumentByMiniDocument, aa as buildNamedObjectByJson } from "./ndn_types-bbb1f6a6.mjs";
9
9
  import { Buffer as Buffer$1 } from "node:buffer";
10
10
  import { pbkdf2Sync, createPublicKey, createPrivateKey, createECDH, createHmac } from "node:crypto";
11
11
  const DEVICE_DOC_JWT_FILE_NAME = "device_doc.jwt";
@@ -14339,7 +14339,7 @@ function layoutFor(rootDir, zoneDid, deviceDid) {
14339
14339
  etcDir,
14340
14340
  lockPath: path.join(etcDir, ACTIVATION_LOCK_FILE_NAME),
14341
14341
  nodeIdentityPath: path.join(etcDir, "node_identity.json"),
14342
- startConfigPath: path.join(etcDir, "start_config.json"),
14342
+ startConfigPath: path.join(rootDir, "security", "start_config.json"),
14343
14343
  zoneDocumentJwtPath: path.join(etcDir, ZONE_DOCUMENT_JWT_FILE_NAME),
14344
14344
  gatewayParamsPath: path.join(etcDir, "node_gateway_params.json"),
14345
14345
  dnsRecordsPath: path.join(etcDir, ZONE_DNS_RECORDS_FILE_NAME),
@@ -14370,7 +14370,7 @@ function plannedFiles(rootDir, layout) {
14370
14370
  entry(layout.zoneBootOverridePath, "zone_boot_override", true, false),
14371
14371
  entry(layout.zoneDocumentJwtPath, "zone_document_jwt", true, false),
14372
14372
  entry(layout.dnsRecordsPath, "dns_records", false, false),
14373
- entry(layout.startConfigPath, "start_config", true, false),
14373
+ entry(layout.startConfigPath, "start_config", true, true),
14374
14374
  entry(layout.gatewayParamsPath, "gateway_params", true, false),
14375
14375
  entry(layout.nodeIdentityPath, "node_identity", true, false)
14376
14376
  ];
@@ -14511,35 +14511,35 @@ async function validateActivationMaterials(rootDir, layout, identity, problems)
14511
14511
  try {
14512
14512
  startConfig = readJsonObjectOrThrow(layout.startConfigPath);
14513
14513
  } catch (error) {
14514
- problem("START_CONFIG_UNREADABLE", `etc/start_config.json cannot be parsed: ${error instanceof Error ? error.message : String(error)}`);
14514
+ problem("START_CONFIG_UNREADABLE", `security/start_config.json cannot be parsed: ${error instanceof Error ? error.message : String(error)}`);
14515
14515
  }
14516
14516
  let accessHostname = null;
14517
14517
  const jwts = {};
14518
14518
  if (startConfig) {
14519
14519
  for (const key of ["user_name", "zone_name", "access_hostname", "admin_password_hash"]) {
14520
14520
  if (typeof startConfig[key] !== "string" || startConfig[key].length === 0) {
14521
- problem("START_CONFIG_FIELD", `etc/start_config.json is missing ${key}`);
14521
+ problem("START_CONFIG_FIELD", `security/start_config.json is missing ${key}`);
14522
14522
  }
14523
14523
  }
14524
14524
  for (const key of ["boot_config_jwt", "device_doc_jwt", "device_mini_doc_jwt", "zone_document_jwt", "ood_jwt"]) {
14525
14525
  if (typeof startConfig[key] === "string" && startConfig[key].length > 0) {
14526
14526
  jwts[key] = startConfig[key];
14527
14527
  } else {
14528
- problem("START_CONFIG_FIELD", `etc/start_config.json is missing ${key}`);
14528
+ problem("START_CONFIG_FIELD", `security/start_config.json is missing ${key}`);
14529
14529
  }
14530
14530
  }
14531
14531
  if (startConfig.zone_name !== zoneDid.toString()) {
14532
- problem("START_CONFIG_ZONE", `etc/start_config.json zone_name is not ${zoneDid.toString()}`);
14532
+ problem("START_CONFIG_ZONE", `security/start_config.json zone_name is not ${zoneDid.toString()}`);
14533
14533
  }
14534
14534
  if (typeof startConfig.access_hostname === "string") {
14535
14535
  accessHostname = startConfig.access_hostname;
14536
14536
  if (accessHostname !== zoneDid.toRawHostName()) {
14537
- problem("START_CONFIG_HOSTNAME", `etc/start_config.json access_hostname is not ${zoneDid.toRawHostName()}`);
14537
+ problem("START_CONFIG_HOSTNAME", `security/start_config.json access_hostname is not ${zoneDid.toRawHostName()}`);
14538
14538
  }
14539
14539
  }
14540
14540
  const ownerDocument = startConfig.owner_document;
14541
14541
  if (!ownerDocument || typeof ownerDocument !== "object") {
14542
- problem("START_CONFIG_OWNER", "etc/start_config.json is missing owner_document");
14542
+ problem("START_CONFIG_OWNER", "security/start_config.json is missing owner_document");
14543
14543
  } else {
14544
14544
  if (ownerDocument.id !== ownerDid) {
14545
14545
  problem("START_CONFIG_OWNER", `owner_document id ${String(ownerDocument.id)} is not ${ownerDid}`);
@@ -14550,11 +14550,11 @@ async function validateActivationMaterials(rootDir, layout, identity, problems)
14550
14550
  }
14551
14551
  }
14552
14552
  if (jwts.ood_jwt && jwts.device_doc_jwt && jwts.ood_jwt !== jwts.device_doc_jwt) {
14553
- problem("START_CONFIG_OOD_JWT", "etc/start_config.json ood_jwt differs from device_doc_jwt");
14553
+ problem("START_CONFIG_OOD_JWT", "security/start_config.json ood_jwt differs from device_doc_jwt");
14554
14554
  }
14555
14555
  for (const [key, secret] of [["private_key", true], ["device_private_key", true], ["sn_access_token", true], ["bns_evm_private_key", true]]) {
14556
14556
  if (secret && key in startConfig)
14557
- problem("START_CONFIG_SECRET", `etc/start_config.json must not contain ${key}`);
14557
+ problem("START_CONFIG_SECRET", `security/start_config.json must not contain ${key}`);
14558
14558
  }
14559
14559
  }
14560
14560
  const readText = (filePath, label) => {
@@ -14732,13 +14732,19 @@ async function inspectActivationRoot(rootDir) {
14732
14732
  } else {
14733
14733
  for (const [name, role, required] of [
14734
14734
  ["node_identity.json", "node_identity", true],
14735
- ["start_config.json", "start_config", true],
14736
14735
  [ZONE_DOCUMENT_JWT_FILE_NAME, "zone_document_jwt", true],
14737
14736
  ["node_gateway_params.json", "gateway_params", true],
14738
14737
  [ZONE_DNS_RECORDS_FILE_NAME, "dns_records", false]
14739
14738
  ]) {
14740
14739
  files.push({ path: `etc/${name}`, role, required, secret: false, present: isFile(path.join(etcDir, name)) });
14741
14740
  }
14741
+ files.push({
14742
+ path: "security/start_config.json",
14743
+ role: "start_config",
14744
+ required: true,
14745
+ secret: true,
14746
+ present: isFile(path.join(root, "security", "start_config.json"))
14747
+ });
14742
14748
  for (const name of zoneJsonFiles) {
14743
14749
  files.push({ path: `etc/${name}`, role: "zone_boot_override", required: true, secret: false, present: true });
14744
14750
  }