@hotmeshio/hotmesh 0.5.6 → 0.5.7
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.
- package/README.md +6 -32
- package/build/index.d.ts +1 -3
- package/build/index.js +1 -5
- package/build/modules/enums.d.ts +0 -5
- package/build/modules/enums.js +1 -6
- package/build/modules/utils.d.ts +1 -1
- package/build/modules/utils.js +2 -29
- package/build/package.json +4 -16
- package/build/services/activities/hook.js +1 -5
- package/build/services/compiler/index.d.ts +2 -2
- package/build/services/compiler/index.js +4 -4
- package/build/services/connector/factory.d.ts +1 -1
- package/build/services/connector/factory.js +1 -11
- package/build/services/exporter/index.d.ts +8 -8
- package/build/services/exporter/index.js +8 -8
- package/build/services/memflow/client.js +1 -8
- package/build/services/memflow/connection.d.ts +0 -2
- package/build/services/memflow/connection.js +0 -2
- package/build/services/memflow/exporter.d.ts +3 -3
- package/build/services/memflow/exporter.js +3 -3
- package/build/services/memflow/index.d.ts +1 -1
- package/build/services/memflow/index.js +1 -1
- package/build/services/memflow/schemas/factory.js +1 -1
- package/build/services/memflow/search.d.ts +11 -4
- package/build/services/memflow/search.js +98 -71
- package/build/services/memflow/worker.d.ts +1 -1
- package/build/services/memflow/worker.js +1 -1
- package/build/services/meshcall/index.d.ts +1 -1
- package/build/services/meshcall/index.js +1 -1
- package/build/services/reporter/index.d.ts +1 -1
- package/build/services/reporter/index.js +12 -12
- package/build/services/search/factory.js +0 -8
- package/build/services/search/providers/postgres/postgres.js +1 -1
- package/build/services/store/cache.d.ts +1 -1
- package/build/services/store/cache.js +1 -1
- package/build/services/store/factory.js +1 -9
- package/build/services/store/index.d.ts +1 -1
- package/build/services/store/providers/postgres/kvtypes/hash/index.js +57 -0
- package/build/services/store/providers/postgres/kvtypes/hash/udata.d.ts +10 -0
- package/build/services/store/providers/postgres/kvtypes/hash/udata.js +384 -0
- package/build/services/store/providers/postgres/postgres.js +2 -6
- package/build/services/stream/factory.js +0 -16
- package/build/services/sub/factory.js +0 -8
- package/build/services/sub/providers/nats/nats.js +0 -1
- package/build/services/task/index.js +0 -1
- package/build/types/activity.d.ts +1 -5
- package/build/types/hotmesh.d.ts +0 -5
- package/build/types/index.d.ts +0 -1
- package/build/types/index.js +1 -4
- package/build/types/job.d.ts +1 -1
- package/build/types/memflow.d.ts +5 -4
- package/build/types/meshcall.d.ts +0 -25
- package/build/types/provider.d.ts +1 -1
- package/build/types/stream.d.ts +1 -6
- package/index.ts +0 -4
- package/package.json +4 -16
- package/build/services/connector/providers/ioredis.d.ts +0 -9
- package/build/services/connector/providers/ioredis.js +0 -26
- package/build/services/connector/providers/redis.d.ts +0 -9
- package/build/services/connector/providers/redis.js +0 -38
- package/build/services/search/providers/redis/ioredis.d.ts +0 -23
- package/build/services/search/providers/redis/ioredis.js +0 -134
- package/build/services/search/providers/redis/redis.d.ts +0 -23
- package/build/services/search/providers/redis/redis.js +0 -147
- package/build/services/store/providers/redis/_base.d.ts +0 -137
- package/build/services/store/providers/redis/_base.js +0 -980
- package/build/services/store/providers/redis/ioredis.d.ts +0 -20
- package/build/services/store/providers/redis/ioredis.js +0 -180
- package/build/services/store/providers/redis/redis.d.ts +0 -18
- package/build/services/store/providers/redis/redis.js +0 -199
- package/build/services/stream/providers/redis/ioredis.d.ts +0 -61
- package/build/services/stream/providers/redis/ioredis.js +0 -272
- package/build/services/stream/providers/redis/redis.d.ts +0 -61
- package/build/services/stream/providers/redis/redis.js +0 -305
- package/build/services/sub/providers/redis/ioredis.d.ts +0 -17
- package/build/services/sub/providers/redis/ioredis.js +0 -81
- package/build/services/sub/providers/redis/redis.d.ts +0 -17
- package/build/services/sub/providers/redis/redis.js +0 -72
- package/build/types/redis.d.ts +0 -258
- package/build/types/redis.js +0 -11
package/README.md
CHANGED
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
**Durable Memory + Coordinated Execution**
|
|
4
4
|
|
|
5
|
-

|
|
5
|
+

|
|
6
6
|
|
|
7
|
-
HotMesh removes the repetitive glue of building durable agents, pipelines, and long‑running workflows. You focus on *what
|
|
7
|
+
HotMesh removes the repetitive glue of building durable agents, pipelines, and long‑running workflows. You focus on *what* to change; HotMesh handles *how*, safely and durably.
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
11
|
## Why Choose HotMesh
|
|
12
12
|
|
|
13
|
+
- **Zero Boilerplate** - Transactional Postgres without the setup hassle
|
|
14
|
+
- **Built-in Durability** - Automatic crash recovery and replay protection
|
|
15
|
+
- **Parallel by Default** - Run hooks concurrently without coordination
|
|
16
|
+
- **SQL-First** - Query pipeline status and agent memory directly
|
|
13
17
|
|
|
14
|
-
- **One memory model** across all your agents and pipelines. No more designing custom persistence for each workflow.
|
|
15
|
-
- **Automatic reliability** with transactional safety, replay protection, and crash recovery built-in.
|
|
16
|
-
- **Natural concurrency** through isolated hooks that can run in parallel without coordination overhead.
|
|
17
|
-
- **Operational transparency** using standard SQL to query live pipeline status and agent memory.
|
|
18
|
-
- **Multi-tenant ready** with clean schema isolation and flexible indexing.
|
|
19
18
|
---
|
|
20
19
|
|
|
21
20
|
## Core Abstractions
|
|
@@ -64,31 +63,6 @@ Thin entrypoints that:
|
|
|
64
63
|
| `get` | Read value at path (or full entity) | `await e.get('user.email')` |
|
|
65
64
|
| `signal` | Mark hook milestone / unlock waiters | `await MemFlow.workflow.signal('phase-x', data)` |
|
|
66
65
|
|
|
67
|
-
The Entity module also provides static methods for cross-entity querying:
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
// Find entities matching conditions
|
|
71
|
-
const activeUsers = await Entity.find('user', {
|
|
72
|
-
status: 'active',
|
|
73
|
-
country: 'US'
|
|
74
|
-
});
|
|
75
|
-
|
|
76
|
-
// Find by specific field condition
|
|
77
|
-
const highValueOrders = await Entity.findByCondition(
|
|
78
|
-
'order',
|
|
79
|
-
'total_amount',
|
|
80
|
-
1000,
|
|
81
|
-
'>=',
|
|
82
|
-
hotMeshClient
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
// Find single entity by ID
|
|
86
|
-
const user = await Entity.findById('user', 'user123', hotMeshClient);
|
|
87
|
-
|
|
88
|
-
// Create optimized index for queries
|
|
89
|
-
await Entity.createIndex('user', 'email', hotMeshClient);
|
|
90
|
-
```
|
|
91
|
-
|
|
92
66
|
---
|
|
93
67
|
|
|
94
68
|
## Table of Contents
|
package/build/index.d.ts
CHANGED
|
@@ -16,9 +16,7 @@ import * as Enums from './modules/enums';
|
|
|
16
16
|
import * as KeyStore from './modules/key';
|
|
17
17
|
import { ConnectorService as Connector } from './services/connector/factory';
|
|
18
18
|
import { PostgresConnection as ConnectorPostgres } from './services/connector/providers/postgres';
|
|
19
|
-
import { RedisConnection as ConnectorIORedis } from './services/connector/providers/ioredis';
|
|
20
|
-
import { RedisConnection as ConnectorRedis } from './services/connector/providers/redis';
|
|
21
19
|
import { NatsConnection as ConnectorNATS } from './services/connector/providers/nats';
|
|
22
20
|
export { Connector, //factory
|
|
23
|
-
|
|
21
|
+
ConnectorNATS, ConnectorPostgres, HotMesh, HotMeshConfig, MeshCall, MemFlow, Client, Connection, proxyActivities, Search, Entity, Worker, workflow, WorkflowHandle, Enums, Errors, Utils, KeyStore, };
|
|
24
22
|
export * as Types from './types';
|
package/build/index.js
CHANGED
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.Types = exports.KeyStore = exports.Utils = exports.Errors = exports.Enums = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Entity = exports.Search = exports.proxyActivities = exports.Connection = exports.Client = exports.MemFlow = exports.MeshCall = exports.HotMesh = exports.
|
|
26
|
+
exports.Types = exports.KeyStore = exports.Utils = exports.Errors = exports.Enums = exports.WorkflowHandle = exports.workflow = exports.Worker = exports.Entity = exports.Search = exports.proxyActivities = exports.Connection = exports.Client = exports.MemFlow = exports.MeshCall = exports.HotMesh = exports.ConnectorPostgres = exports.ConnectorNATS = exports.Connector = void 0;
|
|
27
27
|
const hotmesh_1 = require("./services/hotmesh");
|
|
28
28
|
Object.defineProperty(exports, "HotMesh", { enumerable: true, get: function () { return hotmesh_1.HotMesh; } });
|
|
29
29
|
const meshcall_1 = require("./services/meshcall");
|
|
@@ -58,10 +58,6 @@ const factory_1 = require("./services/connector/factory");
|
|
|
58
58
|
Object.defineProperty(exports, "Connector", { enumerable: true, get: function () { return factory_1.ConnectorService; } });
|
|
59
59
|
const postgres_1 = require("./services/connector/providers/postgres");
|
|
60
60
|
Object.defineProperty(exports, "ConnectorPostgres", { enumerable: true, get: function () { return postgres_1.PostgresConnection; } });
|
|
61
|
-
const ioredis_1 = require("./services/connector/providers/ioredis");
|
|
62
|
-
Object.defineProperty(exports, "ConnectorIORedis", { enumerable: true, get: function () { return ioredis_1.RedisConnection; } });
|
|
63
|
-
const redis_1 = require("./services/connector/providers/redis");
|
|
64
|
-
Object.defineProperty(exports, "ConnectorRedis", { enumerable: true, get: function () { return redis_1.RedisConnection; } });
|
|
65
61
|
const nats_1 = require("./services/connector/providers/nats");
|
|
66
62
|
Object.defineProperty(exports, "ConnectorNATS", { enumerable: true, get: function () { return nats_1.NatsConnection; } });
|
|
67
63
|
exports.Types = __importStar(require("./types"));
|
package/build/modules/enums.d.ts
CHANGED
|
@@ -7,11 +7,6 @@ export declare const HMSH_LOGLEVEL: LogLevel;
|
|
|
7
7
|
* Determines the log level for telemetry. The default is 'info' which emits worker and trigger spans. 'debug' emits all spans.
|
|
8
8
|
*/
|
|
9
9
|
export declare const HMSH_TELEMETRY: "debug" | "info";
|
|
10
|
-
/**
|
|
11
|
-
* If Redis, explicitly sets whether the application is running in a cluster. The default is false.
|
|
12
|
-
* @deprecated
|
|
13
|
-
*/
|
|
14
|
-
export declare const HMSH_IS_CLUSTER: boolean;
|
|
15
10
|
/**
|
|
16
11
|
* Default cleanup time for signal in the db when its associated job is completed.
|
|
17
12
|
*/
|
package/build/modules/enums.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_TASK_QUEUE = exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MEMFLOW_EXP_BACKOFF = exports.HMSH_MEMFLOW_MAX_INTERVAL = exports.HMSH_MEMFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.MAX_STREAM_RETRIES = exports.INITIAL_STREAM_BACKOFF = exports.MAX_STREAM_BACKOFF = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_DEPLOYMENT_PAUSE = exports.HMSH_DEPLOYMENT_DELAY = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MEMFLOW_RETRYABLE = exports.HMSH_CODE_MEMFLOW_FATAL = exports.HMSH_CODE_MEMFLOW_MAXED = exports.HMSH_CODE_MEMFLOW_TIMEOUT = exports.HMSH_CODE_MEMFLOW_WAIT = exports.HMSH_CODE_MEMFLOW_PROXY = exports.HMSH_CODE_MEMFLOW_CHILD = exports.HMSH_CODE_MEMFLOW_ALL = exports.HMSH_CODE_MEMFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.
|
|
3
|
+
exports.DEFAULT_TASK_QUEUE = exports.HMSH_GUID_SIZE = exports.HMSH_SCOUT_INTERVAL_SECONDS = exports.HMSH_FIDELITY_SECONDS = exports.HMSH_EXPIRE_DURATION = exports.HMSH_XPENDING_COUNT = exports.HMSH_XCLAIM_COUNT = exports.HMSH_XCLAIM_DELAY_MS = exports.HMSH_BLOCK_TIME_MS = exports.HMSH_MEMFLOW_EXP_BACKOFF = exports.HMSH_MEMFLOW_MAX_INTERVAL = exports.HMSH_MEMFLOW_MAX_ATTEMPTS = exports.HMSH_GRADUATED_INTERVAL_MS = exports.HMSH_MAX_TIMEOUT_MS = exports.HMSH_MAX_RETRIES = exports.MAX_DELAY = exports.MAX_STREAM_RETRIES = exports.INITIAL_STREAM_BACKOFF = exports.MAX_STREAM_BACKOFF = exports.HMSH_EXPIRE_JOB_SECONDS = exports.HMSH_OTT_WAIT_TIME = exports.HMSH_DEPLOYMENT_PAUSE = exports.HMSH_DEPLOYMENT_DELAY = exports.HMSH_ACTIVATION_MAX_RETRY = exports.HMSH_QUORUM_DELAY_MS = exports.HMSH_QUORUM_ROLLCALL_CYCLES = exports.HMSH_STATUS_UNKNOWN = exports.HMSH_CODE_MEMFLOW_RETRYABLE = exports.HMSH_CODE_MEMFLOW_FATAL = exports.HMSH_CODE_MEMFLOW_MAXED = exports.HMSH_CODE_MEMFLOW_TIMEOUT = exports.HMSH_CODE_MEMFLOW_WAIT = exports.HMSH_CODE_MEMFLOW_PROXY = exports.HMSH_CODE_MEMFLOW_CHILD = exports.HMSH_CODE_MEMFLOW_ALL = exports.HMSH_CODE_MEMFLOW_SLEEP = exports.HMSH_CODE_UNACKED = exports.HMSH_CODE_TIMEOUT = exports.HMSH_CODE_UNKNOWN = exports.HMSH_CODE_INTERRUPT = exports.HMSH_CODE_NOTFOUND = exports.HMSH_CODE_PENDING = exports.HMSH_CODE_SUCCESS = exports.HMSH_SIGNAL_EXPIRE = exports.HMSH_TELEMETRY = exports.HMSH_LOGLEVEL = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* Determines the log level for the application. The default is 'info'.
|
|
6
6
|
*/
|
|
@@ -9,11 +9,6 @@ exports.HMSH_LOGLEVEL = process.env.HMSH_LOGLEVEL || 'info';
|
|
|
9
9
|
* Determines the log level for telemetry. The default is 'info' which emits worker and trigger spans. 'debug' emits all spans.
|
|
10
10
|
*/
|
|
11
11
|
exports.HMSH_TELEMETRY = process.env.HMSH_TELEMETRY || 'info';
|
|
12
|
-
/**
|
|
13
|
-
* If Redis, explicitly sets whether the application is running in a cluster. The default is false.
|
|
14
|
-
* @deprecated
|
|
15
|
-
*/
|
|
16
|
-
exports.HMSH_IS_CLUSTER = process.env.HMSH_IS_CLUSTER === 'true';
|
|
17
12
|
/**
|
|
18
13
|
* Default cleanup time for signal in the db when its associated job is completed.
|
|
19
14
|
*/
|
package/build/modules/utils.d.ts
CHANGED
|
@@ -31,7 +31,7 @@ export declare function identifyProvider(provider: any): Providers | null;
|
|
|
31
31
|
*/
|
|
32
32
|
export declare const polyfill: {
|
|
33
33
|
/**
|
|
34
|
-
* `
|
|
34
|
+
* `connection` is the generic replacement
|
|
35
35
|
*/
|
|
36
36
|
providerConfig(obj: any): any;
|
|
37
37
|
};
|
package/build/modules/utils.js
CHANGED
|
@@ -79,38 +79,11 @@ function identifyProvider(provider) {
|
|
|
79
79
|
else if (provider.toString().toLowerCase().includes('nats')) {
|
|
80
80
|
return 'nats';
|
|
81
81
|
}
|
|
82
|
-
else if ('defineCommand' in prototype ||
|
|
83
|
-
Object.keys(prototype).includes('multi')) {
|
|
84
|
-
return 'ioredis';
|
|
85
|
-
}
|
|
86
|
-
else if (Object.keys(prototype).includes('Multi')) {
|
|
87
|
-
return 'redis';
|
|
88
|
-
}
|
|
89
|
-
if (provider.constructor) {
|
|
90
|
-
if (provider.constructor.name === 'Redis' ||
|
|
91
|
-
provider.constructor.name === 'EventEmitter') {
|
|
92
|
-
if ('hset' in provider) {
|
|
93
|
-
return 'ioredis';
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
else if (provider.constructor.name === 'ProviderClient' ||
|
|
97
|
-
provider.constructor.name === 'Commander') {
|
|
98
|
-
if ('HSET' in provider) {
|
|
99
|
-
return 'redis';
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
82
|
let type = null;
|
|
104
83
|
if (Object.keys(provider).includes('connection') ||
|
|
105
84
|
!isNaN(provider.totalCount) && !isNaN(provider.idleCount)) {
|
|
106
85
|
type = 'postgres';
|
|
107
86
|
}
|
|
108
|
-
else if (Object.keys(provider).includes('Pipeline')) {
|
|
109
|
-
type = 'ioredis';
|
|
110
|
-
}
|
|
111
|
-
else if (Object.keys(provider).includes('createClient')) {
|
|
112
|
-
type = 'redis';
|
|
113
|
-
}
|
|
114
87
|
else if (prototype.constructor.toString().includes('NatsConnectionImpl')) {
|
|
115
88
|
type = 'nats';
|
|
116
89
|
}
|
|
@@ -122,10 +95,10 @@ exports.identifyProvider = identifyProvider;
|
|
|
122
95
|
*/
|
|
123
96
|
exports.polyfill = {
|
|
124
97
|
/**
|
|
125
|
-
* `
|
|
98
|
+
* `connection` is the generic replacement
|
|
126
99
|
*/
|
|
127
100
|
providerConfig(obj) {
|
|
128
|
-
return obj?.connection ?? obj?.
|
|
101
|
+
return obj?.connection ?? obj?.connections;
|
|
129
102
|
},
|
|
130
103
|
};
|
|
131
104
|
/**
|
package/build/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hotmeshio/hotmesh",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.7",
|
|
4
4
|
"description": "Permanent-Memory Workflows & AI Agents",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -23,9 +23,7 @@
|
|
|
23
23
|
"test:await": "NODE_ENV=test jest ./tests/functional/awaiter/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
24
24
|
"test:compile": "NODE_ENV=test jest ./tests/functional/compile/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
25
25
|
"test:connect": "NODE_ENV=test jest ./tests/unit/services/connector/* --detectOpenHandles --forceExit --verbose",
|
|
26
|
-
"test:connect:ioredis": "NODE_ENV=test jest ./tests/unit/services/connector/providers/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
27
26
|
"test:connect:postgres": "NODE_ENV=test jest ./tests/unit/services/connector/providers/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
28
|
-
"test:connect:redis": "NODE_ENV=test jest ./tests/unit/services/connector/providers/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
29
27
|
"test:connect:nats": "NODE_ENV=test jest ./tests/unit/services/connector/providers/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
30
28
|
"test:memflow": "NODE_ENV=test jest ./tests/memflow/*/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
31
29
|
"test:memflow:basic": "HMSH_LOGLEVEL=info NODE_ENV=test jest ./tests/memflow/basic/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -35,7 +33,7 @@
|
|
|
35
33
|
"test:memflow:interceptor": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/memflow/interceptor/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
36
34
|
"test:memflow:entity": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/memflow/entity/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
37
35
|
"test:memflow:agent": "NODE_ENV=test HMSH_LOGLEVEL=debug jest ./tests/memflow/agent/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
38
|
-
"test:memflow:hello": "HMSH_TELEMETRY=debug HMSH_LOGLEVEL=debug
|
|
36
|
+
"test:memflow:hello": "HMSH_TELEMETRY=debug HMSH_LOGLEVEL=debug NODE_ENV=test jest ./tests/memflow/helloworld/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
39
37
|
"test:memflow:hook": "NODE_ENV=test jest ./tests/memflow/hook/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
40
38
|
"test:memflow:interrupt": "NODE_ENV=test jest ./tests/memflow/interrupt/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
41
39
|
"test:memflow:loopactivity": "NODE_ENV=test jest ./tests/memflow/loopactivity/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -54,7 +52,7 @@
|
|
|
54
52
|
"test:interrupt": "NODE_ENV=test jest ./tests/functional/interrupt/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
55
53
|
"test:parallel": "NODE_ENV=test jest ./tests/functional/parallel/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
56
54
|
"test:pipe": "NODE_ENV=test jest ./tests/unit/services/pipe/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
57
|
-
"test:quorum": "
|
|
55
|
+
"test:quorum": "NODE_ENV=test jest ./tests/functional/quorum/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
58
56
|
"test:reclaim": "NODE_ENV=test jest ./tests/functional/reclaim/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
59
57
|
"test:redeploy": "NODE_ENV=test jest ./tests/functional/redeploy/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
60
58
|
"test:reporter": "NODE_ENV=test jest ./tests/unit/services/reporter/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -64,15 +62,9 @@
|
|
|
64
62
|
"test:signal": "NODE_ENV=test jest ./tests/functional/signal/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
65
63
|
"test:status": "NODE_ENV=test jest ./tests/functional/status/index.test.ts --detectOpenHandles --forceExit --verbose",
|
|
66
64
|
"test:providers": "NODE_ENV=test jest ./tests/functional/*/providers/*/*.test.ts --detectOpenHandles --forceExit --verbose",
|
|
67
|
-
"test:store:ioredis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
68
|
-
"test:store:redis": "NODE_ENV=test jest ./tests/functional/store/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
69
65
|
"test:store:postgres": "NODE_ENV=test jest ./tests/functional/store/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
70
|
-
"test:stream:ioredis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
71
|
-
"test:stream:redis": "NODE_ENV=test jest ./tests/functional/stream/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
72
66
|
"test:stream:postgres": "NODE_ENV=test jest ./tests/functional/stream/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
73
67
|
"test:stream:nats": "NODE_ENV=test jest ./tests/functional/stream/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
74
|
-
"test:sub:ioredis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/ioredis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
75
|
-
"test:sub:redis": "NODE_ENV=test jest ./tests/functional/sub/providers/redis/redis.test.ts --detectOpenHandles --forceExit --verbose",
|
|
76
68
|
"test:sub:postgres": "NODE_ENV=test jest ./tests/functional/sub/providers/postgres/postgres.test.ts --detectOpenHandles --forceExit --verbose",
|
|
77
69
|
"test:sub:nats": "NODE_ENV=test jest ./tests/functional/sub/providers/nats/nats.test.ts --detectOpenHandles --forceExit --verbose",
|
|
78
70
|
"test:trigger": "NODE_ENV=test jest ./tests/unit/services/activities/trigger.test.ts --detectOpenHandles --forceExit --verbose",
|
|
@@ -114,13 +106,11 @@
|
|
|
114
106
|
"eslint-config-prettier": "^9.1.0",
|
|
115
107
|
"eslint-plugin-import": "^2.29.1",
|
|
116
108
|
"eslint-plugin-prettier": "^5.1.3",
|
|
117
|
-
"ioredis": "^5.3.2",
|
|
118
109
|
"javascript-obfuscator": "^4.1.1",
|
|
119
110
|
"jest": "^29.5.0",
|
|
120
111
|
"nats": "^2.28.0",
|
|
121
112
|
"openai": "^5.9.0",
|
|
122
113
|
"pg": "^8.10.0",
|
|
123
|
-
"redis": "^4.6.13",
|
|
124
114
|
"rimraf": "^4.4.1",
|
|
125
115
|
"terser": "^5.37.0",
|
|
126
116
|
"ts-jest": "^29.0.5",
|
|
@@ -130,9 +120,7 @@
|
|
|
130
120
|
"typescript": "^5.0.4"
|
|
131
121
|
},
|
|
132
122
|
"peerDependencies": {
|
|
133
|
-
"ioredis": "^4.0.0 || ^5.0.0",
|
|
134
123
|
"nats": "^2.0.0",
|
|
135
|
-
"pg": "^8.0.0"
|
|
136
|
-
"redis": "^4.0.0"
|
|
124
|
+
"pg": "^8.0.0"
|
|
137
125
|
}
|
|
138
126
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Hook = void 0;
|
|
4
|
-
const enums_1 = require("../../modules/enums");
|
|
5
4
|
const errors_1 = require("../../modules/errors");
|
|
6
5
|
const collator_1 = require("../collator");
|
|
7
6
|
const pipe_1 = require("../pipe");
|
|
@@ -89,10 +88,7 @@ class Hook extends activity_1.Activity {
|
|
|
89
88
|
}
|
|
90
89
|
async doHook(telemetry) {
|
|
91
90
|
const transaction = this.store.transact();
|
|
92
|
-
|
|
93
|
-
//(ok to run this command multiple times if it fails),
|
|
94
|
-
//but the commands that follow must exec as a transaction
|
|
95
|
-
await this.registerHook(enums_1.HMSH_IS_CLUSTER ? undefined : transaction);
|
|
91
|
+
await this.registerHook(transaction);
|
|
96
92
|
this.mapOutputData();
|
|
97
93
|
this.mapJobData();
|
|
98
94
|
await this.setState(transaction);
|
|
@@ -12,13 +12,13 @@ declare class CompilerService {
|
|
|
12
12
|
logger: ILogger;
|
|
13
13
|
constructor(store: StoreService<ProviderClient, ProviderTransaction>, stream: StreamService<ProviderClient, ProviderTransaction>, logger: ILogger);
|
|
14
14
|
/**
|
|
15
|
-
* verifies and plans the deployment of an app to
|
|
15
|
+
* verifies and plans the deployment of an app to the DB; the app is not deployed yet
|
|
16
16
|
* @param path
|
|
17
17
|
*/
|
|
18
18
|
plan(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
19
19
|
isPath(input: string): boolean;
|
|
20
20
|
/**
|
|
21
|
-
* deploys an app to
|
|
21
|
+
* deploys an app to the DB but does NOT activate it.
|
|
22
22
|
*/
|
|
23
23
|
deploy(mySchemaOrPath: string): Promise<HotMeshManifest>;
|
|
24
24
|
/**
|
|
@@ -43,7 +43,7 @@ class CompilerService {
|
|
|
43
43
|
this.logger = logger;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
* verifies and plans the deployment of an app to
|
|
46
|
+
* verifies and plans the deployment of an app to the DB; the app is not deployed yet
|
|
47
47
|
* @param path
|
|
48
48
|
*/
|
|
49
49
|
async plan(mySchemaOrPath) {
|
|
@@ -69,7 +69,7 @@ class CompilerService {
|
|
|
69
69
|
return !input.trim().startsWith('app:');
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
|
-
* deploys an app to
|
|
72
|
+
* deploys an app to the DB but does NOT activate it.
|
|
73
73
|
*/
|
|
74
74
|
async deploy(mySchemaOrPath) {
|
|
75
75
|
try {
|
|
@@ -84,10 +84,10 @@ class CompilerService {
|
|
|
84
84
|
// 2) validate the manifest file (synchronous operation...no callbacks)
|
|
85
85
|
const validator = new validator_1.Validator(schema);
|
|
86
86
|
validator.validate(this.store);
|
|
87
|
-
// 3) deploy the schema (segment, optimize, etc; save to
|
|
87
|
+
// 3) deploy the schema (segment, optimize, etc; save to the DB)
|
|
88
88
|
const deployer = new deployer_1.Deployer(schema);
|
|
89
89
|
await deployer.deploy(this.store, this.stream);
|
|
90
|
-
// 4) save the app version to
|
|
90
|
+
// 4) save the app version to the DB (so it can be activated later)
|
|
91
91
|
await this.store.setApp(schema.app.id, schema.app.version);
|
|
92
92
|
return schema;
|
|
93
93
|
}
|
|
@@ -3,7 +3,7 @@ import { ProviderConfig, ProviderNativeClient } from '../../types/provider';
|
|
|
3
3
|
export declare class ConnectorService {
|
|
4
4
|
static disconnectAll(): Promise<void>;
|
|
5
5
|
/**
|
|
6
|
-
* Connect to a provider (
|
|
6
|
+
* Connect to a provider (postgres, nats) and return the native
|
|
7
7
|
* client. Connections are handled by the engine and worker routers at
|
|
8
8
|
* initialization, but the factory method provided here is useful
|
|
9
9
|
* for testing provider configurations.
|
|
@@ -2,19 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ConnectorService = void 0;
|
|
4
4
|
const utils_1 = require("../../modules/utils");
|
|
5
|
-
const ioredis_1 = require("./providers/ioredis");
|
|
6
5
|
const nats_1 = require("./providers/nats");
|
|
7
6
|
const postgres_1 = require("./providers/postgres");
|
|
8
|
-
const redis_1 = require("./providers/redis");
|
|
9
7
|
class ConnectorService {
|
|
10
8
|
static async disconnectAll() {
|
|
11
|
-
await redis_1.RedisConnection.disconnectAll();
|
|
12
|
-
await ioredis_1.RedisConnection.disconnectAll();
|
|
13
9
|
await postgres_1.PostgresConnection.disconnectAll();
|
|
14
10
|
await nats_1.NatsConnection.disconnectAll();
|
|
15
11
|
}
|
|
16
12
|
/**
|
|
17
|
-
* Connect to a provider (
|
|
13
|
+
* Connect to a provider (postgres, nats) and return the native
|
|
18
14
|
* client. Connections are handled by the engine and worker routers at
|
|
19
15
|
* initialization, but the factory method provided here is useful
|
|
20
16
|
* for testing provider configurations.
|
|
@@ -77,12 +73,6 @@ class ConnectorService {
|
|
|
77
73
|
let clientInstance;
|
|
78
74
|
const id = (0, utils_1.guid)();
|
|
79
75
|
switch (providerType) {
|
|
80
|
-
case 'redis':
|
|
81
|
-
clientInstance = await redis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
|
|
82
|
-
break;
|
|
83
|
-
case 'ioredis':
|
|
84
|
-
clientInstance = await ioredis_1.RedisConnection.connect(id, providerClass, options, { provider: providerName });
|
|
85
|
-
break;
|
|
86
76
|
case 'nats':
|
|
87
77
|
clientInstance = await nats_1.NatsConnection.connect(id, providerClass, options, { provider: providerName });
|
|
88
78
|
break;
|
|
@@ -4,8 +4,8 @@ import { DependencyExport, ExportOptions, JobActionExport, JobExport } from '../
|
|
|
4
4
|
import { ProviderClient, ProviderTransaction } from '../../types/provider';
|
|
5
5
|
import { StringStringType, Symbols } from '../../types/serializer';
|
|
6
6
|
/**
|
|
7
|
-
* Downloads job data
|
|
8
|
-
*
|
|
7
|
+
* Downloads job data and expands process data and
|
|
8
|
+
* includes dependency list
|
|
9
9
|
*/
|
|
10
10
|
declare class ExporterService {
|
|
11
11
|
appId: string;
|
|
@@ -20,23 +20,23 @@ declare class ExporterService {
|
|
|
20
20
|
*/
|
|
21
21
|
export(jobId: string, options?: ExportOptions): Promise<JobExport>;
|
|
22
22
|
/**
|
|
23
|
-
* Inflates the key
|
|
23
|
+
* Inflates the key
|
|
24
24
|
* into a human-readable JSON path, reflecting the
|
|
25
25
|
* tree-like structure of the unidimensional Hash
|
|
26
26
|
*/
|
|
27
27
|
inflateKey(key: string): string;
|
|
28
28
|
/**
|
|
29
|
-
* Inflates the job data
|
|
30
|
-
* @param jobHash - the job data
|
|
29
|
+
* Inflates the job data into a JobExport object
|
|
30
|
+
* @param jobHash - the job data
|
|
31
31
|
* @param dependencyList - the list of dependencies for the job
|
|
32
32
|
* @returns - the inflated job data
|
|
33
33
|
*/
|
|
34
34
|
inflate(jobHash: StringStringType, dependencyList: string[]): JobExport;
|
|
35
35
|
/**
|
|
36
|
-
* Inflates the dependency data
|
|
37
|
-
* organizing the dimensional isolate in
|
|
36
|
+
* Inflates the dependency data into a JobExport object by
|
|
37
|
+
* organizing the dimensional isolate in such a way as to interleave
|
|
38
38
|
* into a story
|
|
39
|
-
* @param data - the dependency data
|
|
39
|
+
* @param data - the dependency data
|
|
40
40
|
* @returns - the organized dependency data
|
|
41
41
|
*/
|
|
42
42
|
inflateDependencyData(data: string[], actions: JobActionExport): DependencyExport[];
|
|
@@ -5,8 +5,8 @@ const key_1 = require("../../modules/key");
|
|
|
5
5
|
const utils_1 = require("../../modules/utils");
|
|
6
6
|
const serializer_1 = require("../serializer");
|
|
7
7
|
/**
|
|
8
|
-
* Downloads job data
|
|
9
|
-
*
|
|
8
|
+
* Downloads job data and expands process data and
|
|
9
|
+
* includes dependency list
|
|
10
10
|
*/
|
|
11
11
|
class ExporterService {
|
|
12
12
|
constructor(appId, store, logger) {
|
|
@@ -30,7 +30,7 @@ class ExporterService {
|
|
|
30
30
|
return jobExport;
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* Inflates the key
|
|
33
|
+
* Inflates the key
|
|
34
34
|
* into a human-readable JSON path, reflecting the
|
|
35
35
|
* tree-like structure of the unidimensional Hash
|
|
36
36
|
*/
|
|
@@ -38,8 +38,8 @@ class ExporterService {
|
|
|
38
38
|
return key in this.symbols ? this.symbols[key] : key;
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
|
-
* Inflates the job data
|
|
42
|
-
* @param jobHash - the job data
|
|
41
|
+
* Inflates the job data into a JobExport object
|
|
42
|
+
* @param jobHash - the job data
|
|
43
43
|
* @param dependencyList - the list of dependencies for the job
|
|
44
44
|
* @returns - the inflated job data
|
|
45
45
|
*/
|
|
@@ -77,10 +77,10 @@ class ExporterService {
|
|
|
77
77
|
};
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
|
-
* Inflates the dependency data
|
|
81
|
-
* organizing the dimensional isolate in
|
|
80
|
+
* Inflates the dependency data into a JobExport object by
|
|
81
|
+
* organizing the dimensional isolate in such a way as to interleave
|
|
82
82
|
* into a story
|
|
83
|
-
* @param data - the dependency data
|
|
83
|
+
* @param data - the dependency data
|
|
84
84
|
* @returns - the organized dependency data
|
|
85
85
|
*/
|
|
86
86
|
inflateDependencyData(data, actions) {
|
|
@@ -230,14 +230,7 @@ class ClientService {
|
|
|
230
230
|
return new handle_1.WorkflowHandleService(hotMeshClient, workflowTopic, workflowId);
|
|
231
231
|
},
|
|
232
232
|
/**
|
|
233
|
-
* Provides direct access to the SEARCH backend
|
|
234
|
-
* queries. Taskqueues and workflow names are
|
|
235
|
-
* used to identify the point of presence to use. `...args` is
|
|
236
|
-
* the tokenized query. When querying Redis/FTSEARCH, the trailing
|
|
237
|
-
* ...args might be `'@_custom1:memflow'`. For postgres,
|
|
238
|
-
* the trailing ...args would be: `'_custom', 'memflow'`. In each case,
|
|
239
|
-
* the query looks for all job data where the field `_custom` is
|
|
240
|
-
* equal to `memflow`.
|
|
233
|
+
* Provides direct access to the SEARCH backend
|
|
241
234
|
*
|
|
242
235
|
* @example
|
|
243
236
|
* ```typescript
|
|
@@ -8,8 +8,6 @@ import { ProviderConfig, ProvidersConfig } from '../../types/provider';
|
|
|
8
8
|
*
|
|
9
9
|
* The config options optionall support a multi-connection setup
|
|
10
10
|
* where the `store` connection explicitly defined along with `stream`, `sub`, etc.
|
|
11
|
-
* For example, Postgres can be used for stream and store while
|
|
12
|
-
* Redis is used for sub.
|
|
13
11
|
*/
|
|
14
12
|
export declare class ConnectionService {
|
|
15
13
|
/**
|
|
@@ -9,8 +9,6 @@ exports.ConnectionService = void 0;
|
|
|
9
9
|
*
|
|
10
10
|
* The config options optionall support a multi-connection setup
|
|
11
11
|
* where the `store` connection explicitly defined along with `stream`, `sub`, etc.
|
|
12
|
-
* For example, Postgres can be used for stream and store while
|
|
13
|
-
* Redis is used for sub.
|
|
14
12
|
*/
|
|
15
13
|
class ConnectionService {
|
|
16
14
|
/**
|
|
@@ -16,15 +16,15 @@ declare class ExporterService {
|
|
|
16
16
|
*/
|
|
17
17
|
export(jobId: string, options?: ExportOptions): Promise<MemFlowJobExport>;
|
|
18
18
|
/**
|
|
19
|
-
* Inflates the job data
|
|
20
|
-
* @param jobHash - the job data
|
|
19
|
+
* Inflates the job data into a MemFlowJobExport object
|
|
20
|
+
* @param jobHash - the job data
|
|
21
21
|
* @param dependencyList - the list of dependencies for the job
|
|
22
22
|
* @returns - the inflated job data
|
|
23
23
|
*/
|
|
24
24
|
inflate(jobHash: StringStringType, options: ExportOptions): MemFlowJobExport;
|
|
25
25
|
resolveValue(raw: string, withValues: boolean): Record<string, any> | string | number | null;
|
|
26
26
|
/**
|
|
27
|
-
* Inflates the key
|
|
27
|
+
* Inflates the key
|
|
28
28
|
* into a human-readable JSON path, reflecting the
|
|
29
29
|
* tree-like structure of the unidimensional Hash
|
|
30
30
|
* @private
|
|
@@ -23,8 +23,8 @@ class ExporterService {
|
|
|
23
23
|
return jobExport;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Inflates the job data
|
|
27
|
-
* @param jobHash - the job data
|
|
26
|
+
* Inflates the job data into a MemFlowJobExport object
|
|
27
|
+
* @param jobHash - the job data
|
|
28
28
|
* @param dependencyList - the list of dependencies for the job
|
|
29
29
|
* @returns - the inflated job data
|
|
30
30
|
*/
|
|
@@ -82,7 +82,7 @@ class ExporterService {
|
|
|
82
82
|
return resolved;
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
-
* Inflates the key
|
|
85
|
+
* Inflates the key
|
|
86
86
|
* into a human-readable JSON path, reflecting the
|
|
87
87
|
* tree-like structure of the unidimensional Hash
|
|
88
88
|
* @private
|
|
@@ -9,7 +9,7 @@ import { WorkflowHandleService } from './handle';
|
|
|
9
9
|
import { didInterrupt } from './workflow/interruption';
|
|
10
10
|
/**
|
|
11
11
|
* The MemFlow service provides a Temporal-compatible workflow framework backed by
|
|
12
|
-
* Postgres
|
|
12
|
+
* Postgres. It offers durable execution, entity-based memory management,
|
|
13
13
|
* and composable workflows.
|
|
14
14
|
*
|
|
15
15
|
* ## Core Features
|
|
@@ -13,7 +13,7 @@ const interruption_1 = require("./workflow/interruption");
|
|
|
13
13
|
const interceptor_1 = require("./interceptor");
|
|
14
14
|
/**
|
|
15
15
|
* The MemFlow service provides a Temporal-compatible workflow framework backed by
|
|
16
|
-
* Postgres
|
|
16
|
+
* Postgres. It offers durable execution, entity-based memory management,
|
|
17
17
|
* and composable workflows.
|
|
18
18
|
*
|
|
19
19
|
* ## Core Features
|
|
@@ -66,7 +66,7 @@ const getWorkflowYAML = (app, version) => {
|
|
|
66
66
|
description: the arguments to pass to the flow
|
|
67
67
|
type: array
|
|
68
68
|
workflowTopic:
|
|
69
|
-
description: the
|
|
69
|
+
description: the stream topic the worker is listening on
|
|
70
70
|
type: string
|
|
71
71
|
backoffCoefficient:
|
|
72
72
|
description: the time multiple in seconds to backoff before retrying
|
|
@@ -43,10 +43,6 @@ export declare class Search {
|
|
|
43
43
|
* @private
|
|
44
44
|
*/
|
|
45
45
|
search: SearchService<any> | null;
|
|
46
|
-
/**
|
|
47
|
-
* @private
|
|
48
|
-
*/
|
|
49
|
-
cachedFields: Record<string, string>;
|
|
50
46
|
/**
|
|
51
47
|
* @private
|
|
52
48
|
*/
|
|
@@ -75,6 +71,17 @@ export declare class Search {
|
|
|
75
71
|
* await Search.configureSearchIndex(hotMeshClient, search);
|
|
76
72
|
*/
|
|
77
73
|
static configureSearchIndex(hotMeshClient: HotMesh, search?: WorkflowSearchOptions): Promise<void>;
|
|
74
|
+
/**
|
|
75
|
+
* Returns all user-defined attributes (udata) for a workflow.
|
|
76
|
+
* These are fields that start with underscore (_) and have type='udata'.
|
|
77
|
+
*
|
|
78
|
+
* @example
|
|
79
|
+
* ```typescript
|
|
80
|
+
* const allUserData = await Search.findAllUserData('job123', hotMeshClient);
|
|
81
|
+
* // Returns: { _status: "active", _counter: "42", _name: "test" }
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
static findAllUserData(jobId: string, hotMeshClient: HotMesh): Promise<Record<string, string>>;
|
|
78
85
|
/**
|
|
79
86
|
* Returns an array of search indexes ids
|
|
80
87
|
*
|