wao 0.40.1 → 0.41.0

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 (76) hide show
  1. package/cjs/accounts-web.js +25 -0
  2. package/cjs/accounts.js +38 -0
  3. package/cjs/adaptor-base.js +504 -287
  4. package/cjs/adaptor-cf.js +42 -0
  5. package/cjs/ao-loader.js +1 -1
  6. package/cjs/ao.js +22 -10
  7. package/cjs/aoconnect-base.js +1010 -546
  8. package/cjs/aoconnect-cf.js +24 -0
  9. package/cjs/ar-remote.js +277 -0
  10. package/cjs/armem-base.js +822 -211
  11. package/cjs/armem-cf.js +128 -0
  12. package/cjs/armem.js +11 -5
  13. package/cjs/bar.js +511 -173
  14. package/cjs/car.js +37 -0
  15. package/cjs/cf-env.js +54 -0
  16. package/cjs/cf.js +76 -0
  17. package/cjs/cli.js +12 -6
  18. package/cjs/create.js +1 -1
  19. package/cjs/devs.js +53 -0
  20. package/cjs/dodb.js +116 -0
  21. package/cjs/hb.js +136 -53
  22. package/cjs/hyperbeam.js +85 -44
  23. package/cjs/keygen.js +94 -0
  24. package/cjs/run.js +4 -1
  25. package/cjs/server.js +40 -9
  26. package/cjs/storage-multi.js +525 -0
  27. package/cjs/tgql-d1.js +664 -0
  28. package/cjs/tgql.js +293 -172
  29. package/cjs/workspace/.claude/agents/tester.md +2 -2
  30. package/cjs/workspace/.claude/skills/build/SKILL.md +2 -2
  31. package/cjs/workspace/.claude/skills/test/SKILL.md +3 -2
  32. package/cjs/workspace/CLAUDE.md +2 -2
  33. package/cjs/workspace/README.md +1 -1
  34. package/cjs/workspace/docs/debug.md +9 -4
  35. package/cjs/workspace/docs/hyperbeam-devices.md +50 -1
  36. package/cjs/workspace/docs/wao-sdk.md +1 -1
  37. package/cjs/workspace/package.json +4 -4
  38. package/esm/accounts-web.js +14 -0
  39. package/esm/accounts.js +27 -0
  40. package/esm/adaptor-base.js +129 -31
  41. package/esm/adaptor-cf.js +11 -0
  42. package/esm/ao-loader.js +1 -1
  43. package/esm/ao.js +24 -5
  44. package/esm/aoconnect-base.js +248 -7
  45. package/esm/aoconnect-cf.js +9 -0
  46. package/esm/ar-remote.js +87 -0
  47. package/esm/armem-base.js +304 -53
  48. package/esm/armem-cf.js +67 -0
  49. package/esm/armem.js +7 -2
  50. package/esm/bar.js +126 -16
  51. package/esm/car.js +10 -0
  52. package/esm/cf-env.js +29 -0
  53. package/esm/cf.js +11 -0
  54. package/esm/cli.js +6 -2
  55. package/esm/create.js +1 -1
  56. package/esm/devs.js +15 -0
  57. package/esm/dodb.js +26 -0
  58. package/esm/hb.js +93 -16
  59. package/esm/hyperbeam.js +68 -30
  60. package/esm/keygen.js +47 -0
  61. package/esm/run.js +4 -1
  62. package/esm/server.js +29 -9
  63. package/esm/storage-multi.js +183 -0
  64. package/esm/tgql-d1.js +407 -0
  65. package/esm/tgql.js +29 -10
  66. package/esm/workspace/.claude/agents/tester.md +2 -2
  67. package/esm/workspace/.claude/skills/build/SKILL.md +2 -2
  68. package/esm/workspace/.claude/skills/test/SKILL.md +3 -2
  69. package/esm/workspace/CLAUDE.md +2 -2
  70. package/esm/workspace/README.md +1 -1
  71. package/esm/workspace/docs/debug.md +9 -4
  72. package/esm/workspace/docs/hyperbeam-devices.md +50 -1
  73. package/esm/workspace/docs/wao-sdk.md +1 -1
  74. package/esm/workspace/package.json +4 -4
  75. package/package.json +10 -3
  76. package/postinstall.cjs +84 -0
package/cjs/ao.js CHANGED
@@ -119,7 +119,9 @@ var AO = /*#__PURE__*/function () {
119
119
  var _hbOpt = {
120
120
  format: this.format
121
121
  };
122
- if (typeof _hb === "string" && _hb !== "ans104") _hbOpt.url = _hb;
122
+ // `hb` can be "ans104" / "httpsig" (format selector with default URL),
123
+ // or an actual URL string. Only treat it as a URL when it looks like one.
124
+ if (typeof _hb === "string" && _hb !== "ans104" && _hb !== "httpsig" && /^(https?:\/\/|\/\/|[a-zA-Z0-9_.-]+:\d+)/.test(_hb)) _hbOpt.url = _hb;
123
125
  this.hb = new _hb2["default"](_hbOpt);
124
126
  this.mode = mode !== null && mode !== void 0 ? mode : "legacy";
125
127
  }
@@ -1220,7 +1222,7 @@ var AO = /*#__PURE__*/function () {
1220
1222
  key: "msg",
1221
1223
  value: function () {
1222
1224
  var _msg = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee10(_ref13) {
1223
- var pid, jwk, data, _ref13$act, act, _ref13$tags, tags, _ref13$check, check, get, _ref13$timeout, timeout, _ref13$mode, mode, _ref13$limit, limit, err, _yield$this$ar$checkW2, mid, res, schedArgs, _yield$this$hb$pushAO2, pushSlot, pushOutbox, _res5, callerAddr, hasCallerReply, raw, parsed, out, _tags3, _mid, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31;
1225
+ var pid, jwk, data, _ref13$act, act, _ref13$tags, tags, _ref13$check, check, get, _ref13$timeout, timeout, _ref13$mode, mode, _ref13$limit, limit, err, _yield$this$ar$checkW2, mid, res, schedArgs, _yield$this$hb$pushAO2, pushSlot, pushOutbox, _res5, _pushTimeoutMs, callerAddr, hasCallerReply, raw, parsed, out, _tags3, _mid, _t24, _t25, _t26, _t27, _t28, _t29, _t30, _t31;
1224
1226
  return _regenerator().w(function (_context10) {
1225
1227
  while (1) switch (_context10.p = _context10.n) {
1226
1228
  case 0:
@@ -1342,12 +1344,22 @@ var AO = /*#__PURE__*/function () {
1342
1344
  });
1343
1345
  case 26:
1344
1346
  res = _context10.v;
1347
+ // v0.9-FINAL's push device can enter long-running recursive loops
1348
+ // for cross-process Send().receive() coroutines. Race the push
1349
+ // call against a 20s timeout so msg() can return rather than
1350
+ // wait forever; the now/results probe below still has a chance
1351
+ // to pick up a partial reply.
1352
+ _pushTimeoutMs = 20000;
1345
1353
  _context10.p = 27;
1346
1354
  _context10.n = 28;
1347
- return this.hb.get({
1355
+ return Promise.race([this.hb.get({
1348
1356
  path: "/".concat(pid, "/push"),
1349
1357
  slot: mid
1350
- });
1358
+ }), new Promise(function (_r, rej) {
1359
+ return setTimeout(function () {
1360
+ return rej(new Error("push timeout"));
1361
+ }, _pushTimeoutMs);
1362
+ })]);
1351
1363
  case 28:
1352
1364
  _context10.n = 30;
1353
1365
  break;
@@ -1609,11 +1621,11 @@ var AO = /*#__PURE__*/function () {
1609
1621
  value: function () {
1610
1622
  var _ress2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee14(_ref16) {
1611
1623
  var _this4 = this;
1612
- var pid, limit, asc, cursor, err, msgs, next, res, sort, _t34;
1624
+ var pid, limit, asc, from, err, msgs, next, res, sort, _t34;
1613
1625
  return _regenerator().w(function (_context14) {
1614
1626
  while (1) switch (_context14.p = _context14.n) {
1615
1627
  case 0:
1616
- pid = _ref16.pid, limit = _ref16.limit, asc = _ref16.asc, cursor = _ref16.cursor;
1628
+ pid = _ref16.pid, limit = _ref16.limit, asc = _ref16.asc, from = _ref16.from;
1617
1629
  err = null;
1618
1630
  msgs = null;
1619
1631
  next = null;
@@ -1629,7 +1641,7 @@ var AO = /*#__PURE__*/function () {
1629
1641
  process: pid,
1630
1642
  limit: limit,
1631
1643
  sort: sort,
1632
- from: cursor
1644
+ from: from
1633
1645
  });
1634
1646
  case 2:
1635
1647
  res = _context14.v;
@@ -1641,7 +1653,7 @@ var AO = /*#__PURE__*/function () {
1641
1653
  process: pid,
1642
1654
  limit: limit,
1643
1655
  sort: sort,
1644
- from: cursor
1656
+ from: from
1645
1657
  });
1646
1658
  case 4:
1647
1659
  res = _context14.v;
@@ -2566,7 +2578,7 @@ var Process = /*#__PURE__*/function () {
2566
2578
  }, {
2567
2579
  key: "r",
2568
2580
  value: function () {
2569
- var _r = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31() {
2581
+ var _r2 = _asyncToGenerator(/*#__PURE__*/_regenerator().m(function _callee31() {
2570
2582
  var _len3,
2571
2583
  opt,
2572
2584
  _key3,
@@ -2582,7 +2594,7 @@ var Process = /*#__PURE__*/function () {
2582
2594
  }, _callee31, this);
2583
2595
  }));
2584
2596
  function r() {
2585
- return _r.apply(this, arguments);
2597
+ return _r2.apply(this, arguments);
2586
2598
  }
2587
2599
  return r;
2588
2600
  }()