@fairfox/polly 0.20.0 → 0.21.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 (81) hide show
  1. package/README.md +11 -0
  2. package/dist/src/background/index.js +22 -12
  3. package/dist/src/background/index.js.map +8 -8
  4. package/dist/src/background/message-router.js +22 -12
  5. package/dist/src/background/message-router.js.map +8 -8
  6. package/dist/src/client/index.js +187 -154
  7. package/dist/src/client/index.js.map +4 -4
  8. package/dist/src/elysia/index.d.ts +2 -0
  9. package/dist/src/elysia/index.js +195 -25
  10. package/dist/src/elysia/index.js.map +8 -5
  11. package/dist/src/elysia/peer-repo-plugin.d.ts +79 -0
  12. package/dist/src/elysia/plugin.d.ts +3 -3
  13. package/dist/src/elysia/signaling-server-plugin.d.ts +121 -0
  14. package/dist/src/index.d.ts +36 -0
  15. package/dist/src/index.js +1752 -13
  16. package/dist/src/index.js.map +31 -13
  17. package/dist/src/shared/adapters/index.js +22 -12
  18. package/dist/src/shared/adapters/index.js.map +7 -7
  19. package/dist/src/shared/lib/_client-only.d.ts +38 -0
  20. package/dist/src/shared/lib/access.d.ts +124 -0
  21. package/dist/src/shared/lib/blob-ref.d.ts +72 -0
  22. package/dist/src/shared/lib/context-helpers.js +22 -12
  23. package/dist/src/shared/lib/context-helpers.js.map +8 -8
  24. package/dist/src/shared/lib/crdt-specialised.d.ts +129 -0
  25. package/dist/src/shared/lib/crdt-state.d.ts +86 -0
  26. package/dist/src/shared/lib/encryption.d.ts +117 -0
  27. package/dist/src/shared/lib/errors.js +19 -9
  28. package/dist/src/shared/lib/errors.js.map +2 -2
  29. package/dist/src/shared/lib/mesh-network-adapter.d.ts +130 -0
  30. package/dist/src/shared/lib/mesh-signaling-client.d.ts +85 -0
  31. package/dist/src/shared/lib/mesh-state.d.ts +102 -0
  32. package/dist/src/shared/lib/mesh-webrtc-adapter.d.ts +132 -0
  33. package/dist/src/shared/lib/message-bus.js +22 -12
  34. package/dist/src/shared/lib/message-bus.js.map +8 -8
  35. package/dist/src/shared/lib/migrate-primitive.d.ts +100 -0
  36. package/dist/src/shared/lib/pairing.d.ts +170 -0
  37. package/dist/src/shared/lib/peer-relay-adapter.d.ts +80 -0
  38. package/dist/src/shared/lib/peer-repo-server.d.ts +83 -0
  39. package/dist/src/shared/lib/peer-state.d.ts +117 -0
  40. package/dist/src/shared/lib/primitive-registry.d.ts +88 -0
  41. package/dist/src/shared/lib/resource.js +22 -12
  42. package/dist/src/shared/lib/resource.js.map +5 -5
  43. package/dist/src/shared/lib/revocation.d.ts +126 -0
  44. package/dist/src/shared/lib/schema-version.d.ts +129 -0
  45. package/dist/src/shared/lib/signing.d.ts +118 -0
  46. package/dist/src/shared/lib/state.js +22 -12
  47. package/dist/src/shared/lib/state.js.map +5 -5
  48. package/dist/src/shared/lib/test-helpers.js +19 -9
  49. package/dist/src/shared/lib/test-helpers.js.map +2 -2
  50. package/dist/src/shared/state/app-state.js +22 -12
  51. package/dist/src/shared/state/app-state.js.map +6 -6
  52. package/dist/src/shared/types/messages.js +19 -9
  53. package/dist/src/shared/types/messages.js.map +2 -2
  54. package/dist/tools/init/src/cli.js +6 -2
  55. package/dist/tools/init/src/cli.js.map +3 -3
  56. package/dist/tools/quality/src/index.js +177 -0
  57. package/dist/tools/quality/src/index.js.map +10 -0
  58. package/dist/tools/test/src/adapters/index.d.ts +2 -2
  59. package/dist/tools/test/src/adapters/index.js +19 -9
  60. package/dist/tools/test/src/adapters/index.js.map +5 -5
  61. package/dist/tools/test/src/browser/harness.d.ts +80 -0
  62. package/dist/tools/test/src/browser/index.d.ts +32 -0
  63. package/dist/tools/test/src/browser/index.js +243 -0
  64. package/dist/tools/test/src/browser/index.js.map +10 -0
  65. package/dist/tools/test/src/browser/run.d.ts +26 -0
  66. package/dist/tools/test/src/index.js +19 -9
  67. package/dist/tools/test/src/index.js.map +5 -5
  68. package/dist/tools/test/src/test-utils.js +19 -9
  69. package/dist/tools/test/src/test-utils.js.map +2 -2
  70. package/dist/tools/verify/specs/tla/MeshState.cfg +21 -0
  71. package/dist/tools/verify/specs/tla/MeshState.tla +247 -0
  72. package/dist/tools/verify/specs/tla/PeerState.cfg +27 -0
  73. package/dist/tools/verify/specs/tla/PeerState.tla +238 -0
  74. package/dist/tools/verify/specs/tla/README.md +27 -3
  75. package/dist/tools/verify/src/cli.js +10 -6
  76. package/dist/tools/verify/src/cli.js.map +10 -10
  77. package/dist/tools/verify/src/config.js +19 -9
  78. package/dist/tools/verify/src/config.js.map +2 -2
  79. package/dist/tools/visualize/src/cli.js +6 -2
  80. package/dist/tools/visualize/src/cli.js.map +8 -8
  81. package/package.json +52 -12
package/README.md CHANGED
@@ -206,6 +206,17 @@ polly verify Run formal verification
206
206
  polly visualize Generate architecture diagrams (Structurizr DSL)
207
207
  ```
208
208
 
209
+ ## Use with Claude Code
210
+
211
+ This repo ships with a [Claude Code skill](.claude/skills) that knows the full Polly API, verification patterns, and best practices. Install the skill in your project to let Claude help you integrate Polly:
212
+
213
+ ```bash
214
+ # From your project directory
215
+ claude install-skill /path/to/polly/.claude/skills
216
+ ```
217
+
218
+ Then ask Claude things like "How would Polly fit into this project?" or "Add verification to my handlers" and it will have full context on the framework.
219
+
209
220
  ## Licence
210
221
 
211
222
  MIT
@@ -2,27 +2,37 @@ var __defProp = Object.defineProperty;
2
2
  var __getOwnPropNames = Object.getOwnPropertyNames;
3
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
4
  var __hasOwnProp = Object.prototype.hasOwnProperty;
5
- var __moduleCache = /* @__PURE__ */ new WeakMap;
5
+ function __accessProp(key) {
6
+ return this[key];
7
+ }
6
8
  var __toCommonJS = (from) => {
7
- var entry = __moduleCache.get(from), desc;
9
+ var entry = (__moduleCache ??= new WeakMap).get(from), desc;
8
10
  if (entry)
9
11
  return entry;
10
12
  entry = __defProp({}, "__esModule", { value: true });
11
- if (from && typeof from === "object" || typeof from === "function")
12
- __getOwnPropNames(from).map((key) => !__hasOwnProp.call(entry, key) && __defProp(entry, key, {
13
- get: () => from[key],
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- }));
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (var key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(entry, key))
16
+ __defProp(entry, key, {
17
+ get: __accessProp.bind(from, key),
18
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
19
+ });
20
+ }
16
21
  __moduleCache.set(from, entry);
17
22
  return entry;
18
23
  };
24
+ var __moduleCache;
25
+ var __returnValue = (v) => v;
26
+ function __exportSetter(name, newValue) {
27
+ this[name] = __returnValue.bind(null, newValue);
28
+ }
19
29
  var __export = (target, all) => {
20
30
  for (var name in all)
21
31
  __defProp(target, name, {
22
32
  get: all[name],
23
33
  enumerable: true,
24
34
  configurable: true,
25
- set: (newValue) => all[name] = () => newValue
35
+ set: __exportSetter.bind(all, name)
26
36
  });
27
37
  };
28
38
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -259,7 +269,9 @@ class BroadcastChannelSyncAdapter {
259
269
  channel = null;
260
270
  listeners = [];
261
271
  constructor(channelName = "polly-sync") {
262
- if (typeof BroadcastChannel !== "undefined") {
272
+ if (typeof BroadcastChannel === "undefined") {
273
+ console.warn("[SyncAdapter] BroadcastChannel not available");
274
+ } else {
263
275
  this.channel = new BroadcastChannel(channelName);
264
276
  this.channel.onmessage = (event) => {
265
277
  if (event.data.type === "STATE_SYNC") {
@@ -268,8 +280,6 @@ class BroadcastChannelSyncAdapter {
268
280
  });
269
281
  }
270
282
  };
271
- } else {
272
- console.warn("[SyncAdapter] BroadcastChannel not available");
273
283
  }
274
284
  }
275
285
  broadcast(message) {
@@ -1805,4 +1815,4 @@ export {
1805
1815
  MessageRouter
1806
1816
  };
1807
1817
 
1808
- //# debugId=2B92AF1B393FF24264756E2164756E21
1818
+ //# debugId=6FBA09F54F024F8664756E2164756E21