@motiadev/core 0.11.0-beta.155-764142 → 0.11.1-beta.156-879726

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 (55) hide show
  1. package/dist/index.d.ts +4 -4
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/src/call-step-file.d.ts.map +1 -1
  4. package/dist/src/call-step-file.js +27 -2
  5. package/dist/src/get-step-config.d.ts.map +1 -1
  6. package/dist/src/get-step-config.js +27 -6
  7. package/dist/src/locked-data.d.ts +3 -13
  8. package/dist/src/locked-data.d.ts.map +1 -1
  9. package/dist/src/locked-data.js +3 -13
  10. package/dist/src/logger-factory.d.ts +1 -1
  11. package/dist/src/logger-factory.d.ts.map +1 -1
  12. package/dist/src/node/get-config.js +0 -4
  13. package/dist/src/observability/redis-trace-stream-adapter.d.ts +17 -0
  14. package/dist/src/observability/redis-trace-stream-adapter.d.ts.map +1 -0
  15. package/dist/src/observability/redis-trace-stream-adapter.js +65 -0
  16. package/dist/src/observability/tracer.d.ts.map +1 -1
  17. package/dist/src/observability/tracer.js +3 -5
  18. package/dist/src/python/get-config.py +0 -4
  19. package/dist/src/server.d.ts.map +1 -1
  20. package/dist/src/server.js +7 -51
  21. package/dist/src/socket-server.d.ts +32 -11
  22. package/dist/src/socket-server.d.ts.map +1 -1
  23. package/dist/src/socket-server.js +11 -55
  24. package/dist/src/streams/redis-logs-stream.d.ts +31 -0
  25. package/dist/src/streams/redis-logs-stream.d.ts.map +1 -0
  26. package/dist/src/streams/redis-logs-stream.js +84 -0
  27. package/dist/src/types/app-config-types.d.ts +0 -7
  28. package/dist/src/types/app-config-types.d.ts.map +1 -1
  29. package/dist/src/types/generate-types.d.ts +1 -1
  30. package/dist/src/types/generate-types.d.ts.map +1 -1
  31. package/dist/src/types/generate-types.js +1 -2
  32. package/dist/src/types-stream.d.ts +0 -6
  33. package/dist/src/types-stream.d.ts.map +1 -1
  34. package/dist/src/types.d.ts +0 -5
  35. package/dist/src/types.d.ts.map +1 -1
  36. package/package.json +4 -1
  37. package/dist/src/language-runner.d.ts +0 -15
  38. package/dist/src/language-runner.d.ts.map +0 -1
  39. package/dist/src/language-runner.js +0 -31
  40. package/dist/src/node/can-access.d.ts +0 -2
  41. package/dist/src/node/can-access.d.ts.map +0 -1
  42. package/dist/src/node/can-access.js +0 -44
  43. package/dist/src/observability/trace-stream-adapter.d.ts +0 -12
  44. package/dist/src/observability/trace-stream-adapter.d.ts.map +0 -1
  45. package/dist/src/observability/trace-stream-adapter.js +0 -54
  46. package/dist/src/python/can-access.py +0 -78
  47. package/dist/src/run-stream-can-access.d.ts +0 -10
  48. package/dist/src/run-stream-can-access.d.ts.map +0 -1
  49. package/dist/src/run-stream-can-access.js +0 -59
  50. package/dist/src/socket-server/helpers.d.ts +0 -53
  51. package/dist/src/socket-server/helpers.d.ts.map +0 -1
  52. package/dist/src/socket-server/helpers.js +0 -28
  53. package/dist/src/streams/logs-stream.d.ts +0 -18
  54. package/dist/src/streams/logs-stream.d.ts.map +0 -1
  55. package/dist/src/streams/logs-stream.js +0 -22
package/dist/index.d.ts CHANGED
@@ -2,10 +2,10 @@ export { FileStateAdapter, FileStreamAdapter, FileStreamAdapterManager, MemorySt
2
2
  export { InMemoryCronAdapter as DefaultCronAdapter } from './src/adapters/defaults/cron/in-memory-cron-adapter';
3
3
  export { InMemoryQueueEventAdapter as DefaultQueueEventAdapter } from './src/adapters/defaults/event/in-memory-queue-event-adapter';
4
4
  export type { CronAdapter, CronAdapterConfig, CronLock, CronLockInfo, } from './src/adapters/interfaces/cron-adapter.interface';
5
- export type { EventAdapter, SubscriptionHandle } from './src/adapters/interfaces/event-adapter.interface';
6
- export type { Metric, ObservabilityAdapter, Tracer } from './src/adapters/interfaces/observability-adapter.interface';
5
+ export type { EventAdapter, SubscriptionHandle, } from './src/adapters/interfaces/event-adapter.interface';
6
+ export type { Metric, ObservabilityAdapter, Tracer, } from './src/adapters/interfaces/observability-adapter.interface';
7
7
  export type { StateAdapter, StateFilter, StateItem, StateItemsInput, } from './src/adapters/interfaces/state-adapter.interface';
8
- export { StreamAdapter, type StreamQueryFilter } from './src/adapters/interfaces/stream-adapter.interface';
8
+ export { StreamAdapter, type StreamQueryFilter, } from './src/adapters/interfaces/stream-adapter.interface';
9
9
  export type { StreamAdapterManager } from './src/adapters/interfaces/stream-adapter-manager.interface';
10
10
  export { getProjectIdentifier, getUserIdentifier, isAnalyticsEnabled, trackEvent } from './src/analytics/utils';
11
11
  export { config } from './src/config';
@@ -26,5 +26,5 @@ export { createStepHandlers, MotiaEventManager } from './src/step-handlers';
26
26
  export * from './src/types';
27
27
  export type { AdapterConfig, Config } from './src/types/app-config-types';
28
28
  export * from './src/types/schema.types';
29
- export { type BaseStreamItem, MotiaStream, type StateStreamEvent, type StateStreamEventChannel, StreamConfig, type StreamSubscription, } from './src/types-stream';
29
+ export { type BaseStreamItem, MotiaStream, type StateStreamEvent, type StateStreamEventChannel, StreamConfig, } from './src/types-stream';
30
30
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACxB,kBAAkB,EAClB,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,mBAAmB,IAAI,kBAAkB,EAAE,MAAM,qDAAqD,CAAA;AAC/G,OAAO,EAAE,yBAAyB,IAAI,wBAAwB,EAAE,MAAM,6DAA6D,CAAA;AACnI,YAAY,EACV,WAAW,EACX,iBAAiB,EACjB,QAAQ,EACR,YAAY,GACb,MAAM,kDAAkD,CAAA;AACzD,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,mDAAmD,CAAA;AACzG,YAAY,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,2DAA2D,CAAA;AACrH,YAAY,EACV,YAAY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AI,KAAK,EAAE,SAAS,mBAAmB,EAAE,OAAO,KAAK,KAAG,OAAO,CAAC,KAAK,GAAG,SAAS,CAkNzG,CAAA"}
@@ -1,10 +1,35 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.callStepFile = void 0;
7
+ const path_1 = __importDefault(require("path"));
4
8
  const utils_1 = require("./analytics/utils");
5
- const language_runner_1 = require("./language-runner");
6
9
  const process_manager_1 = require("./process-communication/process-manager");
7
10
  const utils_2 = require("./utils");
11
+ const getLanguageBasedRunner = (stepFilePath = '') => {
12
+ const isPython = stepFilePath.endsWith('.py');
13
+ const isRuby = stepFilePath.endsWith('.rb');
14
+ const isNode = stepFilePath.endsWith('.js') || stepFilePath.endsWith('.ts');
15
+ if (isPython) {
16
+ const pythonRunner = path_1.default.join(__dirname, 'python', 'python-runner.py');
17
+ return { runner: pythonRunner, command: 'python', args: [] };
18
+ }
19
+ else if (isRuby) {
20
+ const rubyRunner = path_1.default.join(__dirname, 'ruby', 'ruby-runner.rb');
21
+ return { runner: rubyRunner, command: 'ruby', args: [] };
22
+ }
23
+ else if (isNode) {
24
+ if (process.env._MOTIA_TEST_MODE === 'true') {
25
+ const nodeRunner = path_1.default.join(__dirname, 'node', 'node-runner.ts');
26
+ return { runner: nodeRunner, command: 'node', args: ['-r', 'ts-node/register'] };
27
+ }
28
+ const nodeRunner = path_1.default.join(__dirname, 'node', 'node-runner.js');
29
+ return { runner: nodeRunner, command: 'node', args: [] };
30
+ }
31
+ throw Error(`Unsupported file extension ${stepFilePath}`);
32
+ };
8
33
  const callStepFile = (options, motia) => {
9
34
  const { step, traceId, data, tracer, logger, contextInFirstArg = false, infrastructure } = options;
10
35
  const flows = step.config.flows;
@@ -12,7 +37,7 @@ const callStepFile = (options, motia) => {
12
37
  const streamConfig = motia.lockedData.getStreams();
13
38
  const streams = Object.keys(streamConfig).map((name) => ({ name }));
14
39
  const jsonData = JSON.stringify({ data, flows, traceId, contextInFirstArg, streams });
15
- const { runner, command, args } = (0, language_runner_1.getLanguageBasedRunner)(step.filePath);
40
+ const { runner, command, args } = getLanguageBasedRunner(step.filePath);
16
41
  let result;
17
42
  let timeoutId;
18
43
  const processManager = new process_manager_1.ProcessManager({
@@ -1 +1 @@
1
- {"version":3,"file":"get-step-config.d.ts","sourceRoot":"","sources":["../../src/get-step-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AA2DlD,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,KAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAE3F,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,KAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAE/F,CAAA"}
1
+ {"version":3,"file":"get-step-config.d.ts","sourceRoot":"","sources":["../../src/get-step-config.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACzC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAqFlD,eAAO,MAAM,aAAa,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,KAAG,OAAO,CAAC,UAAU,GAAG,IAAI,CAE3F,CAAA;AAED,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,cAAc,MAAM,KAAG,OAAO,CAAC,YAAY,GAAG,IAAI,CAE/F,CAAA"}
@@ -1,15 +1,36 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getStreamConfig = exports.getStepConfig = void 0;
4
- const language_runner_1 = require("./language-runner");
7
+ const path_1 = __importDefault(require("path"));
5
8
  const logger_1 = require("./logger");
6
9
  const process_manager_1 = require("./process-communication/process-manager");
10
+ const getLanguageBasedRunner = (stepFilePath = '') => {
11
+ const isPython = stepFilePath.endsWith('.py');
12
+ const isRuby = stepFilePath.endsWith('.rb');
13
+ const isNode = stepFilePath.endsWith('.js') || stepFilePath.endsWith('.ts');
14
+ if (isPython) {
15
+ const pythonRunner = path_1.default.join(__dirname, 'python', 'get-config.py');
16
+ return { runner: pythonRunner, command: 'python', args: [] };
17
+ }
18
+ else if (isRuby) {
19
+ const rubyRunner = path_1.default.join(__dirname, 'ruby', 'get-config.rb');
20
+ return { runner: rubyRunner, command: 'ruby', args: [] };
21
+ }
22
+ else if (isNode) {
23
+ if (process.env._MOTIA_TEST_MODE === 'true') {
24
+ const nodeRunner = path_1.default.join(__dirname, 'node', 'get-config.ts');
25
+ return { runner: nodeRunner, command: 'node', args: ['-r', 'ts-node/register'] };
26
+ }
27
+ const nodeRunner = path_1.default.join(__dirname, 'node', 'get-config.js');
28
+ return { runner: nodeRunner, command: 'node', args: [] };
29
+ }
30
+ throw Error(`Unsupported file extension ${stepFilePath}`);
31
+ };
7
32
  const getConfig = (file, projectRoot) => {
8
- const { runner, command, args } = (0, language_runner_1.getLanguageBasedRunner)(file, {
9
- python: 'get-config.py',
10
- ruby: 'get-config.rb',
11
- node: { js: 'get-config.js', ts: 'get-config.ts' },
12
- });
33
+ const { runner, command, args } = getLanguageBasedRunner(file);
13
34
  return new Promise((resolve, reject) => {
14
35
  let config = null;
15
36
  const processManager = new process_manager_1.ProcessManager({
@@ -1,9 +1,8 @@
1
+ import type { RedisClientType } from 'redis';
1
2
  import type { StreamAdapterManager } from './adapters/interfaces/stream-adapter-manager.interface';
2
3
  import type { Printer } from './printer';
3
4
  import type { StreamFactory } from './streams/stream-factory';
4
5
  import type { ApiRouteConfig, CronConfig, EventConfig, Flow, Step } from './types';
5
- import type { StreamAuthConfig } from './types/app-config-types';
6
- import type { JsonSchema } from './types/schema.types';
7
6
  import type { Stream } from './types-stream';
8
7
  type FlowEvent = 'flow-created' | 'flow-removed' | 'flow-updated';
9
8
  type StepEvent = 'step-created' | 'step-removed' | 'step-updated';
@@ -13,6 +12,7 @@ export declare class LockedData {
13
12
  readonly baseDir: string;
14
13
  readonly streamAdapter: StreamAdapterManager;
15
14
  private readonly printer;
15
+ readonly redisClient: RedisClientType;
16
16
  flows: Record<string, Flow>;
17
17
  activeSteps: Step[];
18
18
  devSteps: Step[];
@@ -22,17 +22,8 @@ export declare class LockedData {
22
22
  private streamHandlers;
23
23
  private streams;
24
24
  private streamWrapper?;
25
- private streamAuthContextType?;
26
- private streamAuthConfig?;
27
- constructor(baseDir: string, streamAdapter: StreamAdapterManager, printer: Printer);
25
+ constructor(baseDir: string, streamAdapter: StreamAdapterManager, printer: Printer, redisClient: RedisClientType);
28
26
  applyStreamWrapper<TData>(streamWrapper: StreamWrapper<TData>): void;
29
- setStreamAuthConfig(config?: {
30
- authenticate: StreamAuthConfig['authenticate'];
31
- contextSchema?: JsonSchema;
32
- }): void;
33
- getStreamAuthConfig(): {
34
- authenticate: StreamAuthConfig["authenticate"];
35
- } | undefined;
36
27
  saveTypes(): void;
37
28
  on(event: FlowEvent, handler: (flowName: string) => void): void;
38
29
  onStep(event: StepEvent, handler: (step: Step) => void): void;
@@ -45,7 +36,6 @@ export declare class LockedData {
45
36
  tsSteps(): Step[];
46
37
  getStreams(): Record<string, StreamFactory<any>>;
47
38
  listStreams(): Stream[];
48
- getStreamByName(streamName: string): Stream | undefined;
49
39
  findStream(path: string): Stream | undefined;
50
40
  updateStep(oldStep: Step, newStep: Step, options?: {
51
41
  disableTypeCreation?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"locked-data.d.ts","sourceRoot":"","sources":["../../src/locked-data.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wDAAwD,C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E;QAAE,mBAAmB,CAAC,EAAE,OAAO,CAAA;KAAO,GAAG,IAAI;IAuBtG,OAAO,CAAC,UAAU;IASlB,OAAO,CAAC,UAAU;IAMlB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,mBAAmB;CAG5B"}
@@ -9,13 +9,13 @@ const path_1 = __importDefault(require("path"));
9
9
  const guards_1 = require("./guards");
10
10
  const motia_1 = require("./motia");
11
11
  const step_validator_1 = require("./step-validator");
12
- const generate_type_from_schema_1 = require("./types/generate-type-from-schema");
13
12
  const generate_types_1 = require("./types/generate-types");
14
13
  class LockedData {
15
- constructor(baseDir, streamAdapter, printer) {
14
+ constructor(baseDir, streamAdapter, printer, redisClient) {
16
15
  this.baseDir = baseDir;
17
16
  this.streamAdapter = streamAdapter;
18
17
  this.printer = printer;
18
+ this.redisClient = redisClient;
19
19
  this.flows = {};
20
20
  this.activeSteps = [];
21
21
  this.devSteps = [];
@@ -40,17 +40,10 @@ class LockedData {
40
40
  applyStreamWrapper(streamWrapper) {
41
41
  this.streamWrapper = streamWrapper;
42
42
  }
43
- setStreamAuthConfig(config) {
44
- this.streamAuthConfig = config ? { authenticate: config.authenticate } : undefined;
45
- this.streamAuthContextType = config?.contextSchema ? (0, generate_type_from_schema_1.generateTypeFromSchema)(config.contextSchema) : undefined;
46
- }
47
- getStreamAuthConfig() {
48
- return this.streamAuthConfig;
49
- }
50
43
  saveTypes() {
51
44
  const types = (0, generate_types_1.generateTypesFromSteps)(this.activeSteps, this.printer);
52
45
  const streams = (0, generate_types_1.generateTypesFromStreams)(this.streams);
53
- const typesString = (0, generate_types_1.generateTypesString)(types, streams, this.streamAuthContextType);
46
+ const typesString = (0, generate_types_1.generateTypesString)(types, streams);
54
47
  fs_1.default.writeFileSync(path_1.default.join(this.baseDir, 'types.d.ts'), typesString);
55
48
  }
56
49
  on(event, handler) {
@@ -90,9 +83,6 @@ class LockedData {
90
83
  listStreams() {
91
84
  return Object.values(this.streams);
92
85
  }
93
- getStreamByName(streamName) {
94
- return this.streams[streamName];
95
- }
96
86
  findStream(path) {
97
87
  return Object.values(this.streams).find((stream) => stream.filePath === path);
98
88
  }
@@ -1,5 +1,5 @@
1
1
  import { Logger } from './logger';
2
- import type { Log } from './streams/logs-stream';
2
+ import type { Log } from './streams/redis-logs-stream';
3
3
  import type { MotiaStream } from './types-stream';
4
4
  type CreateLogger = {
5
5
  traceId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"logger-factory.d.ts","sourceRoot":"","sources":["../../src/logger-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,uBAAuB,CAAA;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,MAAM,CAAA;CACvC;AAED,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC;IAG9C,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,YAAY,GAAG,MAAM;CAiB3D"}
1
+ {"version":3,"file":"logger-factory.d.ts","sourceRoot":"","sources":["../../src/logger-factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAoB,MAAM,UAAU,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,6BAA6B,CAAA;AACtD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEjD,KAAK,YAAY,GAAG;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,MAAM,CAAA;CACvC;AAED,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,SAAS;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS;gBADT,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,WAAW,CAAC,GAAG,CAAC;IAG9C,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,YAAY,GAAG,MAAM;CAiB3D"}
@@ -41,10 +41,6 @@ async function getConfig(filePath) {
41
41
  module.config.schema = converted;
42
42
  }
43
43
  }
44
- if (typeof module.config.canAccess === 'function') {
45
- module.config.__motia_hasCanAccess = !!module.config.canAccess;
46
- delete module.config.canAccess;
47
- }
48
44
  process.send?.(module.config);
49
45
  process.exit(0);
50
46
  }
@@ -0,0 +1,17 @@
1
+ import type { RedisClientType } from 'redis';
2
+ import { StreamAdapter } from '../adapters/interfaces/stream-adapter.interface';
3
+ import type { BaseStreamItem, StateStreamEvent, StateStreamEventChannel } from '../types-stream';
4
+ export declare class RedisTraceStreamAdapter<TData> extends StreamAdapter<TData> {
5
+ private client;
6
+ private readonly keyPrefix;
7
+ private ttl;
8
+ constructor(streamName: string, client: RedisClientType, ttl?: number);
9
+ private makeGroupKey;
10
+ get(groupId: string, id: string): Promise<BaseStreamItem<TData> | null>;
11
+ set(groupId: string, id: string, data: TData): Promise<BaseStreamItem<TData>>;
12
+ delete(groupId: string, id: string): Promise<BaseStreamItem<TData> | null>;
13
+ getGroup(groupId: string): Promise<BaseStreamItem<TData>[]>;
14
+ send<T>(channel: StateStreamEventChannel, event: StateStreamEvent<T>): Promise<void>;
15
+ clear(groupId: string): Promise<void>;
16
+ }
17
+ //# sourceMappingURL=redis-trace-stream-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"redis-trace-stream-adapter.d.ts","sourceRoot":"","sources":["../../../src/observability/redis-trace-stream-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,OAAO,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAA;AAIhG,qBAAa,uBAAuB,CAAC,KAAK,CAAE,SAAQ,aAAa,CAAC,KAAK,CAAC;IACtE,OAAO,CAAC,MAAM,CAAiB;IAC/B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAyB;IACnD,OAAO,CAAC,GAAG,CAAQ;gBAEP,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,GAAG,GAAE,MAA0B;IAMxF,OAAO,CAAC,YAAY;IAId,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAMvE,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAiB7E,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,IAAI,CAAC;IAa1E,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,CAAC;IAc3D,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,uBAAuB,EAAE,KAAK,EAAE,gBAAgB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAOpF,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAI5C"}
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RedisTraceStreamAdapter = void 0;
4
+ const stream_adapter_interface_1 = require("../adapters/interfaces/stream-adapter.interface");
5
+ const TRACE_TTL_SECONDS = 3 * 24 * 60 * 60;
6
+ class RedisTraceStreamAdapter extends stream_adapter_interface_1.StreamAdapter {
7
+ constructor(streamName, client, ttl = TRACE_TTL_SECONDS) {
8
+ super(streamName);
9
+ this.keyPrefix = 'motia:trace:';
10
+ this.client = client;
11
+ this.ttl = ttl;
12
+ }
13
+ makeGroupKey(groupId) {
14
+ return `${this.keyPrefix}${groupId}`;
15
+ }
16
+ async get(groupId, id) {
17
+ const hashKey = this.makeGroupKey(groupId);
18
+ const value = await this.client.hGet(hashKey, id);
19
+ return value ? JSON.parse(value) : null;
20
+ }
21
+ async set(groupId, id, data) {
22
+ const hashKey = this.makeGroupKey(groupId);
23
+ const item = { ...data, id };
24
+ const itemJson = JSON.stringify(item);
25
+ const existed = await this.client.hExists(hashKey, id);
26
+ const eventType = existed ? 'update' : 'create';
27
+ await Promise.all([
28
+ this.client.hSet(hashKey, id, itemJson),
29
+ this.send({ groupId, id }, { type: eventType, data: item }),
30
+ this.client.expire(hashKey, this.ttl),
31
+ ]);
32
+ return item;
33
+ }
34
+ async delete(groupId, id) {
35
+ const hashKey = this.makeGroupKey(groupId);
36
+ const value = await this.client.hGet(hashKey, id);
37
+ if (!value)
38
+ return null;
39
+ const item = JSON.parse(value);
40
+ await Promise.all([this.client.hDel(hashKey, id), this.send({ groupId, id }, { type: 'delete', data: item })]);
41
+ return item;
42
+ }
43
+ async getGroup(groupId) {
44
+ const hashKey = this.makeGroupKey(groupId);
45
+ const values = await this.client.hGetAll(hashKey);
46
+ const items = Object.values(values).map((v) => JSON.parse(v));
47
+ const sortDesc = (a, b) => {
48
+ const aTime = a.startTime || 0;
49
+ const bTime = b.startTime || 0;
50
+ return aTime - bTime;
51
+ };
52
+ return items.sort(sortDesc);
53
+ }
54
+ async send(channel, event) {
55
+ const channelKey = channel.id
56
+ ? `${this.keyPrefix}events:${this.streamName}:${channel.groupId}:${channel.id}`
57
+ : `${this.keyPrefix}events:${this.streamName}:${channel.groupId}`;
58
+ await this.client.publish(channelKey, JSON.stringify(event));
59
+ }
60
+ async clear(groupId) {
61
+ const hashKey = this.makeGroupKey(groupId);
62
+ await this.client.del(hashKey);
63
+ }
64
+ }
65
+ exports.RedisTraceStreamAdapter = RedisTraceStreamAdapter;
@@ -1 +1 @@
1
- {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../../src/observability/tracer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAEtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAG9C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMhD,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,WAAW,EAAE,WAAW,CAAC,KAAK,CAAC,EAC/B,gBAAgB,EAAE,WAAW,CAAC,UAAU,CAAC;YAG9C,YAAY;YAIZ,WAAW;IASnB,KAAK;IAQL,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;IAiCxD,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;CAYhE;AAED,eAAO,MAAM,mBAAmB,GAAI,YAAY,UAAU,KAAG,aA2B5D,CAAA"}
1
+ {"version":3,"file":"tracer.d.ts","sourceRoot":"","sources":["../../../src/observability/tracer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAChD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AACvC,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AACpC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,GAAG,CAAA;AAGtC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAMhD,qBAAa,iBAAkB,YAAW,aAAa;IAEnD,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,gBAAgB;gBADhB,WAAW,EAAE,WAAW,CAAC,KAAK,CAAC,EAC/B,gBAAgB,EAAE,WAAW,CAAC,UAAU,CAAC;YAG9C,YAAY;YAIZ,WAAW;IASnB,KAAK;IAQL,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;IAiCxD,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM;CAYhE;AAED,eAAO,MAAM,mBAAmB,GAAI,YAAY,UAAU,KAAG,aA+B5D,CAAA"}
@@ -1,11 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createTracerFactory = exports.BaseTracerFactory = void 0;
4
- const file_stream_adapter_manager_1 = require("../adapters/defaults/stream/file-stream-adapter-manager");
5
4
  const create_trace_1 = require("./create-trace");
5
+ const redis_trace_stream_adapter_1 = require("./redis-trace-stream-adapter");
6
6
  const stream_tracer_1 = require("./stream-tracer");
7
7
  const trace_manager_1 = require("./trace-manager");
8
- const trace_stream_adapter_1 = require("./trace-stream-adapter");
9
8
  const MAX_TRACE_GROUPS = process.env.MOTIA_MAX_TRACE_GROUPS //
10
9
  ? Number.parseInt(process.env.MOTIA_MAX_TRACE_GROUPS, 10)
11
10
  : 50;
@@ -69,9 +68,8 @@ class BaseTracerFactory {
69
68
  }
70
69
  exports.BaseTracerFactory = BaseTracerFactory;
71
70
  const createTracerFactory = (lockedData) => {
72
- const streamAdapter = lockedData.streamAdapter instanceof file_stream_adapter_manager_1.FileStreamAdapterManager ? 'file' : 'memory';
73
71
  const traceStreamName = 'motia-trace';
74
- const traceStreamAdapter = new trace_stream_adapter_1.TraceStreamAdapter(lockedData.baseDir, traceStreamName, streamAdapter);
72
+ const traceStreamAdapter = new redis_trace_stream_adapter_1.RedisTraceStreamAdapter(traceStreamName, lockedData.redisClient);
75
73
  const traceStream = lockedData.createStream({
76
74
  filePath: traceStreamName,
77
75
  hidden: true,
@@ -82,7 +80,7 @@ const createTracerFactory = (lockedData) => {
82
80
  },
83
81
  })();
84
82
  const traceGroupName = 'motia-trace-group';
85
- const traceGroupStreamAdapter = new trace_stream_adapter_1.TraceStreamAdapter(lockedData.baseDir, traceGroupName, streamAdapter);
83
+ const traceGroupStreamAdapter = new redis_trace_stream_adapter_1.RedisTraceStreamAdapter(traceGroupName, lockedData.redisClient);
86
84
  const traceGroupStream = lockedData.createStream({
87
85
  filePath: traceGroupName,
88
86
  hidden: true,
@@ -50,10 +50,6 @@ async def run_python_module(file_path: str) -> None:
50
50
 
51
51
  if 'middleware' in module.config:
52
52
  del module.config['middleware']
53
-
54
- if 'canAccess' in module.config:
55
- del module.config['canAccess']
56
- module.config['__motia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BAAiB,EAAE,MAAM,iBAAiB,CAAA;AAG5E,OAAO,KAAK,EAA2B,cAAc,EAA4B,IAAI,EAAE,MAAM,SAAS,CAAA;AAGtG,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;IACZ,MAAM,EAAE,IAAI,CAAC,MAAM,CAAA;IACnB,YAAY,EAAE,QAAQ,CAAA;IACtB,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,WAAW,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IACjD,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK,IAAI,CAAA;IAC9C,WAAW,EAAE,WAAW,CAAA;IACxB,iBAAiB,EAAE,iBAAiB,CAAA;IACpC,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED,KAAK,iBAAiB,GAAG;IACvB,SAAS,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,EAAE,WAAW,CAAA;IACxB,aAAa,CAAC,EAAE,oBAAoB,CAAA;CACrC,CAAA;AAED,eAAO,MAAM,YAAY,GACvB,YAAY,UAAU,EACtB,OAAO,YAAY,EACnB,QAAQ,iBAAiB,EACzB,UAAU,cAAc,EACxB,eAAe,CAAC,GAAG,EAAE,OAAO,KAAK,IAAI,KACpC,WA4RF,CAAA"}
@@ -20,11 +20,10 @@ const logger_1 = require("./logger");
20
20
  const logger_factory_1 = require("./logger-factory");
21
21
  const tracer_1 = require("./observability/tracer");
22
22
  const printer_1 = require("./printer");
23
- const run_stream_can_access_1 = require("./run-stream-can-access");
24
23
  const socket_server_1 = require("./socket-server");
25
24
  const step_handlers_1 = require("./step-handlers");
26
25
  const steps_1 = require("./steps");
27
- const logs_stream_1 = require("./streams/logs-stream");
26
+ const redis_logs_stream_1 = require("./streams/redis-logs-stream");
28
27
  const createServer = (lockedData, state, config, adapters, configureApp) => {
29
28
  const printer = config.printer ?? new printer_1.Printer(process.cwd());
30
29
  const app = (0, express_1.default)();
@@ -32,56 +31,8 @@ const createServer = (lockedData, state, config, adapters, configureApp) => {
32
31
  configureApp(app);
33
32
  }
34
33
  const server = http_1.default.createServer(app);
35
- const streamAuth = lockedData.getStreamAuthConfig();
36
- const authorizeSubscription = async (subscription, authContext) => {
37
- const stream = lockedData.getStreamByName(subscription.streamName);
38
- if (!stream) {
39
- throw new Error(`Stream ${subscription.streamName} not found`);
40
- }
41
- const accessContext = { groupId: subscription.groupId, id: subscription.id };
42
- if (typeof stream.config.canAccess === 'function') {
43
- try {
44
- const allowed = await stream.config.canAccess(accessContext, authContext);
45
- return Boolean(allowed);
46
- }
47
- catch (error) {
48
- logger_1.globalLogger.error('[Streams] Inline canAccess evaluation failed', {
49
- streamName: subscription.streamName,
50
- groupId: subscription.groupId,
51
- error,
52
- });
53
- return false;
54
- }
55
- }
56
- if (!stream.config.__motia_hasCanAccess) {
57
- logger_1.globalLogger.debug('[Streams] No canAccess function found, allowing access', {
58
- streamName: subscription.streamName,
59
- groupId: subscription.groupId,
60
- });
61
- return true;
62
- }
63
- try {
64
- const allowed = await (0, run_stream_can_access_1.runStreamCanAccess)({
65
- file: stream.filePath,
66
- subscription: accessContext,
67
- authContext,
68
- projectRoot: lockedData.baseDir,
69
- });
70
- return Boolean(allowed);
71
- }
72
- catch (error) {
73
- logger_1.globalLogger.error('[Streams] canAccess evaluation failed', {
74
- streamName: subscription.streamName,
75
- groupId: subscription.groupId,
76
- error,
77
- });
78
- return false;
79
- }
80
- };
81
34
  const { pushEvent, socketServer } = (0, socket_server_1.createSocketServer)({
82
35
  server,
83
- authenticate: streamAuth?.authenticate,
84
- authorize: authorizeSubscription,
85
36
  onJoin: async (streamName, groupId, id) => {
86
37
  const streams = lockedData.getStreams();
87
38
  const stream = streams[streamName];
@@ -152,7 +103,12 @@ const createServer = (lockedData, state, config, adapters, configureApp) => {
152
103
  hidden: true,
153
104
  config: {
154
105
  name: '__motia.logs',
155
- baseConfig: { storageType: 'custom', factory: () => new logs_stream_1.LogsStream() },
106
+ baseConfig: {
107
+ storageType: 'custom',
108
+ factory: () => {
109
+ return new redis_logs_stream_1.RedisLogsStream(lockedData.redisClient);
110
+ },
111
+ },
156
112
  schema: null,
157
113
  },
158
114
  })();
@@ -1,20 +1,41 @@
1
- import type { IncomingMessage, Server } from 'http';
1
+ import type http from 'http';
2
2
  import { Server as WsServer } from 'ws';
3
- import { type EventMessage } from './socket-server/helpers';
3
+ type BaseMessage = {
4
+ streamName: string;
5
+ groupId: string;
6
+ id?: string;
7
+ };
8
+ type StreamEvent<TData> = {
9
+ type: 'sync';
10
+ data: TData;
11
+ } | {
12
+ type: 'create';
13
+ data: TData;
14
+ } | {
15
+ type: 'update';
16
+ data: TData;
17
+ } | {
18
+ type: 'delete';
19
+ data: TData;
20
+ } | {
21
+ type: 'event';
22
+ event: {
23
+ type: string;
24
+ data: any;
25
+ };
26
+ };
27
+ type EventMessage<TData> = BaseMessage & {
28
+ timestamp: number;
29
+ event: StreamEvent<TData>;
30
+ };
4
31
  type Props = {
5
- server: Server;
32
+ server: http.Server;
6
33
  onJoin: <TData>(streamName: string, groupId: string, id: string) => Promise<TData>;
7
34
  onJoinGroup: <TData>(streamName: string, groupId: string) => Promise<TData[] | undefined>;
8
- authenticate?: (request: IncomingMessage) => Promise<unknown | null> | unknown | null;
9
- authorize?: (subscription: {
10
- streamName: string;
11
- groupId: string;
12
- id?: string;
13
- }, authContext?: unknown) => Promise<boolean> | boolean;
14
35
  };
15
- export declare const createSocketServer: ({ server, onJoin, onJoinGroup, authenticate, authorize }: Props) => {
36
+ export declare const createSocketServer: ({ server, onJoin, onJoinGroup }: Props) => {
16
37
  pushEvent: <TData>(message: Omit<EventMessage<TData>, "timestamp">) => void;
17
- socketServer: WsServer<typeof import("ws"), typeof IncomingMessage>;
38
+ socketServer: WsServer<typeof import("ws"), typeof http.IncomingMessage>;
18
39
  };
19
40
  export {};
20
41
  //# sourceMappingURL=socket-server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"socket-server.d.ts","sourceRoot":"","sources":["../../src/socket-server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,MAAM,CAAA;AACnD,OAAO,EAAkB,MAAM,IAAI,QAAQ,EAAE,MAAM,IAAI,CAAA;AAEvD,OAAO,EAEL,KAAK,YAAY,EAKlB,MAAM,yBAAyB,CAAA;AAIhC,KAAK,KAAK,GAAG;IACX,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,CAAC,CAAA;IAClF,WAAW,EAAE,CAAC,KAAK,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,KAAK,EAAE,GAAG,SAAS,CAAC,CAAA;IACzF,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,eAAe,KAAK,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,GAAG,OAAO,GAAG,IAAI,CAAA;IACrF,SAAS,CAAC,EAAE,CACV,YAAY,EAAE;QAAE,UAAU,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,EAAE,CAAC,EAAE,MAAM,CAAA;KAAE,EAClE,WAAW,CAAC,EAAE,OAAO,KAClB,OAAO,CAAC,OAAO,CAAC,GAAG,OAAO,CAAA;CAChC,CAAA;AAGD,eAAO,MAAM,kBAAkB,GAAI,0DAA0D,KAAK;gBA4G7E,KAAK,WAAW,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;;CAuB1E,CAAA"}
1
+ {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