Skip to content

Instantly share code, notes, and snippets.

View mfpiccolo's full-sized avatar

Mike Piccolo mfpiccolo

View GitHub Profile

Motia: Skip the Protocols, Ship the Product (and Still Speak Them When You Must)

TL;DR Motia collapses APIs, AI agents, cron/background jobs and into a single event‑driven step model. Most of the time, formal layers like MCP (Model Context Protocol), A2A (Agent‑to‑Agent), and runtime Tool‑Use are unnecessary—plain JSON events and SDK calls get the job done with much less ceremony. If you do need MCP/A2A to talk to a partner, Motia can emit or consume those packets through a thin adapter step, so you remain interoperable without letting protocol complexity infect your codebase.


1 · The Landscape in 60 Seconds

Acronym Purpose Hidden Cost
{
"rules": [
// File Structure Rules
{
"name": "enforce-step-file-naming",
"description": "Ensure step files follow the *.step.{ts,js,py,rb} naming convention",
"pattern": "\\b(?!.*\\.step\\.(ts|js|py|rb)$).*step\\b",
"severity": "error",
"message": "Step files must follow the pattern: filename.step.{ts|js|py|rb}",
"example": {
// I am trying to decide on an API for blue-chip's virtual models.
class Owner extends BaseModel {
static get hasMany() {return [Dog]}
}
class Dog extends BaseModel {
static get belongsTo() {return [Owner]}
}
class VirtualOwner extends BaseModel {
@mfpiccolo
mfpiccolo / fetch_json.js
Created October 17, 2016 02:47
Concept for json api deserializer fetch wrapper.
api_config = {
base_url: 'http://localhost:8065/api/v3',
defaluts: { // if none passed here then use JSON.parse()
success_deserializer: successJsonApiDerserializer,
error_deserializer: errorJsonApiDerserializer,
// has the same defaults as fetch
},
resources: {
all_team_listings: {
endpoint: 'teams/all_team_listings',
@mfpiccolo
mfpiccolo / diesel.js
Last active April 20, 2016 03:16
Concept for ruby-diesel
var diesel = require("diesel")
var User = require('User');
diesel.config({
infer_schema = true
infer_models = true # I was thinking this would create Queriable structs with sane defaults based on schema
database_url = "postgres://localhost/ruby_diesel_dev"
model_mapping: {
users: User
}
use sqlite::Sqlite;
use types::{self, FromSql, FromSqlRow, HasSqlType, Numeric, Float};
use std::error::Error;
use sqlite::connection::SqliteValue;
use std::str::FromStr;
use query_source::Queryable;
use row::Row;
#[derive(Debug, Clone, PartialEq, PartialOrd)]
pub enum SqliteNumeric {
impl<T, U> ToJsonApi for Vec<(T, Option<U>)>
where T: ToResourceObject + Default, U: ToResourceObject
{
fn serialize(&self) -> String {
self.into_iter().group_by(|&&(a, b)| a)
.map(|(c, d)| d.into_iter().filter_map(|(e,f)| f).collect())
.collect();
"some".to_string()
}
#![feature(custom_derive, core)]
extern crate core;
use std::io;
use std::io::prelude::*;
use core::fmt::Debug;
#[derive(Debug)]
struct Product {
id: i32,
pub trait Converter {
fn blah(&self) -> &String;
}
struct This {
convert: String,
}
struct That {
convert: String,
}
pre code {
font-size: 14px;
line-height: 1.2em;
width: 672px;
}
#disqus_thread {
margin-left: 19%;
margin-right: 19%;
}