motia 0.6.0-beta.122 → 0.6.0-beta.123

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.
@@ -1,6 +1,6 @@
1
1
  [
2
2
  {
3
- "id": "python-tutorial",
3
+ "id": "basic-tutorial",
4
4
  "config": {
5
5
  "steps/state_audit_cron_step.py": {
6
6
  "x": -38,
@@ -5,7 +5,7 @@ from .services.types import Pet
5
5
 
6
6
  class PetRequest(BaseModel):
7
7
  name: str
8
- photo_url: str
8
+ photoUrl: str
9
9
 
10
10
  class FoodOrder(BaseModel):
11
11
  id: str
@@ -13,20 +13,20 @@ class FoodOrder(BaseModel):
13
13
 
14
14
  class RequestBody(BaseModel):
15
15
  pet: PetRequest
16
- food_order: Optional[FoodOrder] = None
16
+ foodOrder: Optional[FoodOrder] = None
17
17
 
18
18
  config = {
19
19
  "type": "api",
20
- "name": "PythonApiTrigger",
20
+ "name": "ApiTrigger",
21
21
  "description": "basic-tutorial api trigger",
22
- "flows": ["python-tutorial"],
22
+ "flows": ["basic-tutorial"],
23
23
  "method": "POST",
24
- "path": "/python-basic-tutorial",
24
+ "path": "/basic-tutorial",
25
25
  "bodySchema": RequestBody.model_json_schema(),
26
26
  "responseSchema": {
27
27
  200: Pet.model_json_schema(),
28
28
  },
29
- "emits": ["python-process-food-order"],
29
+ "emits": ["process-food-order"],
30
30
  }
31
31
 
32
32
  async def handler(req, context):
@@ -34,13 +34,13 @@ async def handler(req, context):
34
34
  context.logger.info("Step 01 – Processing API Step", {"body": body})
35
35
 
36
36
  pet = body.get("pet", {})
37
- food_order = body.get("food_order", {})
37
+ food_order = body.get("foodOrder", {})
38
38
 
39
39
  new_pet_record = await pet_store_service.create_pet(pet)
40
40
 
41
41
  if food_order:
42
42
  await context.emit({
43
- "topic": "python-process-food-order",
43
+ "topic": "process-food-order",
44
44
  "data": {
45
45
  "id": food_order.get("id"),
46
46
  "quantity": food_order.get("quantity"),
@@ -9,10 +9,10 @@ class InputSchema(BaseModel):
9
9
 
10
10
  config = {
11
11
  "type": "event",
12
- "name": "PythonNotification",
12
+ "name": "Notification",
13
13
  "description": "Checks a state change",
14
- "flows": ["python-tutorial"],
15
- "subscribes": ["python-notification"],
14
+ "flows": ["basic-tutorial"],
15
+ "subscribes": ["notification"],
16
16
  "emits": [],
17
17
  "input": InputSchema.model_json_schema(),
18
18
  }
@@ -10,11 +10,11 @@ class InputSchema(BaseModel):
10
10
 
11
11
  config = {
12
12
  "type": "event",
13
- "name": "PythonProcessFoodOrder",
13
+ "name": "ProcessFoodOrder",
14
14
  "description": "basic-tutorial event step, demonstrates how to consume an event from a topic and persist data in state",
15
- "flows": ["python-tutorial"],
16
- "subscribes": ["python-process-food-order"],
17
- "emits": ["python-notification"],
15
+ "flows": ["basic-tutorial"],
16
+ "subscribes": ["process-food-order"],
17
+ "emits": ["notification"],
18
18
  "input": InputSchema.model_json_schema(),
19
19
  }
20
20
 
@@ -35,7 +35,7 @@ async def handler(input_data, context):
35
35
  await context.state.set("orders_python", order.get("id"), order)
36
36
 
37
37
  await context.emit({
38
- "topic": "python-notification",
38
+ "topic": "notification",
39
39
  "data": {
40
40
  "email": input_data["email"],
41
41
  "template_id": "new-order",
@@ -6,7 +6,7 @@ class PetStoreService:
6
6
  async def create_pet(self, pet: Dict[str, Any]) -> Pet:
7
7
  pet_data = {
8
8
  "name": pet.get("name", ""),
9
- "photoUrls": [pet.get("photo_url", "")],
9
+ "photoUrls": [pet.get("photoUrl", "")],
10
10
  "status": "available"
11
11
  }
12
12
 
@@ -3,10 +3,10 @@ from datetime import datetime, timezone
3
3
  config = {
4
4
  "type": "cron",
5
5
  "cron": "*/5 * * * *", # run every 5 minutes
6
- "name": "PythonStateAuditJob",
6
+ "name": "StateAuditJob",
7
7
  "description": "Checks the state for orders that are not complete and have a ship date in the past",
8
- "emits": ["python-notification"],
9
- "flows": ["python-tutorial"],
8
+ "emits": ["notification"],
9
+ "flows": ["basic-tutorial"],
10
10
  }
11
11
 
12
12
  async def handler(context):
@@ -25,7 +25,7 @@ async def handler(context):
25
25
  })
26
26
 
27
27
  await context.emit({
28
- "topic": "python-notification",
28
+ "topic": "notification",
29
29
  "data": {
30
30
  "email": "test@test.com",
31
31
  "template_id": "order-audit-warning",
@@ -27,7 +27,7 @@ export const steps: TutorialStep[] = [
27
27
  // Flows
28
28
 
29
29
  {
30
- elementXpath: workbenchXPath.flows.node('pythonapitrigger'),
30
+ elementXpath: workbenchXPath.flows.node('apitrigger'),
31
31
  title: 'API Step',
32
32
  link: 'https://www.motia.dev/docs/concepts/steps/api',
33
33
  description: () => (
@@ -38,11 +38,11 @@ export const steps: TutorialStep[] = [
38
38
  ),
39
39
  before: [
40
40
  { type: 'click', selector: workbenchXPath.links.flows },
41
- { type: 'click', selector: workbenchXPath.flows.dropdownFlow('python-tutorial') },
41
+ { type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
42
42
  ],
43
43
  },
44
44
  {
45
- elementXpath: workbenchXPath.flows.previewButton('pythonapitrigger'),
45
+ elementXpath: workbenchXPath.flows.previewButton('apitrigger'),
46
46
  title: 'Code Preview',
47
47
  description: () => <p>Clicking on this icon will allow you to visualize the source code for a given Step.</p>,
48
48
  before: [
@@ -81,7 +81,7 @@ export const steps: TutorialStep[] = [
81
81
  </div>
82
82
  ),
83
83
  before: [
84
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonapitrigger') },
84
+ { type: 'click', selector: workbenchXPath.flows.previewButton('apitrigger') },
85
85
  { type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
86
86
  ],
87
87
  },
@@ -195,7 +195,7 @@ export const steps: TutorialStep[] = [
195
195
  // Event Steps
196
196
 
197
197
  {
198
- elementXpath: workbenchXPath.flows.node('pythonprocessfoodorder'),
198
+ elementXpath: workbenchXPath.flows.node('processfoodorder'),
199
199
  title: 'Event Step',
200
200
  link: 'https://www.motia.dev/docs/concepts/steps/event',
201
201
  description: () => (
@@ -229,7 +229,7 @@ export const steps: TutorialStep[] = [
229
229
  </p>
230
230
  ),
231
231
  before: [
232
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonprocessfoodorder') },
232
+ { type: 'click', selector: workbenchXPath.flows.previewButton('processfoodorder') },
233
233
  { type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
234
234
  ],
235
235
  },
@@ -289,7 +289,7 @@ export const steps: TutorialStep[] = [
289
289
  // Cron Steps
290
290
 
291
291
  {
292
- elementXpath: workbenchXPath.flows.node('pythonstateauditjob'),
292
+ elementXpath: workbenchXPath.flows.node('stateauditjob'),
293
293
  title: 'Cron Step',
294
294
  link: 'https://www.motia.dev/docs/concepts/steps/cron',
295
295
  description: () => (
@@ -322,7 +322,7 @@ export const steps: TutorialStep[] = [
322
322
  </p>
323
323
  ),
324
324
  before: [
325
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonstateauditjob') },
325
+ { type: 'click', selector: workbenchXPath.flows.previewButton('stateauditjob') },
326
326
  { type: 'click', selector: workbenchXPath.flows.feature('cron-configuration') },
327
327
  ],
328
328
  },
@@ -361,7 +361,7 @@ export const steps: TutorialStep[] = [
361
361
  before: [{ type: 'click', selector: workbenchXPath.closePanelButton }],
362
362
  },
363
363
  {
364
- elementXpath: workbenchXPath.endpoints.endpoint('POST', '/python-basic-tutorial'),
364
+ elementXpath: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial'),
365
365
  title: 'Endpoints Tool',
366
366
  description: () => (
367
367
  <p>
@@ -387,7 +387,7 @@ export const steps: TutorialStep[] = [
387
387
  endpoint in the <b>Call</b> Tab.
388
388
  </p>
389
389
  ),
390
- before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/python-basic-tutorial') }],
390
+ before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
391
391
  },
392
392
  {
393
393
  elementXpath: workbenchXPath.endpoints.callPanel,
@@ -406,12 +406,12 @@ export const steps: TutorialStep[] = [
406
406
  <br />
407
407
  <pre className="code-preview">
408
408
  <code className="language-bash">
409
- curl -X POST http://localhost:3000/python-basic-tutorial \<br />
409
+ curl -X POST http://localhost:3000/basic-tutorial \<br />
410
410
  {' '}-H "Content-Type: application/json" \<br />
411
411
  {' '}-d '
412
412
  {JSON.stringify({
413
- pet: { name: 'Jack', photo_url: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
414
- food_order: { id: 'food-order-1', quantity: 0 },
413
+ pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
414
+ foodOrder: { id: 'food-order-1', quantity: 0 },
415
415
  })}
416
416
  '
417
417
  </code>
@@ -433,8 +433,8 @@ export const steps: TutorialStep[] = [
433
433
  {
434
434
  type: 'fill-editor',
435
435
  content: {
436
- pet: { name: 'Jack', photo_url: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
437
- food_order: { id: 'food-order-1', quantity: 0 },
436
+ pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
437
+ foodOrder: { id: 'food-order-1', quantity: 0 },
438
438
  },
439
439
  },
440
440
  ],
@@ -1,6 +1,6 @@
1
1
  [
2
2
  {
3
- "id": "python-tutorial",
3
+ "id": "basic-tutorial",
4
4
  "config": {
5
5
  "steps/state_audit_cron_step.py": {
6
6
  "x": -38,
@@ -5,7 +5,7 @@ from .services.types import Pet
5
5
 
6
6
  class PetRequest(BaseModel):
7
7
  name: str
8
- photo_url: str
8
+ photoUrl: str
9
9
 
10
10
  class FoodOrder(BaseModel):
11
11
  id: str
@@ -13,20 +13,20 @@ class FoodOrder(BaseModel):
13
13
 
14
14
  class RequestBody(BaseModel):
15
15
  pet: PetRequest
16
- food_order: Optional[FoodOrder] = None
16
+ foodOrder: Optional[FoodOrder] = None
17
17
 
18
18
  config = {
19
19
  "type": "api",
20
- "name": "PythonApiTrigger",
20
+ "name": "ApiTrigger",
21
21
  "description": "basic-tutorial api trigger",
22
- "flows": ["python-tutorial"],
22
+ "flows": ["basic-tutorial"],
23
23
  "method": "POST",
24
- "path": "/python-basic-tutorial",
24
+ "path": "/basic-tutorial",
25
25
  "bodySchema": RequestBody.model_json_schema(),
26
26
  "responseSchema": {
27
27
  200: Pet.model_json_schema(),
28
28
  },
29
- "emits": ["python-process-food-order"],
29
+ "emits": ["process-food-order"],
30
30
  }
31
31
 
32
32
  async def handler(req, context):
@@ -34,13 +34,13 @@ async def handler(req, context):
34
34
  context.logger.info("Step 01 – Processing API Step", {"body": body})
35
35
 
36
36
  pet = body.get("pet", {})
37
- food_order = body.get("food_order", {})
37
+ food_order = body.get("foodOrder", {})
38
38
 
39
39
  new_pet_record = await pet_store_service.create_pet(pet)
40
40
 
41
41
  if food_order:
42
42
  await context.emit({
43
- "topic": "python-process-food-order",
43
+ "topic": "process-food-order",
44
44
  "data": {
45
45
  "id": food_order.get("id"),
46
46
  "quantity": food_order.get("quantity"),
@@ -9,10 +9,10 @@ class InputSchema(BaseModel):
9
9
 
10
10
  config = {
11
11
  "type": "event",
12
- "name": "PythonNotification",
12
+ "name": "Notification",
13
13
  "description": "Checks a state change",
14
- "flows": ["python-tutorial"],
15
- "subscribes": ["python-notification"],
14
+ "flows": ["basic-tutorial"],
15
+ "subscribes": ["notification"],
16
16
  "emits": [],
17
17
  "input": InputSchema.model_json_schema(),
18
18
  }
@@ -10,11 +10,11 @@ class InputSchema(BaseModel):
10
10
 
11
11
  config = {
12
12
  "type": "event",
13
- "name": "PythonProcessFoodOrder",
13
+ "name": "ProcessFoodOrder",
14
14
  "description": "basic-tutorial event step, demonstrates how to consume an event from a topic and persist data in state",
15
- "flows": ["python-tutorial"],
16
- "subscribes": ["python-process-food-order"],
17
- "emits": ["python-notification"],
15
+ "flows": ["basic-tutorial"],
16
+ "subscribes": ["process-food-order"],
17
+ "emits": ["notification"],
18
18
  "input": InputSchema.model_json_schema(),
19
19
  }
20
20
 
@@ -35,7 +35,7 @@ async def handler(input_data, context):
35
35
  await context.state.set("orders_python", order.get("id"), order)
36
36
 
37
37
  await context.emit({
38
- "topic": "python-notification",
38
+ "topic": "notification",
39
39
  "data": {
40
40
  "email": input_data["email"],
41
41
  "template_id": "new-order",
@@ -6,7 +6,7 @@ class PetStoreService:
6
6
  async def create_pet(self, pet: Dict[str, Any]) -> Pet:
7
7
  pet_data = {
8
8
  "name": pet.get("name", ""),
9
- "photoUrls": [pet.get("photo_url", "")],
9
+ "photoUrls": [pet.get("photoUrl", "")],
10
10
  "status": "available"
11
11
  }
12
12
 
@@ -3,10 +3,10 @@ from datetime import datetime, timezone
3
3
  config = {
4
4
  "type": "cron",
5
5
  "cron": "*/5 * * * *", # run every 5 minutes
6
- "name": "PythonStateAuditJob",
6
+ "name": "StateAuditJob",
7
7
  "description": "Checks the state for orders that are not complete and have a ship date in the past",
8
- "emits": ["python-notification"],
9
- "flows": ["python-tutorial"],
8
+ "emits": ["notification"],
9
+ "flows": ["basic-tutorial"],
10
10
  }
11
11
 
12
12
  async def handler(context):
@@ -25,7 +25,7 @@ async def handler(context):
25
25
  })
26
26
 
27
27
  await context.emit({
28
- "topic": "python-notification",
28
+ "topic": "notification",
29
29
  "data": {
30
30
  "email": "test@test.com",
31
31
  "template_id": "order-audit-warning",
@@ -27,7 +27,7 @@ export const steps: TutorialStep[] = [
27
27
  // Flows
28
28
 
29
29
  {
30
- elementXpath: workbenchXPath.flows.node('pythonapitrigger'),
30
+ elementXpath: workbenchXPath.flows.node('apitrigger'),
31
31
  title: 'API Step',
32
32
  link: 'https://www.motia.dev/docs/concepts/steps/api',
33
33
  description: () => (
@@ -38,11 +38,11 @@ export const steps: TutorialStep[] = [
38
38
  ),
39
39
  before: [
40
40
  { type: 'click', selector: workbenchXPath.links.flows },
41
- { type: 'click', selector: workbenchXPath.flows.dropdownFlow('python-tutorial') },
41
+ { type: 'click', selector: workbenchXPath.flows.dropdownFlow('basic-tutorial') },
42
42
  ],
43
43
  },
44
44
  {
45
- elementXpath: workbenchXPath.flows.previewButton('pythonapitrigger'),
45
+ elementXpath: workbenchXPath.flows.previewButton('apitrigger'),
46
46
  title: 'Code Preview',
47
47
  description: () => <p>Clicking on this icon will allow you to visualize the source code for a given Step.</p>,
48
48
  before: [
@@ -81,7 +81,7 @@ export const steps: TutorialStep[] = [
81
81
  </div>
82
82
  ),
83
83
  before: [
84
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonapitrigger') },
84
+ { type: 'click', selector: workbenchXPath.flows.previewButton('apitrigger') },
85
85
  { type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
86
86
  ],
87
87
  },
@@ -195,7 +195,7 @@ export const steps: TutorialStep[] = [
195
195
  // Event Steps
196
196
 
197
197
  {
198
- elementXpath: workbenchXPath.flows.node('pythonprocessfoodorder'),
198
+ elementXpath: workbenchXPath.flows.node('processfoodorder'),
199
199
  title: 'Event Step',
200
200
  link: 'https://www.motia.dev/docs/concepts/steps/event',
201
201
  description: () => (
@@ -229,7 +229,7 @@ export const steps: TutorialStep[] = [
229
229
  </p>
230
230
  ),
231
231
  before: [
232
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonprocessfoodorder') },
232
+ { type: 'click', selector: workbenchXPath.flows.previewButton('processfoodorder') },
233
233
  { type: 'click', selector: workbenchXPath.flows.feature('step-configuration') },
234
234
  ],
235
235
  },
@@ -289,7 +289,7 @@ export const steps: TutorialStep[] = [
289
289
  // Cron Steps
290
290
 
291
291
  {
292
- elementXpath: workbenchXPath.flows.node('pythonstateauditjob'),
292
+ elementXpath: workbenchXPath.flows.node('stateauditjob'),
293
293
  title: 'Cron Step',
294
294
  link: 'https://www.motia.dev/docs/concepts/steps/cron',
295
295
  description: () => (
@@ -322,7 +322,7 @@ export const steps: TutorialStep[] = [
322
322
  </p>
323
323
  ),
324
324
  before: [
325
- { type: 'click', selector: workbenchXPath.flows.previewButton('pythonstateauditjob') },
325
+ { type: 'click', selector: workbenchXPath.flows.previewButton('stateauditjob') },
326
326
  { type: 'click', selector: workbenchXPath.flows.feature('cron-configuration') },
327
327
  ],
328
328
  },
@@ -361,7 +361,7 @@ export const steps: TutorialStep[] = [
361
361
  before: [{ type: 'click', selector: workbenchXPath.closePanelButton }],
362
362
  },
363
363
  {
364
- elementXpath: workbenchXPath.endpoints.endpoint('POST', '/python-basic-tutorial'),
364
+ elementXpath: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial'),
365
365
  title: 'Endpoints Tool',
366
366
  description: () => (
367
367
  <p>
@@ -387,7 +387,7 @@ export const steps: TutorialStep[] = [
387
387
  endpoint in the <b>Call</b> Tab.
388
388
  </p>
389
389
  ),
390
- before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/python-basic-tutorial') }],
390
+ before: [{ type: 'click', selector: workbenchXPath.endpoints.endpoint('POST', '/basic-tutorial') }],
391
391
  },
392
392
  {
393
393
  elementXpath: workbenchXPath.endpoints.callPanel,
@@ -406,12 +406,12 @@ export const steps: TutorialStep[] = [
406
406
  <br />
407
407
  <pre className="code-preview">
408
408
  <code className="language-bash">
409
- curl -X POST http://localhost:3000/python-basic-tutorial \<br />
409
+ curl -X POST http://localhost:3000/basic-tutorial \<br />
410
410
  {' '}-H "Content-Type: application/json" \<br />
411
411
  {' '}-d '
412
412
  {JSON.stringify({
413
- pet: { name: 'Jack', photo_url: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
414
- food_order: { id: 'food-order-1', quantity: 0 },
413
+ pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
414
+ foodOrder: { id: 'food-order-1', quantity: 0 },
415
415
  })}
416
416
  '
417
417
  </code>
@@ -433,8 +433,8 @@ export const steps: TutorialStep[] = [
433
433
  {
434
434
  type: 'fill-editor',
435
435
  content: {
436
- pet: { name: 'Jack', photo_url: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
437
- food_order: { id: 'food-order-1', quantity: 0 },
436
+ pet: { name: 'Jack', photoUrl: 'https://images.dog.ceo/breeds/pug/n02110958_13560.jpg' },
437
+ foodOrder: { id: 'food-order-1', quantity: 0 },
438
438
  },
439
439
  },
440
440
  ],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "motia",
3
3
  "description": "A Modern Unified Backend Framework for APIs, Events and Agents",
4
- "version": "0.6.0-beta.122",
4
+ "version": "0.6.0-beta.123",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -43,9 +43,9 @@
43
43
  "inquirer": "^8.2.5",
44
44
  "table": "^6.9.0",
45
45
  "ts-node": "^10.9.2",
46
- "@motiadev/workbench": "0.6.0-beta.122",
47
- "@motiadev/stream-client-node": "0.6.0-beta.122",
48
- "@motiadev/core": "0.6.0-beta.122"
46
+ "@motiadev/core": "0.6.0-beta.123",
47
+ "@motiadev/workbench": "0.6.0-beta.123",
48
+ "@motiadev/stream-client-node": "0.6.0-beta.123"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@amplitude/analytics-types": "^2.9.2",