effect-actors 0.0.1

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 (119) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +467 -0
  3. package/dist/actor/client.d.ts +11 -0
  4. package/dist/actor/client.js +68 -0
  5. package/dist/actor/definition.d.ts +77 -0
  6. package/dist/actor/definition.js +110 -0
  7. package/dist/actor/state/codec.d.ts +10 -0
  8. package/dist/actor/state/codec.js +117 -0
  9. package/dist/actor/state/compiled.d.ts +17 -0
  10. package/dist/actor/state/compiled.js +1 -0
  11. package/dist/actor/state/layer.d.ts +7 -0
  12. package/dist/actor/state/layer.js +167 -0
  13. package/dist/client/http/errors.d.ts +30 -0
  14. package/dist/client/http/errors.js +72 -0
  15. package/dist/client/http/events.d.ts +10 -0
  16. package/dist/client/http/events.js +30 -0
  17. package/dist/client/http/layer.d.ts +5 -0
  18. package/dist/client/http/layer.js +133 -0
  19. package/dist/client/http.d.ts +1 -0
  20. package/dist/client/http.js +1 -0
  21. package/dist/client/outcome.d.ts +4 -0
  22. package/dist/client/outcome.js +10 -0
  23. package/dist/client/service.d.ts +28 -0
  24. package/dist/client/service.js +4 -0
  25. package/dist/errors/index.d.ts +93 -0
  26. package/dist/errors/index.js +93 -0
  27. package/dist/gateway/access.d.ts +11 -0
  28. package/dist/gateway/access.js +38 -0
  29. package/dist/gateway/dispatch.d.ts +13 -0
  30. package/dist/gateway/dispatch.js +45 -0
  31. package/dist/gateway/fault.d.ts +32 -0
  32. package/dist/gateway/fault.js +85 -0
  33. package/dist/gateway/http/events.d.ts +8 -0
  34. package/dist/gateway/http/events.js +32 -0
  35. package/dist/gateway/http/response.d.ts +11 -0
  36. package/dist/gateway/http/response.js +57 -0
  37. package/dist/gateway/http/routes.d.ts +6 -0
  38. package/dist/gateway/http/routes.js +184 -0
  39. package/dist/gateway/http/validation.d.ts +19 -0
  40. package/dist/gateway/http/validation.js +92 -0
  41. package/dist/gateway/options.d.ts +31 -0
  42. package/dist/gateway/options.js +107 -0
  43. package/dist/gateway/security.d.ts +25 -0
  44. package/dist/gateway/security.js +4 -0
  45. package/dist/gateway/service.d.ts +113 -0
  46. package/dist/gateway/service.js +5 -0
  47. package/dist/gateway/websocket/operations.d.ts +20 -0
  48. package/dist/gateway/websocket/operations.js +96 -0
  49. package/dist/gateway/websocket.d.ts +8 -0
  50. package/dist/gateway/websocket.js +96 -0
  51. package/dist/gateway/wire.d.ts +172 -0
  52. package/dist/gateway/wire.js +102 -0
  53. package/dist/host/client.d.ts +9 -0
  54. package/dist/host/client.js +46 -0
  55. package/dist/host/definition.d.ts +71 -0
  56. package/dist/host/definition.js +68 -0
  57. package/dist/host/entity.d.ts +9 -0
  58. package/dist/host/entity.js +302 -0
  59. package/dist/index.d.ts +9 -0
  60. package/dist/index.js +9 -0
  61. package/dist/protocol/encoding.d.ts +29 -0
  62. package/dist/protocol/encoding.js +165 -0
  63. package/dist/protocol/index.d.ts +90 -0
  64. package/dist/protocol/index.js +1 -0
  65. package/dist/protocol/schemas.d.ts +49 -0
  66. package/dist/protocol/schemas.js +30 -0
  67. package/dist/runtime/cluster/address.d.ts +3 -0
  68. package/dist/runtime/cluster/address.js +21 -0
  69. package/dist/runtime/cluster/client.d.ts +9 -0
  70. package/dist/runtime/cluster/client.js +131 -0
  71. package/dist/runtime/cluster/protocol.d.ts +104 -0
  72. package/dist/runtime/cluster/protocol.js +69 -0
  73. package/dist/runtime/configuration.d.ts +4 -0
  74. package/dist/runtime/configuration.js +34 -0
  75. package/dist/runtime/dispatchers/layer.d.ts +6 -0
  76. package/dist/runtime/dispatchers/layer.js +53 -0
  77. package/dist/runtime/dispatchers/outbox.d.ts +4 -0
  78. package/dist/runtime/dispatchers/outbox.js +57 -0
  79. package/dist/runtime/layer.d.ts +6 -0
  80. package/dist/runtime/layer.js +43 -0
  81. package/dist/runtime/service.d.ts +40 -0
  82. package/dist/runtime/service.js +5 -0
  83. package/dist/store/memory/background.d.ts +39 -0
  84. package/dist/store/memory/background.js +206 -0
  85. package/dist/store/memory/model.d.ts +72 -0
  86. package/dist/store/memory/model.js +149 -0
  87. package/dist/store/memory/ownership.d.ts +11 -0
  88. package/dist/store/memory/ownership.js +82 -0
  89. package/dist/store/memory/service.d.ts +3 -0
  90. package/dist/store/memory/service.js +32 -0
  91. package/dist/store/memory/state.d.ts +13 -0
  92. package/dist/store/memory/state.js +109 -0
  93. package/dist/store/service.d.ts +89 -0
  94. package/dist/store/service.js +9 -0
  95. package/dist/store/sql/events.d.ts +13 -0
  96. package/dist/store/sql/events.js +89 -0
  97. package/dist/store/sql/model.d.ts +39 -0
  98. package/dist/store/sql/model.js +126 -0
  99. package/dist/store/sql/outbox.d.ts +15 -0
  100. package/dist/store/sql/outbox.js +130 -0
  101. package/dist/store/sql/ownership.d.ts +44 -0
  102. package/dist/store/sql/ownership.js +130 -0
  103. package/dist/store/sql/receipts.d.ts +25 -0
  104. package/dist/store/sql/receipts.js +93 -0
  105. package/dist/store/sql/schema.d.ts +9 -0
  106. package/dist/store/sql/schema.js +124 -0
  107. package/dist/store/sql/service.d.ts +5 -0
  108. package/dist/store/sql/service.js +42 -0
  109. package/dist/store/sql/state.d.ts +13 -0
  110. package/dist/store/sql/state.js +109 -0
  111. package/dist/store/sql/timers.d.ts +10 -0
  112. package/dist/store/sql/timers.js +90 -0
  113. package/dist/store/sql/transaction.d.ts +6 -0
  114. package/dist/store/sql/transaction.js +57 -0
  115. package/dist/store/sql/transition.d.ts +15 -0
  116. package/dist/store/sql/transition.js +154 -0
  117. package/dist/testing/index.d.ts +6 -0
  118. package/dist/testing/index.js +27 -0
  119. package/package.json +80 -0
@@ -0,0 +1,27 @@
1
+ import { Layer } from "effect";
2
+ import { MessageStorage, RunnerHealth, Runners, RunnerStorage, Sharding, ShardingConfig, } from "effect/unstable/cluster";
3
+ import { layer } from "../runtime/service.js";
4
+ import { layerMemory as memoryStore } from "../store/service.js";
5
+ export const configuration = Object.freeze({
6
+ namespace: "test",
7
+ maxCommandBytes: 64 * 1024,
8
+ maxStateBytes: 1024 * 1024,
9
+ maxEventBytes: 64 * 1024,
10
+ maxEventsPerTurn: 128,
11
+ maxOutboxCallsPerTurn: 128,
12
+ maxTimerChangesPerTurn: 128,
13
+ maxTurnDuration: "5 seconds",
14
+ actorLeaseDuration: "30 seconds",
15
+ actorLeaseRenewEvery: "5 seconds",
16
+ });
17
+ const infrastructure = Sharding.layer.pipe(Layer.provideMerge(Runners.layerNoop), Layer.provideMerge(MessageStorage.layerMemory), Layer.provide([RunnerHealth.layerNoop, RunnerStorage.layerMemory]), Layer.provide(ShardingConfig.layer({
18
+ availableShardGroups: [configuration.namespace],
19
+ assignedShardGroups: [configuration.namespace],
20
+ shardsPerGroup: 4,
21
+ entityReplyPollInterval: "10 millis",
22
+ entityMessagePollInterval: "20 millis",
23
+ refreshAssignmentsInterval: "20 millis",
24
+ entityTerminationTimeout: "100 millis",
25
+ entityMaxIdleTime: "5 seconds",
26
+ })));
27
+ export const layerMemory = layer(configuration).pipe(Layer.orDie, Layer.provide(infrastructure), Layer.merge(memoryStore));
package/package.json ADDED
@@ -0,0 +1,80 @@
1
+ {
2
+ "name": "effect-actors",
3
+ "version": "0.0.1",
4
+ "description": "Effect-native actors for durable state and hosted execution",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "main": "./dist/index.js",
9
+ "types": "./dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js"
14
+ },
15
+ "./Actor": {
16
+ "types": "./dist/actor/definition.d.ts",
17
+ "import": "./dist/actor/definition.js"
18
+ },
19
+ "./Store": {
20
+ "types": "./dist/store/service.d.ts",
21
+ "import": "./dist/store/service.js"
22
+ },
23
+ "./Runtime": {
24
+ "types": "./dist/runtime/service.d.ts",
25
+ "import": "./dist/runtime/service.js"
26
+ },
27
+ "./Client": {
28
+ "types": "./dist/client/service.d.ts",
29
+ "import": "./dist/client/service.js"
30
+ },
31
+ "./HostActor": {
32
+ "types": "./dist/host/definition.d.ts",
33
+ "import": "./dist/host/definition.js"
34
+ },
35
+ "./Gateway": {
36
+ "types": "./dist/gateway/service.d.ts",
37
+ "import": "./dist/gateway/service.js"
38
+ },
39
+ "./Protocol": {
40
+ "types": "./dist/protocol/index.d.ts",
41
+ "import": "./dist/protocol/index.js"
42
+ },
43
+ "./Errors": {
44
+ "types": "./dist/errors/index.d.ts",
45
+ "import": "./dist/errors/index.js"
46
+ },
47
+ "./Testing": {
48
+ "types": "./dist/testing/index.d.ts",
49
+ "import": "./dist/testing/index.js"
50
+ }
51
+ },
52
+ "files": [
53
+ "dist",
54
+ "README.md",
55
+ "LICENSE"
56
+ ],
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/dallenpyrah/effect-actors.git"
60
+ },
61
+ "bugs": {
62
+ "url": "https://github.com/dallenpyrah/effect-actors/issues"
63
+ },
64
+ "homepage": "https://github.com/dallenpyrah/effect-actors#readme",
65
+ "publishConfig": {
66
+ "access": "public"
67
+ },
68
+ "scripts": {
69
+ "build": "rm -rf dist && tsc --project tsconfig.build.json",
70
+ "lint": "prettier --check --cache --ignore-unknown --ignore-path ../../.prettierignore .",
71
+ "test": "bun test --timeout 30000",
72
+ "typecheck": "tsc --noEmit --project tsconfig.json"
73
+ },
74
+ "dependencies": {
75
+ "canonicalize": "2.1.0"
76
+ },
77
+ "peerDependencies": {
78
+ "effect": "4.0.0-rc.112"
79
+ }
80
+ }