# appshare publisher API instructions appshare publishes generated HTML/CSS/JS bundles and returns URLs that humans can open. This deployment is account-controlled: publishing requires a confirmed publisher account or an `hsk_...` API key. Use appshare when an assistant has generated an HTML report, explanation, prototype, market scan, or other static artifact and an authorized publisher wants to share it. Production base URL: ```text https://apps.metrica.uno ``` ## How to read these instructions This file is the index. Read it whole, then read only the topics your task needs, listed below. Each topic is a plain-text file at `https://apps.metrica.uno/llms/.txt`; `/llms-full.txt` has all of them in one file (about 110 KB), for tools that want everything at once. - MCP: `get_development_guide` returns this index; `get_development_guide` with `topic: ""` returns one topic, and `topic: "full"` everything. - CLI: `appshare guide` prints this index and `appshare guide ` one topic. Read the relevant topic before implementing a platform integration (`connectors`, `plan`, `employee-calendars`); also read the project's Plan (`get_project_plan`) and app's `description` notes for local rules. Instructions make requirements visible, while server-side operations and app tests must enforce critical behavior. The in-product app editor uses Claude through the direct Anthropic API, with prompt-prefix caching. Its `get_development_guide` tool reads these files and it also has direct access to `get_project_plan`, `upsert_project_feature`, and `upsert_project_task` to keep the project's plan organized. New apps: read topic `frontend` before generating code. Select an approved app type (list_app_types / recommend_app_type), create in Dev with create_app or appshare create --type, and persist app_type plus app_type_reason. Existing app metadata records the stack to preserve. The installable mobile PWA requires connection and has no offline mode. ## Rules that always apply Critical routing rule: if you are working inside an AppShare project (`project_id`, `publish_app`, `list_project_apps`, project visibility such as `company`), skip `/api/v1/publish` for file updates. `/api/v1/publish` creates new account-owned apps only. Existing project app files are overwritten or added with JSON `POST /api/v1/projects//apps//files?environment=`. Large or generated files: if a file is more than ~8 KB or is machine-generated, do not put its contents in MCP tool arguments; upload it from the shell, which reads it off disk (topic `publishing`). Tables, storage, email logs, secrets, LLM logs, jobs, functions, webhooks, webhook deliveries, audit logs, and project apps are isolated by `environment`. There are exactly two environments, `dev` and `prod` (aliases like `test`, `staging`, or `development` normalize to `dev`; empty or unknown values default to `prod`). Enforce permissions and business rules on the server (runtime policy, Project Functions), never only in page code (topic `access`). A read that fails (403, 404, 429) is not an empty table: stop any sync, delete or recompute step instead of acting on an empty list (topic `frontend`). Writes that belong together go in one `tables.batch([...])` call, which applies all of them or none, and concurrent edits use `ifVersion` (409 when the row changed) (topic `tables`); never chain separate writes that can stop half-way. Secrets are never returned by REST, UI, or MCP. ## Safety Never publish secrets, credentials, private keys, tokens, raw personal data, or confidential material unless the user explicitly instructs you and the visibility is appropriately restricted. ## Topics - `publishing` — Publishing and updating apps (`/llms/publishing.txt`). Read it for creating an app, uploading or changing its files (large files from the shell), React/Vite builds, visibility, promoting dev to prod, sharing JS/CSS between the apps of a project (the project library at `/f/{project}/_lib/`), GitHub sync, changelog. - `brand` — Organization Brand Style Guide & Assets (`/llms/brand.txt`). Read it to load the company's logos, `brand.css`, `STYLE_GUIDE.md`, and `/org-brand/{slug}/...` URLs (`get_organization_brand_guide`). - `node-packages` — Approved Node/npm Packages Policy (`/llms/node-packages.txt`). Read it to check which npm packages and CDN libraries are approved by the company (`get_organization_node_packages`, `check_organization_node_packages`). - `plan` — Project Plan: minimal Features & Tasks (`/llms/plan.txt`). Read it to check what the app does, break down user requests into plain-language features/tasks, and update progress (`get_project_plan`, `upsert_project_feature`, `upsert_project_task`). - `docs` — Project Documents: Folders, Markdown Editor & Attachments (`/llms/docs.txt`). Read team manuals/specs or write user documentation (`list_project_docs`, `get_project_doc`, `upsert_project_doc`). - `cli` — CLI (`appshare`) (`/llms/cli.txt`). Read it for installing and using the command-line tool: pull/push/sync of app folders, bulk table import/export, storage, locks, guide. - `mcp` — MCP (`/llms/mcp.txt`). Read it for connecting an agent through the remote MCP server and choosing project-aware tools. - `edit-locks` — App editing locks (`/llms/edit-locks.txt`). Read it for any write to an app or its settings from the CLI, MCP or REST (edit sessions, HTTP 423). - `frontend` — Building app pages: SDK, UI components and icons (`/llms/frontend.txt`). Read it for writing page code: `/sdk/appshare.js`, sign-in and runtime roles in the page, Bootstrap/React lanes, `as-app-list`, `as-document-control`, icons. - `access` — Access control: runtime policies, app policies and teams (`/llms/access.txt`). Read it for who can read or write what: runtime roles, row filters (including membership sets read from a project table with `$in_table`), per-app policies, assignments, teams, owner preview. - `tables` — Tables and bulk import (`/llms/tables.txt`). Read it for table schemas, unique keys, row history (`x-history`, `as_of`), personal tables, PII, atomic multi-table batches, row versions (409 on stale updates), delete by filter, loading many rows (`table_import` from CSV, JSON or Excel, aliases, number and date formats, array/object columns, permissions, limits). - `data-queries` — Data queries and report correctness (`/llms/data-queries.txt`). Read it for dashboards and reports: aggregates, paginated reads, saved queries, keeping report semantics when optimizing. - `functions-jobs` — Project Functions, jobs and webhooks (`/llms/functions-jobs.txt`). Read it for server-side logic, asynchronous and recurring jobs, webhooks. - `realtime-triggers` — Realtime SSE, Internal Event Triggers & Storage File Tokens (`/llms/realtime-triggers.txt`). Read it for live UI updates (`client.realtime().subscribe(...)`), event-driven Project Functions (`tables..create`, `storage..upload`), signed temporary file links (`createToken`), and on-the-fly image resizing (`?w=400`). - `email` — Project email (`/llms/email.txt`). Read it for sending email from an app or a function (`ctx.email.enqueue`, HTML, sender name, limits). - `llm` — LLM proxy (`/llms/llm.txt`). Read it for calling a language model from a page or a function (`llm().generate`, `ctx.llm`, tiers, structured output). - `connectors` — Connectors (`/llms/connectors.txt`). Read it for org-level integrations such as HR, company data (apiempresas) or an external PostgreSQL database: project grants, the response cache and upstream errors. - `comments-site` — Comments, questions, glossary and project site (`/llms/comments-site.txt`). Read it for reader comments, @mentions, questions, glossary tooltips, the project toolbar and landing page. - `quality` — Source-code auditing and app quality (`/llms/quality.txt`). Read it for code audits and the asynchronous spelling/accessibility check. - `accounts` — Accounts, roles, API keys and administration (`/llms/accounts.txt`). Read it for global roles, getting keys, project API key scopes, deleting a project, global admin access. - `employee-calendars` — Microsoft 365 employee calendars (`/llms/employee-calendars.txt`). Read it for writing a person's Outlook calendar (`ctx.calendar`). Page code: `/llms-bootstrap.txt` is the default lane (HTML, vanilla JS, Bootstrap 5 and the appshare SDK); `/llms-react.txt` is only for advanced mini apps (topic `frontend`).