{"id":20966751,"url":"https://github.com/morintd/automaton-core","last_synced_at":"2025-07-12T01:04:05.945Z","repository":{"id":153549668,"uuid":"629813476","full_name":"morintd/automaton-core","owner":"morintd","description":"A wrapper to help with controlling your automaton from an external controller.","archived":false,"fork":false,"pushed_at":"2023-04-19T04:56:17.000Z","size":191,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-03T01:43:38.096Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/morintd.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-19T04:42:36.000Z","updated_at":"2023-04-19T04:43:03.000Z","dependencies_parsed_at":"2023-05-19T12:45:38.686Z","dependency_job_id":null,"html_url":"https://github.com/morintd/automaton-core","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/morintd/automaton-core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morintd%2Fautomaton-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morintd%2Fautomaton-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morintd%2Fautomaton-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morintd%2Fautomaton-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/morintd","download_url":"https://codeload.github.com/morintd/automaton-core/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/morintd%2Fautomaton-core/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264922782,"owners_count":23683690,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T03:01:21.451Z","updated_at":"2025-07-12T01:04:05.624Z","avatar_url":"https://github.com/morintd.png","language":"TypeScript","readme":"# automaton-core\n\n⚠️ This is a Work In Progress (WIP)\n\n`automaton-core` is a TypeScript Wrapper for IOT/automaton/robot projects. It aims to provide an easy way to communicate with an external controller, so you can focus on what's important: behavior.\n\n## Example\n\n```typescript\n// index.ts\nimport { BareConfig, AutomatonCore, SerialPortConnector, WebSocketConnector } from 'automaton-core';\n\nimport { Automaton } from './automaton';\n\nconst config: BareConfig = {\n  id: 'main-automaton',\n  connectors: [\n    // {\n    //   type: 'serial',\n    //   options: {\n    //     path: '/dev/ttyAMA0',\n    //   },\n    // },\n    {\n      type: 'websocket',\n      options: {\n        address: 'ws://localhost:3000',\n      },\n    },\n  ],\n};\n\nfunction main() {\n  const automaton = new AutomatonCore({\n    config,\n    connectors: {\n      [SerialPortConnector.type]: SerialPortConnector.creator,\n      [WebSocketConnector.type]: WebSocketConnector.creator,\n    },\n    behavior: (write, config, logger) =\u003e {\n      return new Automaton(write, config, logger);\n    },\n  });\n\n  automaton.start();\n}\n\nmain();\n```\n\n```typescript\n// automaton.ts\nimport { AutomatonBehavior, ActionType, BareConfig, ILogger, WriteAction } from 'automaton-core';\n\nexport class Automaton implements AutomatonBehavior {\n  constructor(private write: WriteAction, private config: BareConfig, private logger: ILogger) {}\n\n  handle(action: ActionType) {\n    this.logger.log('received action', { action });\n    this.write({\n      type: 'hello',\n    });\n  }\n\n  start() {\n    this.logger.log('Started automaton!', this.config);\n  }\n\n  stop() {\n    this.logger.log('Stopped automaton!');\n    return Promise.resolve();\n  }\n}\n```\n\n## Todo\n\n- Complete documentation + a dd examples\n- Create controller lib (\u0026 move them to an org?)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorintd%2Fautomaton-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmorintd%2Fautomaton-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmorintd%2Fautomaton-core/lists"}