@markii/host 0.17.0-next.4 → 0.17.0-next.6

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 (48) hide show
  1. package/README.md +28 -1
  2. package/dist/browser-worker.classic.js +43 -43
  3. package/dist/browser-worker.js +43 -43
  4. package/dist/conformance/host/17-export-linked-set/expected.json +17 -0
  5. package/dist/conformance/host/17-export-linked-set/files/second.mk.md +3 -0
  6. package/dist/conformance/host/17-export-linked-set/note.mk.md +4 -0
  7. package/dist/conformance/host/17-export-linked-set/scenario.json +6 -0
  8. package/dist/conformance/host/18-last-run-and-grants/expected.json +42 -0
  9. package/dist/conformance/host/18-last-run-and-grants/note.mk.md +5 -0
  10. package/dist/conformance/host/18-last-run-and-grants/scenario.json +27 -0
  11. package/dist/conformance/host/README.md +24 -14
  12. package/dist/conformance.d.ts +1 -1
  13. package/dist/conformance.js +1 -1
  14. package/dist/diagnostics/render-diagnostics.d.ts +1 -1
  15. package/dist/host/adapter.d.ts +28 -6
  16. package/dist/host/cascade-export-behavior.d.ts +26 -8
  17. package/dist/host/cascade-export-behavior.js +64 -1
  18. package/dist/host/conformance-runner.d.ts +11 -1
  19. package/dist/host/conformance-runner.js +80 -4
  20. package/dist/host/create-host.d.ts +250 -44
  21. package/dist/host/create-host.js +222 -96
  22. package/dist/host/export-behavior.d.ts +2 -0
  23. package/dist/host/export-behavior.js +10 -4
  24. package/dist/host/pack-archive.d.ts +7 -6
  25. package/dist/host/pack-archive.js +11 -7
  26. package/dist/host/pack-install.js +9 -7
  27. package/dist/host/pack-remove.d.ts +7 -18
  28. package/dist/host/pack-remove.js +2 -0
  29. package/dist/host/pack-trust-behavior.d.ts +13 -36
  30. package/dist/host/pack-trust-behavior.js +23 -2
  31. package/dist/host/run-behavior.d.ts +25 -34
  32. package/dist/host/run-behavior.js +31 -5
  33. package/dist/host/terminal-packs.d.ts +1 -1
  34. package/dist/index.d.ts +8 -10
  35. package/dist/index.js +1 -1
  36. package/dist/internal.d.ts +10 -5
  37. package/dist/internal.js +4 -3
  38. package/dist/node-worker.js +3 -1
  39. package/dist/node.d.ts +1 -2
  40. package/dist/node.js +1 -1
  41. package/dist/run/bundle-run.d.ts +1 -1
  42. package/dist/run/bundle-run.js +1 -1
  43. package/dist/run/node-isolate.d.ts +6 -2
  44. package/dist/run/node-isolate.js +2 -0
  45. package/dist/run/run-host.d.ts +2 -2
  46. package/dist/run/worker-entry-browser.d.ts +6 -1
  47. package/dist/run/worker-entry-browser.js +62 -5
  48. package/package.json +11 -11
package/README.md CHANGED
@@ -25,4 +25,31 @@ Entries:
25
25
  - `@markii/host/conformance`: the host scenario corpus and its runner, to
26
26
  prove an adapter behaves like the reference apps.
27
27
 
28
- See `docs/integration.md` in the repository for how to write a host.
28
+ A minimal browser host is one adapter and one call:
29
+
30
+ ```ts
31
+ import { createMarkiiHost } from '@markii/host';
32
+ import {
33
+ createBrowserHostIsolate,
34
+ createFetchNetProvider,
35
+ } from '@markii/host/browser';
36
+
37
+ const host = createMarkiiHost({
38
+ id: 'my-app',
39
+ labels,
40
+ readFile,
41
+ exists,
42
+ writeFile,
43
+ listFolder,
44
+ prompt: (request) => showDialog(request),
45
+ memento,
46
+ diagnostics: (line) => console.info(line),
47
+ now: () => Date.now(),
48
+ isolate: createBrowserHostIsolate({
49
+ netProvider: createFetchNetProvider({ allowedOrigins }),
50
+ }),
51
+ });
52
+ ```
53
+
54
+ See `docs/hosts.md` in the repository for the adapter fields, the host
55
+ responsibilities and the reference hosts.