All docs

App package layout

What a pack must contain.

Source docs/en/site/sdk-appsdk-pack.md

What a pack must contain.

Readers: people who will hand-build a runnable workspace app from scratch. Runtime root: {RUNTIME_DIR}/workspaces/{workspaceId}/apps/{appSlug}/


1. Full directory

{appSlug}/
├── app.json                 # UI and data model (authors change this most)
├── manifest.json            # Manifest (platform writes: display name, assembly, intents…)
├── data/
│   └── app.db               # Business SQLite (platform creates tables from entities)
├── schema/
│   └── 001_init.sql         # DDL generated from entities
├── logic/
│   ├── handlers.py          # Custom-action entry (must be runnable when there are script actions)
│   └── *.py                 # Optional: business helpers (for example generate_profile.py)
├── scripts/                 # Optional: assemble/tool scripts (copied into the sandbox on invoke)
├── assets/                  # Optional: HTML templates, static assets
├── references/              # Optional: pipeline.json, field-mapping.json, and similar
└── skills/
    └── SKILL.md             # Notes so agents can call this app from conversation (often platform-generated)

2. Required vs optional

2.1 Minimal usable app (local register + list only)

For example a “notebook”: only form + list, built-in CRUD.

ItemRequired?Notes
app.jsonYes≥1 entity, ≥1 view
manifest.jsonYesNormally written by platform “create app”; do not hand-break app_id
data/app.dbYesGenerated on first init/migrate
schema/*.sqlYesAligned with entities; after entity changes the platform migrates extra columns
logic/handlers.pyUsually a stub on diskNo custom actions → no business to implement; with impl=script you must implement handle
actionsNot neededCan omit for CRUD-only
scripts/ assets/ references/Not needed

2.2 App with “one-click work” (actions + optional fetch)

For example “employee profile”: action_form + history list + script fetch producing HTML.

ItemRequired?Notes
Minimal set aboveYes
app.jsonactions + action_formYesAction id matches view action
Matching branch in logic/handlers.pyYesSee App actions
Other .py under logicAs neededPrefer splitting so one file does not grow huge
references/pipeline.jsonRecommendedDeclarative steps for multi-step fetch
scripts/ + assets/As neededNeeded when generating reports/HTML
references/field-mapping.jsonAs neededTemplate slot fill
Workspace data connection and predefined queriesAs neededEvery query_id in the pipeline must exist on the connection and the user must be allowed

3. Which directories enter the sandbox on invoke

When running a custom action, the platform copies these directories into a temporary working directory (does not mount the whole app directory as-is):

  • logic/ (must have handlers.py)
  • scripts/
  • assets/
  • references/

Not copied: data/, schema/, skills/, app.json, manifest.json. The business-DB path is injected via env / ctx["app_db"].

Therefore: templates, pipelines, and helper py that business scripts need must live in one of those four directories.


4.1 In-product “App pack” panel

After you open a lightweight app, top-bar “App pack” can browse text files in the directories above and edit-save allowlisted paths (same write scope as the app-development assistant). app.json / manifest.json are read-only preview. Details: App data pipeline §8.


5. File duties (quick lookup)

FileWho maintainsDuty
app.jsonAuthor / app-development assistantEntities, views, actions → decides what the UI looks like and which buttons exist
logic/handlers.pyAuthorhandle(action, params, ctx) dispatch; write DB, call platform bridge
logic/*.pyAuthorFetch orchestration, domain logic
references/pipeline.jsonAuthorFetch step list (query_id, param templates)
scripts/*.pyAuthorPure transform (for example HTML assemble), prefer no side effects
assets/*AuthorResult layout templates
data/app.dbRuntimeApp-private data such as history
skills/SKILL.mdOften auto-generatedHow conversation calls this app’s actions

6. Mapping to “add a feature on the UI”

You want to add on the UI…Change
Extra list column / form inputapp.json entity fields + view columns/fields or action params
Extra “do work” button blockactions[] + action_form + new branch in handlers.py
Look up HR/business DB when doing workIn handlers call ctx["platform"].query_run; prefer a pipeline.json
Generate an openable report after workAssemble HTML → platform.save_upload → return upload_id; list entity has upload_id
Only add/remove local recordsform/list + built-in CRUD; you need not write script logic

Detailed steps: App actions · App data pipeline · Hand-build an app.