motia 0.2.1-beta.75 → 0.2.1-beta.76

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 CHANGED
@@ -11,45 +11,51 @@
11
11
  <p align="center">
12
12
  <a href="https://www.npmjs.com/package/motia"><img src="https://img.shields.io/npm/v/motia.svg" alt="npm version"></a>
13
13
  <a href="https://github.com/MotiaDev/motia/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="license"></a>
14
+ <a href="https://twitter.com/motiadev" target="_blank"><img src="https://img.shields.io/twitter/follow/motiadev.svg?style=social&label=Follow"></a>
15
+ <a href="https://discord.gg/7rXsekMK" target="_blank"><img src="https://img.shields.io/discord/1322278831184281721"></a>
14
16
  </p>
15
17
 
16
- **Build modern, AI-native backends one Step at a time.**
18
+ **Unify APIs and agents with built-in observability and one-click deployment**
17
19
 
18
- Motia is a tool for building **unified, event-driven, AI-native backends** using a new primitive: the **Step**. Think of Steps like React Components but for backend logic.
20
+ Motia is a modern backend framework that unifies APIs, background jobs, events, and AI agents. Eliminate runtime complexity and build unified backends where JavaScript, TypeScript, and Python work together in event-driven workflows, with built-in state management, observability, and one-click deployments.
21
+
22
+ Motia brings cohesion to the fragmented backend world with our primitive: the **Step**. Think of Steps like React Components, but for backends.
19
23
 
20
24
  - 🧱 Each Step performs one task.
25
+ - 📚 Each Step can be in a different language, while being part of the same flow.
21
26
  - 🔀 Steps connect via Workflows.
22
27
  - 🤖 Steps can trigger APIs, background jobs, or even LLMs.
23
28
  - 🧰 Everything is observable via the built-in Workbench.
24
29
 
25
30
  ---
26
31
 
27
- ## ✨ Why Motia?
28
32
 
29
- Modern backend systems are **complex**. You're juggling APIs, queues, cron jobs, AI tools, and business logic — all scattered across different layers.
30
33
 
31
- Motia solves this by letting you build your backend as a **graph of Steps**. Steps are:
34
+ ## 🚧 The Problem
35
+
36
+ Backend teams juggle fragmented runtimes across APIs, background queues, and AI agents. This creates deployment complexity, debugging gaps, and cognitive overhead from context-switching between frameworks.
32
37
 
33
- - 🧠 **Composable**: Chain Steps like functions
34
- - 🔄 **Declarative Workflows**: Define complex processes with a simple, readable syntax
35
- - 🛠️ **Type-Safe**: Built with strong typing support for all supported languages
36
- - 🚀 **Event-driven**: Steps react to events and emit new ones
37
- - 🌐 **Language/runtime agnostic**: Write in JS, TS, Python (with support for more languages coming out soon)
38
- - 🔍 **Visualizable**: Inspect and debug your workflows with Motia Workbench
39
- - 👀 **Debuggable**: Visualize everything in the built-in Workbench
38
+ *This fragmentation demands a unified system.*
40
39
 
41
40
  ---
42
41
 
43
- ## Installation
42
+ ## ✅ The Unified System
43
+
44
+ Motia unifies your entire backend into a unified state. APIs, background jobs, and AI agents become interconnected Steps with shared state and integrated observability.
45
+
46
+
47
+ | **Before** | **After (Motia)** |
48
+ | --------------------------- | ----------------------------------- |
49
+ | Multiple deployment targets | Single unified deployment |
50
+ | Fragmented observability | End-to-end tracing |
51
+ | Language lock-in | JavaScript, TypeScript, Python |
52
+ | Context-switching overhead | Single intuitive model |
53
+ | Complex error handling | Automatic retries & fault tolerance |
54
+
55
+
56
+ ![Motia combines APIs, background queues, and AI agents into one system](../../assets/2.gif)
57
+
44
58
 
45
- ### JavaScript/TypeScript
46
- ```sh
47
- npm install motia
48
- # or
49
- yarn add motia
50
- # or
51
- pnpm add motia
52
- ```
53
59
  ---
54
60
 
55
61
  ## 🔧 Supported Step Types
@@ -142,44 +148,44 @@ From here, you can:
142
148
 
143
149
  ## CLI Commands
144
150
 
145
- Motia comes with a powerful CLI to help you manage your projects:
146
-
147
- ### `motia init`
148
-
149
- Initializes a new Motia project in the current directory.
151
+ Motia comes with a range of [powerful CLI commands](https://www.motia.dev/docs/concepts/cli) to help you manage your projects, in addition to the ones listed below:
150
152
 
153
+ ### `npx motia create [options]`
154
+ Create a new Motia project in a fresh directory or the current one.
151
155
  ```sh
152
- motia init
153
- ```
154
-
155
- ### `motia install`
156
+ npx motia create [options]
156
157
 
157
- Sets up your project's dependencies and environment. For Python projects, this will create and configure a virtual environment.
158
-
159
- ```sh
160
- motia install
158
+ # options
159
+ # -n, --name <project name>: Project name; use . or ./ to use current directory
160
+ # -t, --template <template name>: Template to use; run npx motia templates to view available ones
161
+ # -c, --cursor: Adds .cursor config for Cursor IDE
161
162
  ```
162
163
 
163
- ### `motia build`
164
+ ### `npx motia dev`
164
165
 
165
- Builds a lock file based on your current project setup which is then used by the Motia ecosystem.
166
+ Initiates a dev environment for your project allowing you to use Motia Workbench (visualization tool for your flows). For Python projects, this will automatically use the configured virtual environment.
166
167
 
167
168
  ```sh
168
- motia build
169
- ```
170
-
171
- ### `motia dev`
169
+ npm run dev [options]
170
+ # or
171
+ yarn dev [options]
172
+ # or
173
+ pnpm dev [options]
174
+ # or
175
+ bun run dev [options]
172
176
 
173
- Initiates a dev environment for your project allowing you to use Motia Workbench (visualization tool for your flows). For Python projects, this will automatically use the configured virtual environment.
177
+ # options:
178
+ # -p, --port <port> The port to run the server on (default: 3000)
179
+ # -v, --verbose Enable verbose logging
180
+ # -d, --debug Enable debug logging
181
+ # -m, --mermaid Enable mermaid diagram generation
182
+ ```
174
183
 
175
- ```sh
176
- motia dev [options]
184
+ ### `npx motia build`
185
+ Compiles all your steps (Node.js, Python and more) and builds a lock file based on your current project setup which is then used by the Motia ecosystem.
177
186
 
178
- Options:
179
- -p, --port <port> The port to run the server on (default: 3000)
180
- -v, --verbose Enable verbose logging
181
- -d, --debug Enable debug logging
182
- -m, --mermaid Enable mermaid diagram generation
187
+ ``` bash
188
+ motia build
183
189
  ```
184
190
 
185
191
  ## Language Support
@@ -199,10 +205,14 @@ For more information on a specific command, you can use the `--help` flag:
199
205
  ```sh
200
206
  motia <command> --help
201
207
  ```
208
+ ![alt text](../../assets/1.png)
202
209
 
203
210
  ## Documentation
204
211
 
205
- For full documentation, visit [https://motia.dev/docs](https://motia.dev/docs)
212
+ For full documentation, visit [our docs.](https://motia.dev/docs)
213
+
214
+ ## Help
215
+ For questions and support please use the [official Discord channel](https://discord.gg/7rXsekMK). The issue list of our Github repo is exclusively for bug reports and feature requests.
206
216
 
207
217
  ## Contributing
208
218
 
@@ -210,4 +220,4 @@ We welcome contributions! Please see our [Contributing Guide](https://github.com
210
220
 
211
221
  ## License
212
222
 
213
- This project is licensed under the MIT License.
223
+ This project is licensed under the MIT License.
@@ -47,7 +47,7 @@ cli_1.cloudCli
47
47
  process.exit(1);
48
48
  }
49
49
  console.log(colors_1.default.green('✓ [SUCCESS]'), 'Build completed');
50
- await versionManager.deploy(context, process.cwd(), arg.version, {
50
+ await versionManager.deploy(context, process.cwd(), arg.versionName, {
51
51
  projectId: arg.projectId,
52
52
  environmentId: arg.environmentId,
53
53
  envFile: arg.envFile,
@@ -17,7 +17,7 @@ export declare class VersionService {
17
17
  }>;
18
18
  promoteVersion(args: {
19
19
  environmentId: string;
20
- version: string;
20
+ versionName: string;
21
21
  projectId: string;
22
22
  }): Promise<void>;
23
23
  }
@@ -51,20 +51,20 @@ class VersionService {
51
51
  return await this.versionClient.getVersionStatus(versionId);
52
52
  }
53
53
  async promoteVersion(args) {
54
- const { environmentId, version, projectId } = args;
54
+ const { environmentId, versionName, projectId } = args;
55
55
  const environmentsClient = this.context.apiFactory.getEnvironmentsClient();
56
56
  const environment = await environmentsClient.getEnvironment(projectId, environmentId);
57
57
  this.context.log('promote-version', (message) => message
58
58
  .tag('progress')
59
59
  .append('Promoting version')
60
- .append(version, 'dark')
60
+ .append(versionName, 'dark')
61
61
  .append('to')
62
62
  .append(environment.name, 'dark'));
63
- await this.versionClient.promoteVersion(environmentId, version);
63
+ await this.versionClient.promoteVersion(environmentId, versionName);
64
64
  this.context.log('promote-version', (message) => message
65
65
  .tag('success')
66
66
  .append('Version')
67
- .append(version, 'dark')
67
+ .append(versionName, 'dark')
68
68
  .append('promoted successfully to')
69
69
  .append(environment.name, 'dark'));
70
70
  }
@@ -160,7 +160,7 @@ const updateEnvironment = async (arg, context) => {
160
160
  await context.versionService.promoteVersion({
161
161
  projectId: context.config.id,
162
162
  environmentId: context.config.selectedEnvironment,
163
- version: arg.version,
163
+ versionName: arg.versionName,
164
164
  });
165
165
  };
166
166
  exports.updateEnvironment = updateEnvironment;
@@ -42,7 +42,7 @@ cloudCli
42
42
  process.exit(1);
43
43
  }
44
44
  console.log(colors.green('✓ [SUCCESS]'), 'Build completed');
45
- await versionManager.deploy(context, process.cwd(), arg.version, {
45
+ await versionManager.deploy(context, process.cwd(), arg.versionName, {
46
46
  projectId: arg.projectId,
47
47
  environmentId: arg.environmentId,
48
48
  envFile: arg.envFile,
@@ -17,7 +17,7 @@ export declare class VersionService {
17
17
  }>;
18
18
  promoteVersion(args: {
19
19
  environmentId: string;
20
- version: string;
20
+ versionName: string;
21
21
  projectId: string;
22
22
  }): Promise<void>;
23
23
  }
@@ -45,20 +45,20 @@ export class VersionService {
45
45
  return await this.versionClient.getVersionStatus(versionId);
46
46
  }
47
47
  async promoteVersion(args) {
48
- const { environmentId, version, projectId } = args;
48
+ const { environmentId, versionName, projectId } = args;
49
49
  const environmentsClient = this.context.apiFactory.getEnvironmentsClient();
50
50
  const environment = await environmentsClient.getEnvironment(projectId, environmentId);
51
51
  this.context.log('promote-version', (message) => message
52
52
  .tag('progress')
53
53
  .append('Promoting version')
54
- .append(version, 'dark')
54
+ .append(versionName, 'dark')
55
55
  .append('to')
56
56
  .append(environment.name, 'dark'));
57
- await this.versionClient.promoteVersion(environmentId, version);
57
+ await this.versionClient.promoteVersion(environmentId, versionName);
58
58
  this.context.log('promote-version', (message) => message
59
59
  .tag('success')
60
60
  .append('Version')
61
- .append(version, 'dark')
61
+ .append(versionName, 'dark')
62
62
  .append('promoted successfully to')
63
63
  .append(environment.name, 'dark'));
64
64
  }
@@ -149,6 +149,6 @@ export const updateEnvironment = async (arg, context) => {
149
149
  await context.versionService.promoteVersion({
150
150
  projectId: context.config.id,
151
151
  environmentId: context.config.selectedEnvironment,
152
- version: arg.version,
152
+ versionName: arg.versionName,
153
153
  });
154
154
  };
@@ -17,7 +17,7 @@ export declare class VersionService {
17
17
  }>;
18
18
  promoteVersion(args: {
19
19
  environmentId: string;
20
- version: string;
20
+ versionName: string;
21
21
  projectId: string;
22
22
  }): Promise<void>;
23
23
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "motia",
3
3
  "description": "Code-first framework for intelligent workflows",
4
- "version": "0.2.1-beta.75",
4
+ "version": "0.2.1-beta.76",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -42,8 +42,8 @@
42
42
  "inquirer": "^8.2.5",
43
43
  "table": "^6.9.0",
44
44
  "ts-node": "^10.9.2",
45
- "@motiadev/core": "0.2.1-beta.75",
46
- "@motiadev/workbench": "0.2.1-beta.75"
45
+ "@motiadev/core": "0.2.1-beta.76",
46
+ "@motiadev/workbench": "0.2.1-beta.76"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@amplitude/analytics-types": "^2.9.2",