Skip to content

Package a module ​

A module adds a workflow to Alta OS: scheduled jobs, skills, files. There are two kinds of module chart, and the difference is who may ship a script.

A community module ​

alta chart new --kind module writes a module made of data only: a schedule and its message. Its one part turns the schedule on, after the owner's yes.

Terminal
sh
alta chart new my-module --kind module
alta lint my-module
alta template my-module

A community chart never ships a script that is run (chart.scripts-alta): everything it does goes through an action of the closed list.

Alta's own modules ​

Alta's modules ship with Alta OS, and only they may carry scripts. This is the sunrise module, which gives the time of the next sunrise at the owner's place:

modules/sunrise/chart.json
json
{
  "schema": "alta.chart/0.1",
  "id": "sunrise",
  "version": "0.1.0",
  "kind": "module",
  "title": {
    "en": "Sunrise",
    "fr": "Lever du soleil"
  },
  "summary": {
    "en": "Sunrise and sunset for the next wake-up at the owner's current place (bedtime brief, wake-up planning).",
    "fr": "Lever et coucher du soleil pour le prochain réveil, là où tu es (point du soir, préparation du réveil)."
  },
  "author": "Alta",
  "license": "MIT",
  "price": "free",
  "origin": "alta",
  "locality": "local",
  "support": {
    "platforms": [
      {
        "os": "macos"
      }
    ],
    "notes": {
      "macos": {
        "en": "Tested on macOS (Apple silicon) only. Linux candidate (stdlib Python), never run there.",
        "fr": "Testé sur macOS (Apple silicon) seulement. Candidat Linux (Python standard), jamais lancé là."
      }
    }
  },
  "requires": {
    "charts": [
      {
        "id": "alta-os",
        "version": ">=0.5.0"
      }
    ]
  },
  "capabilities": [
    "install"
  ],
  "values": {
    "node": {
      "kind": "text",
      "label": {
        "en": "The phone that shares its place",
        "fr": "Le téléphone qui partage sa position"
      },
      "default": "",
      "required": false,
      "pattern": "^$|^[0-9A-Za-z_.:-]{1,128}$"
    }
  },
  "package": {
    "type": "alta-module",
    "scripts": {
      "macos": {
        "install": "scripts/install.sh",
        "check": "scripts/check.sh",
        "checkArgs": [
          "--install-only"
        ],
        "selftest": "tests/selftest.sh"
      }
    },
    "module": {
      "workflows": {},
      "packages": {},
      "requires": {
        "bins": [
          {
            "name": "python3",
            "how": "macOS (Xcode command line tools), 3.9+; stdlib only"
          }
        ],
        "optional": [
          {
            "name": "openclaw",
            "how": "OpenClaw CLI with a paired phone node that shares its location (else the cached place only)"
          },
          {
            "name": "alta-hook",
            "how": "Engine helper that reads the owner's param `node` (else SUNRISE_NODE, else no phone)"
          }
        ],
        "paths": [
          {
            "name": "~/.local/share/bedtime-briefing/location.json",
            "how": "cached place {name, lat, lon, tz}; written on each phone fix (override: SUNRISE_LOCATION)"
          }
        ],
        "accounts": []
      }
    }
  },
  "parts": [
    {
      "id": "install",
      "do": "workflow.install",
      "args": {
        "id": "sunrise"
      },
      "undo": "command",
      "proof": [
        {
          "type": "module",
          "id": "sunrise"
        }
      ]
    }
  ],
  "proofs": {
    "ready": [
      {
        "type": "module",
        "id": "sunrise"
      }
    ],
    "installed": [
      {
        "type": "bin",
        "name": "sunrise.py"
      }
    ]
  }
}
  • package.type: "alta-module" with scripts per system: the install script, the check script and its arguments, the self-test. The engine runs the scripts of the owner's system, and refuses a system the chart does not list before writing anything.
  • One part names workflow.install; its undo is the command the plan shows.
  • requires.charts starts with alta-os, the base system, then the modules it builds on.
  • support lists only the systems where the scripts really passed; candidates go in notes, in English and French.

What's next

Alta OS is open source (MIT).