Skip to content

Workspace source

Everything a tenant authors lives in a flat workspace package. The pod CLI registers modules into its SvelteKit surface and compiles them into build output.

Layout

workspace/
├── workspace.api.ts      # defineWorkspace — collections, invoke, automations
├── workspace.ts          # register apps, re-export api
├── schema.ts
├── collections/
├── apps/
├── automation/
├── remote/
├── lib/
└── seed/

workspace.api.ts

const { api, ws } = defineWorkspace(schema, {
  meta: { name: 'My workspace' },
  collections: [employees, payroll_runs],
  invoke: { holidayFeed },
  automations: [statutoryDriftCheck]
});

export { api, ws };

workspace.ts calls ws.register({ apps }) for Svelte apps and re-exports api for tenant UI imports.

What goes where

  • Collectionscollections/<name>/<name>.collection.ts and <name>.schema.ts
  • Hooks & pipelines — beside each collection module
  • Automationsautomation/*.ts
  • Appsapps/<slug>/+page.svelte
  • Handlersremote/*.handler.ts, registered via invoke: and called as api.invoke.<name>(…)
Editing on Core
Workspace Studio is the browser editor for this same source tree.