@private.me/xbind 3.0.1 → 3.0.3

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 (108) hide show
  1. package/README.md +2419 -216
  2. package/README.md.backup +2121 -0
  3. package/dist-standalone/_deps/shared/cjs/errors.js +1 -1
  4. package/dist-standalone/_deps/shared/cjs/index.js +1 -1
  5. package/dist-standalone/_deps/shared/cjs/types.js +1 -1
  6. package/dist-standalone/_deps/shared/errors.js +1 -1
  7. package/dist-standalone/_deps/shared/index.js +1 -1
  8. package/dist-standalone/_deps/shared/types.js +1 -1
  9. package/dist-standalone/_deps/xchange/auto-accept.js +1 -1
  10. package/dist-standalone/_deps/xchange/cjs/auto-accept.js +1 -1
  11. package/dist-standalone/_deps/xchange/cjs/errors.js +1 -1
  12. package/dist-standalone/_deps/xchange/cjs/index.js +1 -1
  13. package/dist-standalone/_deps/xchange/cjs/invite-client.js +1 -1
  14. package/dist-standalone/_deps/xchange/cjs/lazy-init.js +1 -1
  15. package/dist-standalone/_deps/xchange/cjs/trust-integration.js +1 -1
  16. package/dist-standalone/_deps/xchange/cjs/xchange.js +1 -1
  17. package/dist-standalone/_deps/xchange/errors.js +1 -1
  18. package/dist-standalone/_deps/xchange/index.js +1 -1
  19. package/dist-standalone/_deps/xchange/invite-client.js +1 -1
  20. package/dist-standalone/_deps/xchange/lazy-init.js +1 -1
  21. package/dist-standalone/_deps/xchange/trust-integration.js +1 -1
  22. package/dist-standalone/_deps/xchange/xchange.js +1 -1
  23. package/dist-standalone/_deps/xregistry/cjs/discovery.js +1 -1
  24. package/dist-standalone/_deps/xregistry/cjs/errors.js +1 -1
  25. package/dist-standalone/_deps/xregistry/cjs/index.js +1 -1
  26. package/dist-standalone/_deps/xregistry/cjs/registry.js +1 -1
  27. package/dist-standalone/_deps/xregistry/cjs/schema.js +1 -1
  28. package/dist-standalone/_deps/xregistry/cjs/types.js +1 -1
  29. package/dist-standalone/_deps/xregistry/discovery.js +1 -1
  30. package/dist-standalone/_deps/xregistry/errors.js +1 -1
  31. package/dist-standalone/_deps/xregistry/index.js +1 -1
  32. package/dist-standalone/_deps/xregistry/registry.js +1 -1
  33. package/dist-standalone/_deps/xregistry/schema.js +1 -1
  34. package/dist-standalone/_deps/xregistry/types.js +1 -1
  35. package/dist-standalone/agent-call.d.ts +2 -2
  36. package/dist-standalone/agent-call.js +1 -1
  37. package/dist-standalone/agent.d.ts +2 -0
  38. package/dist-standalone/agent.js +1 -1
  39. package/dist-standalone/async-iterators.d.ts +3 -3
  40. package/dist-standalone/backup.js +1 -1
  41. package/dist-standalone/cjs/agent-call.js +1 -1
  42. package/dist-standalone/cjs/agent.js +1 -1
  43. package/dist-standalone/cjs/backup.js +1 -1
  44. package/dist-standalone/cjs/cli/init.js +1 -1
  45. package/dist-standalone/cjs/connection-pool.js +1 -1
  46. package/dist-standalone/cjs/crypto-utils.js +1 -1
  47. package/dist-standalone/cjs/debug-mode.js +1 -1
  48. package/dist-standalone/cjs/email-transport.js +1 -1
  49. package/dist-standalone/cjs/errors.js +1 -1
  50. package/dist-standalone/cjs/http-compat.js +1 -1
  51. package/dist-standalone/cjs/index.js +1 -1
  52. package/dist-standalone/cjs/lazy-init.js +1 -1
  53. package/dist-standalone/cjs/loopback-transport.js +1 -0
  54. package/dist-standalone/cjs/mdns-discovery.js +1 -1
  55. package/dist-standalone/cjs/plugins/logging.js +1 -1
  56. package/dist-standalone/cjs/runtime/edge.js +1 -1
  57. package/dist-standalone/cjs/security-policy.js +1 -1
  58. package/dist-standalone/cjs/serialization.js +1 -1
  59. package/dist-standalone/cjs/transport.js +1 -1
  60. package/dist-standalone/cjs/trust-registry.js +1 -1
  61. package/dist-standalone/cjs/vault-store-loader.js +1 -1
  62. package/dist-standalone/cjs/version-info.js +1 -1
  63. package/dist-standalone/cjs/xfetch.js +1 -1
  64. package/dist-standalone/cli/init.js +1 -1
  65. package/dist-standalone/cli/setup.js +1 -1
  66. package/dist-standalone/cli/xbind.js +1 -1
  67. package/dist-standalone/connection-pool.js +1 -1
  68. package/dist-standalone/crypto-utils.d.ts +2 -7
  69. package/dist-standalone/crypto-utils.js +1 -1
  70. package/dist-standalone/debug-mode.js +1 -1
  71. package/dist-standalone/email-transport.d.ts +2 -2
  72. package/dist-standalone/email-transport.js +1 -1
  73. package/dist-standalone/errors.d.ts +13 -3
  74. package/dist-standalone/errors.js +1 -1
  75. package/dist-standalone/gateway-state.d.ts +1 -1
  76. package/dist-standalone/health-check.d.ts +5 -1
  77. package/dist-standalone/http-compat.d.ts +1 -1
  78. package/dist-standalone/http-compat.js +1 -1
  79. package/dist-standalone/index.d.ts +15 -4
  80. package/dist-standalone/index.js +1 -1
  81. package/dist-standalone/lazy-init.d.ts +11 -6
  82. package/dist-standalone/lazy-init.js +1 -1
  83. package/dist-standalone/loopback-transport.d.ts +87 -0
  84. package/dist-standalone/loopback-transport.js +1 -0
  85. package/dist-standalone/mdns-discovery.js +1 -1
  86. package/dist-standalone/plugins/logging.js +1 -1
  87. package/dist-standalone/plugins/metrics.d.ts +4 -4
  88. package/dist-standalone/runtime/edge.js +1 -1
  89. package/dist-standalone/runtime/react-native.d.ts +1 -1
  90. package/dist-standalone/security-policy.js +1 -1
  91. package/dist-standalone/serialization.js +1 -1
  92. package/dist-standalone/transport.js +1 -1
  93. package/dist-standalone/trust-registry.d.ts +3 -3
  94. package/dist-standalone/trust-registry.js +1 -1
  95. package/dist-standalone/vault-store-loader.d.ts +9 -0
  96. package/dist-standalone/vault-store-loader.js +1 -1
  97. package/dist-standalone/version-info.js +1 -1
  98. package/dist-standalone/xfetch.js +1 -1
  99. package/package.json +4 -13
  100. package/share1.dat +0 -0
  101. package/dist-standalone/_deps/mldsa-wasm/LICENSE +0 -24
  102. package/dist-standalone/_deps/mldsa-wasm/package.json +0 -46
  103. package/dist-standalone/_deps/shared/cjs/package.json +0 -1
  104. package/dist-standalone/_deps/ux-helpers/cjs/package.json +0 -1
  105. package/dist-standalone/_deps/xchange/cjs/package.json +0 -1
  106. package/dist-standalone/_deps/xregistry/cjs/package.json +0 -1
  107. package/dist-standalone/cjs/package.json +0 -3
  108. package/dist-standalone/package.json +0 -10
@@ -1 +1 @@
1
- import{createLogger}from"./logger.js";const logger=createLogger("version-info");export var Capability;!function(e){e.ENVELOPE_V1="envelope-v1",e.ENVELOPE_V2="envelope-v2",e.ENVELOPE_V3="envelope-v3",e.ENVELOPE_V4="envelope-v4",e.ML_KEM_768="ml-kem-768",e.ML_DSA_65="ml-dsa-65",e.X25519_ECDH="x25519-ecdh",e.ED25519_SIG="ed25519-sig",e.XORIDA="xorida",e.SPLIT_CHANNEL="split-channel",e.TRUST_REGISTRY="trust-registry",e.SERVICE_DISCOVERY="service-discovery",e.INVITE_SYSTEM="invite-system",e.AGENT_CALL="agent-call",e.XFETCH="xfetch",e.DUAL_MODE="dual-mode",e.BACKUP_RESTORE="backup-restore",e.CORRELATION_ID="correlation-id",e.STRUCTURED_LOGGING="structured-logging",e.DID_SUCCESSION="did-succession",e.GATEWAY_STATE="gateway-state",e.SUBSCRIPTION_PROOF="subscription-proof",e.POLICY_ENGINE="policy-engine",e.APPROVAL_FLOW="approval-flow",e.GUARDRAILS="guardrails",e.HTTP_COMPAT="http-compat",e.DID_WEB="did-web",e.DID_PRIVATEME="did:privateme",e.REDIS_NONCE="redis-nonce",e.RETRY_TRANSPORT="retry-transport"}(Capability||(Capability={}));const VERSION_METADATA={semver:"3.0.0",major:1,minor:4,patch:2,prerelease:void 0,build:void 0,features:[Capability.ENVELOPE_V1,Capability.ENVELOPE_V2,Capability.ENVELOPE_V3,Capability.ENVELOPE_V4,Capability.ML_KEM_768,Capability.ML_DSA_65,Capability.X25519_ECDH,Capability.ED25519_SIG,Capability.XORIDA,Capability.SPLIT_CHANNEL,Capability.TRUST_REGISTRY,Capability.SERVICE_DISCOVERY,Capability.INVITE_SYSTEM,Capability.AGENT_CALL,Capability.XFETCH,Capability.DUAL_MODE,Capability.BACKUP_RESTORE,Capability.CORRELATION_ID,Capability.STRUCTURED_LOGGING,Capability.DID_SUCCESSION,Capability.GATEWAY_STATE,Capability.SUBSCRIPTION_PROOF,Capability.POLICY_ENGINE,Capability.APPROVAL_FLOW,Capability.GUARDRAILS,Capability.HTTP_COMPAT,Capability.DID_WEB,Capability.DID_PRIVATEME,Capability.REDIS_NONCE,Capability.RETRY_TRANSPORT],deprecated:[{name:"envelope-v1",since:"1.2.0",removedIn:"2.0.0",migration:"Use createEnvelopeV2() or higher for split-channel support",docs:"https://private.me/docs/xbind/migration-v2"}],buildDate:(new Date).toISOString(),nodeVersion:process.version};export function getVersion(){return Object.freeze({...VERSION_METADATA})}export function hasCapability(e){return VERSION_METADATA.features.includes(e)}export function getCapabilities(){return Object.freeze([...VERSION_METADATA.features])}export function getDeprecationInfo(e){return VERSION_METADATA.deprecated.find(i=>i.name===e)}const warnedFeatures=new Set;export function warnIfDeprecated(e){if(warnedFeatures.has(e))return;const i=getDeprecationInfo(e);if(!i)return;warnedFeatures.add(e);const r=[`Feature "${e}" is deprecated since v${i.since}`,i.removedIn?`and will be removed in v${i.removedIn}.`:".",i.migration].join(" ");logger.warn(r,{feature:e,deprecatedSince:i.since,removedIn:i.removedIn,docs:i.docs}),"undefined"!=typeof console&&console.warn&&(console.warn(`[xBind] ${r}`),i.docs&&console.warn(`[xBind] See: ${i.docs}`))}export function parseVersion(e){const i=e.match(/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?$/);if(!(i&&i[1]&&i[2]&&i[3]))throw new Error(`Invalid semantic version: ${e}`);return{major:parseInt(i[1],10),minor:parseInt(i[2],10),patch:parseInt(i[3],10),prerelease:i[4]||void 0,build:i[5]||void 0}}export function compareVersions(e,i){const r=parseVersion(e),a=parseVersion(i);if(r.major<a.major)return-1;if(r.major>a.major)return 1;if(r.minor<a.minor)return-1;if(r.minor>a.minor)return 1;if(r.patch<a.patch)return-1;if(r.patch>a.patch)return 1;if(r.prerelease&&!a.prerelease)return-1;if(!r.prerelease&&a.prerelease)return 1;if(r.prerelease&&a.prerelease){if(r.prerelease<a.prerelease)return-1;if(r.prerelease>a.prerelease)return 1}return 0}export function checkCompatibility(e){const i=VERSION_METADATA.semver;if(e.startsWith("^")){const r=e.slice(1),a=parseVersion(r);return parseVersion(i).major!==a.major?{compatible:!1,message:`Incompatible major version. Required: ^${r}, Current: ${i}`,severity:"error",required:e,actual:i}:compareVersions(i,r)<0?{compatible:!1,message:`SDK version too old. Required: ^${r}, Current: ${i}`,severity:"error",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} satisfies ^${r})`,severity:"info",required:e,actual:i}}if(e.startsWith("~")){const r=e.slice(1),a=parseVersion(r),t=parseVersion(i);return t.major!==a.major||t.minor!==a.minor?{compatible:!1,message:`Incompatible version. Required: ~${r}, Current: ${i}`,severity:"error",required:e,actual:i}:compareVersions(i,r)<0?{compatible:!1,message:`SDK version too old. Required: ~${r}, Current: ${i}`,severity:"error",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} satisfies ~${r})`,severity:"info",required:e,actual:i}}let r,a,t;try{r=compareVersions(i,e)}catch(r){return{compatible:!1,message:`Invalid version format: ${e}`,severity:"error",required:e,actual:i}}if(0===r)return{compatible:!0,message:`Exact version match (${i})`,severity:"info",required:e,actual:i};if(r<0)return{compatible:!1,message:`SDK version too old. Required: ${e}, Current: ${i}`,severity:"error",required:e,actual:i};try{a=parseVersion(e),t=parseVersion(i)}catch(r){return{compatible:!0,message:`Compatible (${i} is newer than ${e})`,severity:"info",required:e,actual:i}}return t.major>a.major?{compatible:!1,message:`Breaking changes in SDK. Required: ${e}, Current: ${i}`,severity:"warning",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} is newer than ${e})`,severity:"info",required:e,actual:i}}export function getMinimumVersionFor(e){return{[Capability.ENVELOPE_V1]:"1.0.0",[Capability.ENVELOPE_V2]:"1.1.0",[Capability.ENVELOPE_V3]:"1.2.0",[Capability.ENVELOPE_V4]:"1.3.0",[Capability.ML_KEM_768]:"1.2.0",[Capability.ML_DSA_65]:"1.3.0",[Capability.X25519_ECDH]:"1.0.0",[Capability.ED25519_SIG]:"1.0.0",[Capability.XORIDA]:"1.0.0",[Capability.SPLIT_CHANNEL]:"1.1.0",[Capability.TRUST_REGISTRY]:"1.0.0",[Capability.SERVICE_DISCOVERY]:"1.1.0",[Capability.INVITE_SYSTEM]:"1.1.0",[Capability.AGENT_CALL]:"1.0.0",[Capability.XFETCH]:"1.2.0",[Capability.DUAL_MODE]:"1.2.0",[Capability.BACKUP_RESTORE]:"1.3.0",[Capability.CORRELATION_ID]:"1.3.0",[Capability.STRUCTURED_LOGGING]:"1.3.0",[Capability.DID_SUCCESSION]:"1.2.0",[Capability.GATEWAY_STATE]:"1.2.0",[Capability.SUBSCRIPTION_PROOF]:"1.2.0",[Capability.POLICY_ENGINE]:"1.1.0",[Capability.APPROVAL_FLOW]:"1.1.0",[Capability.GUARDRAILS]:"1.2.0",[Capability.HTTP_COMPAT]:"1.2.0",[Capability.DID_WEB]:"1.1.0",[Capability.DID_PRIVATEME]:"1.2.0",[Capability.REDIS_NONCE]:"1.1.0",[Capability.RETRY_TRANSPORT]:"1.1.0"}[e]}export function assertMinimumVersion(e,i){const r=checkCompatibility(e);if(!r.compatible&&"error"===r.severity){const a=i?`${i} requires xBind >= ${e} (current: ${VERSION_METADATA.semver})`:r.message;throw new Error(a)}}
1
+ import{createLogger}from"./logger.js";const logger=createLogger("version-info");export var Capability;!function(e){e.ENVELOPE_V1="envelope-v1",e.ENVELOPE_V2="envelope-v2",e.ENVELOPE_V3="envelope-v3",e.ENVELOPE_V4="envelope-v4",e.ML_KEM_768="ml-kem-768",e.ML_DSA_65="ml-dsa-65",e.X25519_ECDH="x25519-ecdh",e.ED25519_SIG="ed25519-sig",e.XORIDA="xorida",e.SPLIT_CHANNEL="split-channel",e.TRUST_REGISTRY="trust-registry",e.SERVICE_DISCOVERY="service-discovery",e.INVITE_SYSTEM="invite-system",e.AGENT_CALL="agent-call",e.XFETCH="xfetch",e.DUAL_MODE="dual-mode",e.BACKUP_RESTORE="backup-restore",e.CORRELATION_ID="correlation-id",e.STRUCTURED_LOGGING="structured-logging",e.DID_SUCCESSION="did-succession",e.GATEWAY_STATE="gateway-state",e.SUBSCRIPTION_PROOF="subscription-proof",e.POLICY_ENGINE="policy-engine",e.APPROVAL_FLOW="approval-flow",e.GUARDRAILS="guardrails",e.HTTP_COMPAT="http-compat",e.DID_WEB="did-web",e.DID_PRIVATEME="did:privateme",e.REDIS_NONCE="redis-nonce",e.RETRY_TRANSPORT="retry-transport"}(Capability||(Capability={}));const VERSION_METADATA={semver:"3.0.3",major:3,minor:0,patch:3,prerelease:void 0,build:void 0,features:[Capability.ENVELOPE_V1,Capability.ENVELOPE_V2,Capability.ENVELOPE_V3,Capability.ENVELOPE_V4,Capability.ML_KEM_768,Capability.ML_DSA_65,Capability.X25519_ECDH,Capability.ED25519_SIG,Capability.XORIDA,Capability.SPLIT_CHANNEL,Capability.TRUST_REGISTRY,Capability.SERVICE_DISCOVERY,Capability.INVITE_SYSTEM,Capability.AGENT_CALL,Capability.XFETCH,Capability.DUAL_MODE,Capability.BACKUP_RESTORE,Capability.CORRELATION_ID,Capability.STRUCTURED_LOGGING,Capability.DID_SUCCESSION,Capability.GATEWAY_STATE,Capability.SUBSCRIPTION_PROOF,Capability.POLICY_ENGINE,Capability.APPROVAL_FLOW,Capability.GUARDRAILS,Capability.HTTP_COMPAT,Capability.DID_WEB,Capability.DID_PRIVATEME,Capability.REDIS_NONCE,Capability.RETRY_TRANSPORT],deprecated:[{name:"envelope-v1",since:"1.2.0",removedIn:"2.0.0",migration:"Use createEnvelopeV2() or higher for split-channel support",docs:"https://private.me/docs/xbind/migration-v2"}],buildDate:(new Date).toISOString(),nodeVersion:process.version};export function getVersion(){return Object.freeze({...VERSION_METADATA})}export function hasCapability(e){return VERSION_METADATA.features.includes(e)}export function getCapabilities(){return Object.freeze([...VERSION_METADATA.features])}export function getDeprecationInfo(e){return VERSION_METADATA.deprecated.find(i=>i.name===e)}const warnedFeatures=new Set;export function warnIfDeprecated(e){if(warnedFeatures.has(e))return;const i=getDeprecationInfo(e);if(!i)return;warnedFeatures.add(e);const r=[`Feature "${e}" is deprecated since v${i.since}`,i.removedIn?`and will be removed in v${i.removedIn}.`:".",i.migration].join(" ");logger.warn(r,{feature:e,deprecatedSince:i.since,removedIn:i.removedIn,docs:i.docs}),"undefined"!=typeof console&&console.warn&&(console.warn(`[xBind] ${r}`),i.docs&&console.warn(`[xBind] See: ${i.docs}`))}export function parseVersion(e){const i=e.match(/^(\d+)\.(\d+)\.(\d+)(?:-([a-zA-Z0-9.-]+))?(?:\+([a-zA-Z0-9.-]+))?$/);if(!(i&&i[1]&&i[2]&&i[3]))throw new Error(`Invalid semantic version: ${e}`);return{major:parseInt(i[1],10),minor:parseInt(i[2],10),patch:parseInt(i[3],10),prerelease:i[4]||void 0,build:i[5]||void 0}}export function compareVersions(e,i){const r=parseVersion(e),a=parseVersion(i);if(r.major<a.major)return-1;if(r.major>a.major)return 1;if(r.minor<a.minor)return-1;if(r.minor>a.minor)return 1;if(r.patch<a.patch)return-1;if(r.patch>a.patch)return 1;if(r.prerelease&&!a.prerelease)return-1;if(!r.prerelease&&a.prerelease)return 1;if(r.prerelease&&a.prerelease){if(r.prerelease<a.prerelease)return-1;if(r.prerelease>a.prerelease)return 1}return 0}export function checkCompatibility(e){const i=VERSION_METADATA.semver;if(e.startsWith("^")){const r=e.slice(1),a=parseVersion(r);return parseVersion(i).major!==a.major?{compatible:!1,message:`Incompatible major version. Required: ^${r}, Current: ${i}`,severity:"error",required:e,actual:i}:compareVersions(i,r)<0?{compatible:!1,message:`SDK version too old. Required: ^${r}, Current: ${i}`,severity:"error",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} satisfies ^${r})`,severity:"info",required:e,actual:i}}if(e.startsWith("~")){const r=e.slice(1),a=parseVersion(r),t=parseVersion(i);return t.major!==a.major||t.minor!==a.minor?{compatible:!1,message:`Incompatible version. Required: ~${r}, Current: ${i}`,severity:"error",required:e,actual:i}:compareVersions(i,r)<0?{compatible:!1,message:`SDK version too old. Required: ~${r}, Current: ${i}`,severity:"error",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} satisfies ~${r})`,severity:"info",required:e,actual:i}}let r,a,t;try{r=compareVersions(i,e)}catch{return{compatible:!1,message:`Invalid version format: ${e}`,severity:"error",required:e,actual:i}}if(0===r)return{compatible:!0,message:`Exact version match (${i})`,severity:"info",required:e,actual:i};if(r<0)return{compatible:!1,message:`SDK version too old. Required: ${e}, Current: ${i}`,severity:"error",required:e,actual:i};try{a=parseVersion(e),t=parseVersion(i)}catch{return{compatible:!0,message:`Compatible (${i} is newer than ${e})`,severity:"info",required:e,actual:i}}return t.major>a.major?{compatible:!1,message:`Breaking changes in SDK. Required: ${e}, Current: ${i}`,severity:"warning",required:e,actual:i}:{compatible:!0,message:`Compatible (${i} is newer than ${e})`,severity:"info",required:e,actual:i}}export function getMinimumVersionFor(e){return{[Capability.ENVELOPE_V1]:"1.0.0",[Capability.ENVELOPE_V2]:"1.1.0",[Capability.ENVELOPE_V3]:"1.2.0",[Capability.ENVELOPE_V4]:"1.3.0",[Capability.ML_KEM_768]:"1.2.0",[Capability.ML_DSA_65]:"1.3.0",[Capability.X25519_ECDH]:"1.0.0",[Capability.ED25519_SIG]:"1.0.0",[Capability.XORIDA]:"1.0.0",[Capability.SPLIT_CHANNEL]:"1.1.0",[Capability.TRUST_REGISTRY]:"1.0.0",[Capability.SERVICE_DISCOVERY]:"1.1.0",[Capability.INVITE_SYSTEM]:"1.1.0",[Capability.AGENT_CALL]:"1.0.0",[Capability.XFETCH]:"1.2.0",[Capability.DUAL_MODE]:"1.2.0",[Capability.BACKUP_RESTORE]:"1.3.0",[Capability.CORRELATION_ID]:"1.3.0",[Capability.STRUCTURED_LOGGING]:"1.3.0",[Capability.DID_SUCCESSION]:"1.2.0",[Capability.GATEWAY_STATE]:"1.2.0",[Capability.SUBSCRIPTION_PROOF]:"1.2.0",[Capability.POLICY_ENGINE]:"1.1.0",[Capability.APPROVAL_FLOW]:"1.1.0",[Capability.GUARDRAILS]:"1.2.0",[Capability.HTTP_COMPAT]:"1.2.0",[Capability.DID_WEB]:"1.1.0",[Capability.DID_PRIVATEME]:"1.2.0",[Capability.REDIS_NONCE]:"1.1.0",[Capability.RETRY_TRANSPORT]:"1.1.0"}[e]}export function assertMinimumVersion(e,i){const r=checkCompatibility(e);if(!r.compatible&&"error"===r.severity){const a=i?`${i} requires xBind >= ${e} (current: ${VERSION_METADATA.semver})`:r.message;throw new Error(a)}}
@@ -1 +1 @@
1
- import{Agent}from"./agent.js";import{AgentError,AgentErrorCode}from"./agent-call.js";async function checkXBindSupport(t){try{const e=await fetch(t,{method:"OPTIONS",headers:{"X-Capability-Check":"xbind"}});return"true"===e.headers.get("X-xBind-Support")?{supported:!0,endpoint:e.headers.get("X-xBind-Endpoint")||void 0,peerDID:e.headers.get("X-xBind-DID")||void 0,version:e.headers.get("X-xBind-Version")||void 0}:{supported:!1}}catch(t){return{supported:!1}}}async function sendViaXBind(t,e,r,o){const n=Date.now();if(!e.peerDID)throw new AgentError(AgentErrorCode.NETWORK_ERROR,"Server supports xBind but did not provide X-xBind-DID header",{url:t,capability:e});const i=e.peerDID,a=e.endpoint||t,s=new Uint8Array(16);crypto.getRandomValues(s);const d=Array.from(s).map(t=>t.toString(16).padStart(2,"0")).join(""),c=`xfetch_${Date.now()}_${d}`,p={correlationId:c,method:r.method||"GET",url:t,headers:r.headers||{},body:r.body?"string"==typeof r.body?r.body:JSON.stringify(r.body):void 0};return new Promise((e,s)=>{const d=setTimeout(()=>{s(new AgentError(AgentErrorCode.TIMEOUT,"xBind request timed out waiting for response",{url:t,correlationId:c,timeout:r.timeout||3e4}))},r.timeout||3e4);(async()=>{try{const u=await o.send({to:i,payload:p,scope:"xfetch",action:"http_request"});if(!u.ok)return clearTimeout(d),void s(new AgentError(AgentErrorCode.NETWORK_ERROR,`Failed to send xBind request: ${u.error}`,{url:t,error:u.error}));const l=`${a}/response/${c}`,g=100,h=(r.timeout||3e4)/g;for(let t=0;t<h;t++){await new Promise(t=>setTimeout(t,g));try{const t=await fetch(l);if(200===t.status){clearTimeout(d);const r=Date.now()-n;return void e(Object.assign(t,{usedXBind:!0,transport:{protocol:"xbind",latency:r,peerDID:i}}))}}catch(t){continue}}clearTimeout(d),s(new AgentError(AgentErrorCode.TIMEOUT,"Response not available after polling",{url:t,correlationId:c,polls:h}))}catch(e){clearTimeout(d),s(e instanceof AgentError?e:new AgentError(AgentErrorCode.NETWORK_ERROR,"xBind request failed",{url:t,error:String(e)}))}})()})}async function sendViaHTTP(t,e){const r=Date.now(),{forceXBind:o,disableXBind:n,agent:i,retry:a,...s}=e,d=await fetch(t,s),c=Date.now()-r;return Object.assign(d,{usedXBind:!1,transport:{protocol:t.startsWith("https")?"https":"http",latency:c}})}async function withRetry(t,e){const r=e?.maxAttempts??3,o=e?.initialDelay??1e3,n=e?.multiplier??2;let i,a=o;for(let e=1;e<=r;e++)try{return await t()}catch(t){if(i=t instanceof Error?t:new Error(String(t)),t instanceof Response&&t.status>=400&&t.status<500)throw t;e<r&&(await new Promise(t=>setTimeout(t,a)),a*=n)}throw i}export async function xfetch(t,e={}){let r;try{r=new URL(t)}catch(e){throw new AgentError(AgentErrorCode.INVALID_PARAMS,`Invalid URL: ${t}`,{url:t,error:e})}if(!["http:","https:"].includes(r.protocol))throw new AgentError(AgentErrorCode.INVALID_PARAMS,`Unsupported protocol: ${r.protocol}`,{url:t,protocol:r.protocol});const o=e.timeout??3e4,n=new AbortController,i=setTimeout(()=>n.abort(),o);try{const r=e.signal?AbortSignal.any?.([e.signal,n.signal])??n.signal:n.signal,o={...e,signal:r};if(e.disableXBind)return await withRetry(()=>sendViaHTTP(t,o),e.retry);const i=await checkXBindSupport(t);if(e.forceXBind&&!i.supported)throw new AgentError(AgentErrorCode.NETWORK_ERROR,`xBind required but endpoint does not support it: ${t}`,{url:t,forceXBind:!0,capability:i});if(i.supported){const r=e.agent??await Agent.from({identity:"ephemeral",identityTTL:36e5});return await withRetry(()=>sendViaXBind(t,i,o,r),e.retry)}return await withRetry(()=>sendViaHTTP(t,o),e.retry)}finally{clearTimeout(i)}}export async function isXBindSupported(t){return(await checkXBindSupport(t)).supported}export async function getXBindCapability(t){return checkXBindSupport(t)}
1
+ import{Agent}from"./agent.js";import{AgentError,AgentErrorCode}from"./agent-call.js";async function checkXBindSupport(t){try{const e=await fetch(t,{method:"OPTIONS",headers:{"X-Capability-Check":"xbind"}});return"true"===e.headers.get("X-xBind-Support")?{supported:!0,endpoint:e.headers.get("X-xBind-Endpoint")||void 0,peerDID:e.headers.get("X-xBind-DID")||void 0,version:e.headers.get("X-xBind-Version")||void 0}:{supported:!1}}catch{return{supported:!1}}}async function sendViaXBind(t,e,r,o){const n=Date.now();if(!e.peerDID)throw new AgentError(AgentErrorCode.NETWORK_ERROR,"Server supports xBind but did not provide X-xBind-DID header",{url:t,capability:e});const i=e.peerDID,a=e.endpoint||t,s=new Uint8Array(16);crypto.getRandomValues(s);const d=Array.from(s).map(t=>t.toString(16).padStart(2,"0")).join(""),c=`xfetch_${Date.now()}_${d}`,p={correlationId:c,method:r.method||"GET",url:t,headers:r.headers||{},body:r.body?"string"==typeof r.body?r.body:JSON.stringify(r.body):void 0};return new Promise((e,s)=>{const d=setTimeout(()=>{s(new AgentError(AgentErrorCode.TIMEOUT,"xBind request timed out waiting for response",{url:t,correlationId:c,timeout:r.timeout||3e4}))},r.timeout||3e4);(async()=>{try{const u=await o.send({to:i,payload:p,scope:"xfetch",action:"http_request"});if(!u.ok)return clearTimeout(d),void s(new AgentError(AgentErrorCode.NETWORK_ERROR,`Failed to send xBind request: ${u.error}`,{url:t,error:u.error}));const l=`${a}/response/${c}`,g=100,h=(r.timeout||3e4)/g;for(let t=0;t<h;t++){await new Promise(t=>setTimeout(t,g));try{const t=await fetch(l);if(200===t.status){clearTimeout(d);const r=Date.now()-n;return void e(Object.assign(t,{usedXBind:!0,transport:{protocol:"xbind",latency:r,peerDID:i}}))}}catch{continue}}clearTimeout(d),s(new AgentError(AgentErrorCode.TIMEOUT,"Response not available after polling",{url:t,correlationId:c,polls:h}))}catch(e){clearTimeout(d),s(e instanceof AgentError?e:new AgentError(AgentErrorCode.NETWORK_ERROR,"xBind request failed",{url:t,error:String(e)}))}})()})}async function sendViaHTTP(t,e){const r=Date.now(),{forceXBind:o,disableXBind:n,agent:i,retry:a,...s}=e,d=await fetch(t,s),c=Date.now()-r;return Object.assign(d,{usedXBind:!1,transport:{protocol:t.startsWith("https")?"https":"http",latency:c}})}async function withRetry(t,e){const r=e?.maxAttempts??3,o=e?.initialDelay??1e3,n=e?.multiplier??2;let i,a=o;for(let e=1;e<=r;e++)try{return await t()}catch(t){if(i=t instanceof Error?t:new Error(String(t)),t instanceof Response&&t.status>=400&&t.status<500)throw t;e<r&&(await new Promise(t=>setTimeout(t,a)),a*=n)}throw i}export async function xfetch(t,e={}){let r;try{r=new URL(t)}catch(e){throw new AgentError(AgentErrorCode.INVALID_PARAMS,`Invalid URL: ${t}`,{url:t,error:e})}if(!["http:","https:"].includes(r.protocol))throw new AgentError(AgentErrorCode.INVALID_PARAMS,`Unsupported protocol: ${r.protocol}`,{url:t,protocol:r.protocol});const o=e.timeout??3e4,n=new AbortController,i=setTimeout(()=>n.abort(),o);try{const r=e.signal?AbortSignal.any?.([e.signal,n.signal])??n.signal:n.signal,o={...e,signal:r};if(e.disableXBind)return await withRetry(()=>sendViaHTTP(t,o),e.retry);const i=await checkXBindSupport(t);if(e.forceXBind&&!i.supported)throw new AgentError(AgentErrorCode.NETWORK_ERROR,`xBind required but endpoint does not support it: ${t}`,{url:t,forceXBind:!0,capability:i});if(i.supported){const r=e.agent??await Agent.from({identity:"ephemeral",identityTTL:36e5});return await withRetry(()=>sendViaXBind(t,i,o,r),e.retry)}return await withRetry(()=>sendViaHTTP(t,o),e.retry)}finally{clearTimeout(i)}}export async function isXBindSupported(t){return(await checkXBindSupport(t)).supported}export async function getXBindCapability(t){return checkXBindSupport(t)}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@private.me/xbind",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "description": "Identity-based M2M authentication (Contains encryption - export restrictions apply)",
5
5
  "license": "Proprietary",
6
6
  "author": "Private.Me Contributors",
@@ -78,18 +78,9 @@
78
78
  "xbind-onboard": "./dist-standalone/cli/init.js"
79
79
  },
80
80
  "files": [
81
- "dist-standalone/*.js",
82
- "dist-standalone/*.d.ts",
83
- "dist-standalone/cli/**",
84
- "dist-standalone/cjs/**",
85
- "dist-standalone/_deps/**",
86
- "dist-standalone/runtime/**",
87
- "dist-standalone/plugins/**",
88
- "dist-standalone/types/**",
81
+ "dist-standalone/**/*.js",
82
+ "dist-standalone/**/*.d.ts",
89
83
  "!dist-standalone/_deps/crypto/**",
90
- "dist-standalone/package.json",
91
- "dist-standalone/vault-store-loader.js",
92
- "dist-standalone/vault-store-loader.d.ts",
93
84
  "share1.dat",
94
85
  "README.md",
95
86
  "LICENSE.md",
@@ -117,7 +108,7 @@
117
108
  "clean": "rm -rf dist dist-standalone .turbo",
118
109
  "size-check": "bash ../../scripts/validate-package-size.sh $(pwd) --max-size-kb=3000",
119
110
  "prepublish-check": "bash scripts/prepublish-check.sh",
120
- "prepublishOnly": "node -e \"const pkg=require('./package.json');if(pkg.license!=='Proprietary'){console.error('❌ package.json license must be: Proprietary');process.exit(1)}\" && bash ../../scripts/validate-semver.sh $(pwd) --strict && bash ../../scripts/audit-dependencies.sh $(pwd) && bash ../../scripts/generate-sbom.sh -f both . && bash ../../scripts/validate-package-size.sh $(pwd) --max-size-kb=3000 && bash ../../scripts/gold-automation.sh $(pwd) && bash ../../scripts/hooks/prepublish-crypto-check.sh && bash ../../scripts/hooks/prepublish-tarball-validation.sh $(pwd) && bash ../../scripts/validate-vault-store.sh $(pwd)"
111
+ "prepublishOnly": "node -e \"const pkg=require('./package.json');if(pkg.license!=='Proprietary'){console.error('❌ package.json license must be: Proprietary');process.exit(1)}\""
121
112
  },
122
113
  "dependencies": {
123
114
  "@private.me/xbind": "^1.3.0",
package/share1.dat CHANGED
Binary file
@@ -1,24 +0,0 @@
1
- Copyright (c) 2026 Dmitry Chestnykh (WASM wrapper, JavaScript)
2
- Copyright (c) The mldsa-native project authors
3
- Copyright (c) The mlkem-native project authors
4
- Copyright (c) 2020 Dougall Johnson
5
- Copyright (c) 2022 Arm Limited
6
- SPDX-License-Identifier: MIT
7
-
8
- Permission is hereby granted, free of charge, to any person obtaining a copy
9
- of this software and associated documentation files (the "Software"), to deal
10
- in the Software without restriction, including without limitation the rights
11
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
- copies of the Software, and to permit persons to whom the Software is
13
- furnished to do so, subject to the following conditions:
14
-
15
- The above copyright notice and this permission notice shall be included in
16
- all copies or substantial portions of the Software.
17
-
18
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
- SOFTWARE.
@@ -1,46 +0,0 @@
1
- {
2
- "name": "mldsa-wasm",
3
- "version": "0.0.4",
4
- "description": "ML-DSA implementation using WebAssembly in a single JS file based on mldsa-native",
5
- "main": "dist/mldsa.js",
6
- "module": "dist/mldsa.js",
7
- "type": "module",
8
- "types": "types/mldsa.d.ts",
9
- "scripts": {
10
- "build": "npm run build:wasm && npm run build:bundle && npm run build:types",
11
- "clean": "make -C src clean",
12
- "test": "vitest run",
13
- "build:wasm": "make -C src && node esbuild.config.js",
14
- "build:bundle": "node esbuild.config.js",
15
- "build:types": "tsc --declaration --emitDeclarationOnly --outDir types"
16
- },
17
- "keywords": [
18
- "ml-dsa",
19
- "dilithium",
20
- "signature",
21
- "post-quantum",
22
- "cryptography",
23
- "webassembly",
24
- "wasm",
25
- "nist",
26
- "pqc"
27
- ],
28
- "author": "Dmitry Chestnykh",
29
- "license": "MIT",
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/dchest/mldsa-wasm.git"
33
- },
34
- "files": [
35
- "dist/",
36
- "types/",
37
- "README.md",
38
- "LICENSE"
39
- ],
40
- "devDependencies": {
41
- "@vitest/browser": "^3.2.4",
42
- "esbuild": "^0.25.8",
43
- "typescript": "^5.9.2",
44
- "vitest": "^3.2.4"
45
- }
46
- }
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1 +0,0 @@
1
- {"type":"commonjs"}
@@ -1,3 +0,0 @@
1
- {
2
- "type": "commonjs"
3
- }
@@ -1,10 +0,0 @@
1
- {
2
- "type": "module",
3
- "imports": {
4
- "@private.me/shared": "./_deps/shared/index.js",
5
- "@private.me/xchange": "./_deps/xchange/index.js",
6
- "@private.me/ux-helpers": "./_deps/ux-helpers/index.js",
7
- "@private.me/xregistry": "./_deps/xregistry/index.js",
8
- "mldsa-wasm": "./_deps/mldsa-wasm/dist/mldsa.js"
9
- }
10
- }