The micro-VM for AI agents — light enough to embed on your laptop, elastic enough to power an agentic cloud.
fix(apps): show Applet operations in Swagger and link the public agent guide (#3285)
Ricky Chinecd11eb59787
diff --git a/.github/workflows/e2e-cloud.yml b/.github/workflows/e2e-cloud.ymlindex e46cd2e9d..3d3d20119 100644--- a/.github/workflows/e2e-cloud.yml+++ b/.github/workflows/e2e-cloud.yml@@ -537,7 +537,9 @@ jobs:run: bash scripts/ci/install-e2e-release.sh python- name: Install pytest dependencies- run: pip install --break-system-packages --quiet pytest pytest-asyncio pytest-timeout greenlet+ run: >-+ pip install --break-system-packages --quiet+ pytest pytest-asyncio pytest-timeout greenlet playwright==1.58.0 pyyaml# ── Run pytest ───────────────────────────────────────────────# --ignore rationale:@@ -610,6 +612,7 @@ jobs:BOXLITE_E2E_QUICKSTART: ${{ (inputs.stage || 'dev') == 'dev' && '1' || '0' }}BOXLITE_E2E_DOMAIN: ${{ (inputs.stage || 'dev') == 'dev' && vars.BOXLITE_E2E_DOMAIN || '' }}PYTEST_ADDOPTS: >-+ cloud/test_swagger.py--ignore=cases/test_c_entry.py --ignore=cases/test_c_coverage.py--ignore=cases/test_go_entry.py --ignore=cases/test_go_coverage.py--ignore=cases/test_node_entry.py --ignore=cases/test_exec_timeout.pydiff --git a/apps/api/Dockerfile b/apps/api/Dockerfileindex 6d961f382..0138cd273 100644--- a/apps/api/Dockerfile+++ b/apps/api/Dockerfile@@ -45,7 +45,7 @@ COPY apps/libs/ci-listener/ libs/ci-listener/COPY apps/libs/runner-api-client/ libs/runner-api-client/COPY apps/libs/api-client/ libs/api-client/COPY apps/libs/analytics-api-client/ libs/analytics-api-client/-# Bundle the platform contracts and the downloadable hosted Apps document.+# Bundle the contracts used by the platform API.COPY openapi/box.openapi.yaml openapi/admin.openapi.yaml openapi/apps.openapi.yaml ../openapi/COPY apps/libs/cloud-app-shared/ libs/cloud-app-shared/diff --git a/apps/api/src/cloud-app/agent/prompt-template.md b/apps/api/src/cloud-app/agent/prompt-template.mdindex fb131324f..af64cc769 100644--- a/apps/api/src/cloud-app/agent/prompt-template.md+++ b/apps/api/src/cloud-app/agent/prompt-template.md@@ -1,4 +1,4 @@-You are building an app on BoxLite Cloud. First read {{AGENT_URL}} and follow it exactly.+Read the Applet agent guide at {{AGENT_URL}} before building and deploying this app on BoxLite.export BOXLITE_API_URL={{API_URL}}App: {{APP}}diff --git a/apps/api/src/cloud-app/engine/console-prompt.spec.ts b/apps/api/src/cloud-app/engine/console-prompt.spec.tsindex d851c91e3..f480358fd 100644--- a/apps/api/src/cloud-app/engine/console-prompt.spec.ts+++ b/apps/api/src/cloud-app/engine/console-prompt.spec.ts@@ -12,6 +12,7 @@ describe('App handoff', () => {artifactUrl: 'https://artifacts.example.test/1',}const prompt = handoffPrompt({ config }, 'shop', 'staging')+ expect(prompt).toContain('https://boxlite.ai/agent.applet.md')expect(prompt).toContain('boxlite auth login --url https://api.example.test/api')expect(prompt).toContain('boxlite auth login --url https://api.example.test/api --method api-key')expect(prompt).toContain('export BOXLITE_API_URL=https://api.example.test/api/v1/org-a')diff --git a/apps/api/src/cloud-app/engine/console-prompt.ts b/apps/api/src/cloud-app/engine/console-prompt.tsindex 653114e54..996c55895 100644--- a/apps/api/src/cloud-app/engine/console-prompt.ts+++ b/apps/api/src/cloud-app/engine/console-prompt.ts@@ -3,9 +3,9 @@ import { existsSync, readFileSync } from 'node:fs'import { dirname, join } from 'node:path'import type { Config } from './config'-type PromptContext = { config: Pick<Config, 'promptTemplatePath' | 'agentMdPath' | 'managementUrl' | 'artifactUrl'> }+type PromptContext = { config: Pick<Config, 'promptTemplatePath' | 'agentMdPath' | 'managementUrl'> }-const FALLBACK_TEMPLATE = `You are building an app on BoxLite Cloud. First read {{AGENT_URL}} and follow it exactly.+const FALLBACK_TEMPLATE = `Read the Applet agent guide at {{AGENT_URL}} before building and deploying this app on BoxLite.export BOXLITE_API_URL={{API_URL}}App: {{APP}}@@ -27,7 +27,7 @@ export function handoffPrompt(ctx: PromptContext, app: string, env = 'main'): stpromptTemplate(ctx).replaceAll('{{API_URL}}', ctx.config.managementUrl).replaceAll('{{SERVER_URL}}', new URL('..', ctx.config.managementUrl).href.replace(/\/$/, ''))- .replaceAll('{{AGENT_URL}}', ctx.config.artifactUrl + '/agent.md')+ .replaceAll('{{AGENT_URL}}', 'https://boxlite.ai/agent.applet.md').replaceAll('{{APP}}', app).replaceAll('{{ENV}}', env).replace(/^.*\{\{REQUEST\}\}.*$/m, 'What I want: (tell your agent here)')diff --git a/apps/api/src/main.spec.ts b/apps/api/src/main.spec.tsindex 4ebe8ce4f..2ea9ee676 100644--- a/apps/api/src/main.spec.ts+++ b/apps/api/src/main.spec.ts@@ -6,7 +6,6 @@import type { NestFactory } from '@nestjs/core'import express from 'express'-import type { AddressInfo } from 'node:net'import { EventEmitter } from 'node:events'import { join } from 'node:path'@@ -23,7 +22,7 @@ jest.mock('typeorm', () => ({ DataSource: class {}, MigrationExecutor: class {}jest.mock('kafkajs', () => ({ Partitioners: {} }))jest.mock('nestjs-pino', () => ({ Logger: class {}, LoggerErrorInterceptor: jest.fn() }))jest.mock('@nestjs/swagger', () => ({- SwaggerModule: { createDocument: jest.fn(() => ({})), setup: jest.fn() },+ SwaggerModule: { createDocument: jest.fn(() => ({ paths: {} })), setup: jest.fn() },}))jest.mock('node:fs', () => ({ readFileSync: jest.fn(() => '{}') }))jest.mock('./config/typed-config.service', () => ({ TypedConfigService: class {} }))@@ -125,20 +124,13 @@ describe('API bootstrap listener', () => {exclude: ['internal/v1/credentials/introspect'],})const { SwaggerModule } = require('@nestjs/swagger') as typeof import('@nestjs/swagger')- expect(SwaggerModule.setup).toHaveBeenCalledWith(- 'api',- app,- expect.any(Function),- expect.objectContaining({- explorer: true,- swaggerOptions: expect.objectContaining({- urls: [- { name: 'BoxLite platform', url: '/api-json' },- { name: 'Hosted Apps', url: '/api/apps.openapi.yaml' },- ],- }),- }),- )+ const [mount, , document, options] = jest.mocked(SwaggerModule.setup).mock.calls[0]+ expect(mount).toBe('api')+ expect(options).not.toHaveProperty('explorer')+ expect(options.swaggerOptions).not.toHaveProperty('urls')+ const swagger = typeof document === 'function' ? document() : document+ expect(swagger.paths['/api/v1/{organizationId}/apps'].get.tags).toEqual(['Applet'])+ expect(service.register).toHaveBeenCalledWith(expect.objectContaining({ dashboard: { paths: {} } }))const socket = { end: jest.fn(), destroy: jest.fn() }const head = Buffer.from('upgrade head')const connect = { url: '/api/v1/org/apps/demo/envs/main/db/connect' }@@ -163,16 +155,6 @@ describe('API bootstrap listener', () => {} else {expect(readFileSync).toHaveBeenCalledWith(expect.stringContaining('/assets/openapi/box.openapi.yaml'), 'utf8')}- const server = router.listen(0, '127.0.0.1')- try {- await new Promise<void>((resolve, reject) => server.once('listening', resolve).once('error', reject))- const { port } = server.address() as AddressInfo- const response = await fetch(`http://127.0.0.1:${port}/api/apps.openapi.yaml`)- expect(response.status).toBe(200)- expect(response.headers.get('content-type')).toContain('application/yaml')- expect(await response.text()).toBe(expected)- } finally {- await new Promise<void>((resolve, reject) => server.close((err) => (err ? reject(err) : resolve())))- }+ expect(router.router.stack.map((layer) => layer.route?.path)).not.toContain('/api/apps.openapi.yaml')})})diff --git a/apps/api/src/main.ts b/apps/api/src/main.tsindex cca54db8a..9c64212a2 100644--- a/apps/api/src/main.ts+++ b/apps/api/src/main.ts@@ -23,6 +23,7 @@ import { TypedConfigService } from './config/typed-config.service'import { FailedAuthTrackerService } from './auth/failed-auth-tracker.service'import { DataSource, MigrationExecutor } from 'typeorm'import { getOpenApiConfig } from './openapi.config'+import { setupPlatformSwagger } from './platform-swagger'import { AuditInterceptor } from './audit/interceptors/audit.interceptor'import { extname, join } from 'node:path'import { ApiKeyService } from './api-key/api-key.service'@@ -153,26 +154,15 @@ async function bootstrap() {const globalPrefix = 'api'app.setGlobalPrefix(globalPrefix, { exclude: [...MCP_ROOT_ROUTES, SECRET_CREDENTIAL_PATH] })- // Built once: the Swagger UI serves it, and the MCP catalog reads the dashboard routes from it.+ // MCP uses the scanned controller routes; Swagger also documents the Applet contract.const document = SwaggerModule.createDocument(app, getOpenApiConfig(configService.get('oidc.issuer')))- const appsDocumentUrl = '/api/apps.openapi.yaml'- SwaggerModule.setup('api', app, () => document, {- explorer: true,- swaggerOptions: {- urls: [- { name: 'BoxLite platform', url: '/api-json' },- { name: 'Hosted Apps', url: appsDocumentUrl },- ],- initOAuth: {- clientId: configService.get('oidc.clientId'),- appName: 'BoxLite AI',- scopes: ['openid', 'profile', 'email'],- additionalQueryStringParams: {- audience: configService.get('oidc.audience'),- },- },- },- })+ const specDirectory = process.env.BOXLITE_OPENAPI_DIR || join(__dirname, 'assets', 'openapi')+ setupPlatformSwagger(+ app,+ document,+ { clientId: configService.get('oidc.clientId'), audience: configService.get('oidc.audience') },+ specDirectory,+ )// Replace dashboard api url before servingif (configService.get('production')) {@@ -207,12 +197,6 @@ async function bootstrap() {const port = configService.get('port')if (isApiEnabled()) {- const specDirectory = process.env.BOXLITE_OPENAPI_DIR || join(__dirname, 'assets', 'openapi')- const appsDocument = readFileSync(join(specDirectory, 'apps.openapi.yaml'), 'utf8')- app- .getHttpAdapter()- .getInstance()- .get(appsDocumentUrl, (_req, res) => res.type('application/yaml').send(appsDocument))// MCP tools come from the v1 specs (bundled as assets) and the dashboard document,// limited to the routes this app registered, so init() runs first.await app.init()diff --git a/apps/api/src/platform-swagger.integration.spec.ts b/apps/api/src/platform-swagger.integration.spec.tsnew file mode 100644index 000000000..16c0ba154--- /dev/null+++ b/apps/api/src/platform-swagger.integration.spec.ts@@ -0,0 +1,121 @@+/*+ * Copyright 2026 BoxLite AI+ * SPDX-License-Identifier: AGPL-3.0+ */++import { Controller, Get, INestApplication } from '@nestjs/common'+import { ApiTags, OpenAPIObject, SwaggerModule } from '@nestjs/swagger'+import { Test } from '@nestjs/testing'+import Ajv from 'ajv'+import { readFileSync } from 'node:fs'+import { join, resolve } from 'node:path'+import { parse } from 'yaml'+import { getOpenApiConfig } from './openapi.config'+import { setupPlatformSwagger } from './platform-swagger'++@ApiTags('box')+@Controller('box')+class BoxController {+ @Get('paginated')+ boxes() {+ return []+ }+}++@ApiTags('volumes')+@Controller('volumes')+class VolumeController {+ @Get()+ volumes() {+ return []+ }+}++const specDirectory = resolve(__dirname, '../../../openapi')+const apps: OpenAPIObject = parse(readFileSync(join(specDirectory, 'apps.openapi.yaml'), 'utf8'))+const prefix = '/api/v1/{organizationId}'++describe('platform Swagger HTTP endpoints', () => {+ let app: INestApplication+ let base: string+ let original: OpenAPIObject+ let document: ReturnType<typeof parse>++ beforeAll(async () => {+ const module = await Test.createTestingModule({ controllers: [BoxController, VolumeController] }).compile()+ app = module.createNestApplication()+ app.setGlobalPrefix('api')+ const dashboard = SwaggerModule.createDocument(app, getOpenApiConfig('https://issuer.example'))+ original = JSON.parse(JSON.stringify(dashboard))+ setupPlatformSwagger(app, dashboard, { clientId: 'test-client', audience: 'test-audience' }, specDirectory)+ await app.listen(0, '127.0.0.1')+ base = await app.getUrl()+ document = await (await fetch(base + '/api-json')).json()+ expect(dashboard).toEqual(original)+ })++ afterAll(async () => app?.close())++ it('serves one document in Swagger UI, JSON and YAML alongside the existing groups', async () => {+ expect(document.openapi).toBe(original.openapi)+ expect(document.paths).toMatchObject(original.paths)+ expect(document.servers).toEqual(original.servers)+ expect(document.components.securitySchemes).toMatchObject(original.components.securitySchemes)+ expect(parse(await (await fetch(base + '/api-yaml')).text())).toEqual(document)+ const html = await (await fetch(base + '/api')).text()+ expect(html).toContain('swagger-ui-init.js')+ const init = await (await fetch(base + '/api/swagger-ui-init.js')).text()+ expect(init).toMatch(/"operationId"\s*:\s*"listApps"/)+ expect(init).not.toMatch(/"urls"\s*:/)+ expect(init).toContain('test-client')+ expect(init).toContain('test-audience')+ expect((await fetch(base + '/api/apps.openapi.yaml')).status).toBe(404)+ })++ it('publishes every CLI operation under Applet with its organization, credentials and same-origin URL', () => {+ for (const [path, item] of Object.entries(apps.paths)) {+ const published = document.paths[prefix + path]+ for (const [method, source] of Object.entries(item)) {+ if (!source.operationId) continue+ const op = published[method]+ expect(op).toMatchObject({+ operationId: source.operationId,+ tags: ['Applet'],+ security: apps.security,+ 'x-permissions': source['x-permissions'],+ })+ const server = (op.servers ?? published.servers ?? document.servers)[0]+ expect(new URL(server.url, base).href).toBe(base + '/')+ const parameters = [...(published.parameters ?? []), ...(op.parameters ?? [])].map((param) =>+ param.$ref ? document.components.parameters[param.$ref.split('/').pop()] : param,+ )+ for (const [, name] of (prefix + path).matchAll(/\{([^}]+)\}/g)) {+ expect(parameters).toContainEqual(expect.objectContaining({ name, in: 'path', required: true }))+ }+ }+ }+ for (const [, ref] of JSON.stringify(document).matchAll(/"\$ref":"([^"]+)"/g)) {+ expect(ref).toMatch(/^#\//)+ expect(document).toHaveProperty(ref.slice(2).split('/'))+ }+ })++ it('represents nullable responses, manifest alternatives and deployment kinds in OpenAPI 3.0', () => {+ expect(document.openapi).toMatch(/^3\.0\./)+ const list = document.paths[prefix + '/apps'].get.responses['200'].content['application/json'].schema+ const submit = document.paths[prefix + '/apps/{app}/envs/{env}/deployments'].post.requestBody+ const ajv = new Ajv({ strict: false, validateFormats: false })+ const validateList = ajv.compile({ ...list, components: document.components })+ expect(validateList([{ id: 'a', name: 'demo', status: 'ready', url: null }])).toBe(true)+ expect(validateList([{ id: 'a', name: 'demo', status: 'ready', url: 42 }])).toBe(false)+ const validateDeployment = ajv.compile({+ ...submit.content['application/json'].schema,+ components: document.components,+ })+ expect(validateDeployment({ kind: 'deploy', manifest: 'app = "demo"', snapshot_id: 's' })).toBe(true)+ expect(validateDeployment({ kind: 'apply', manifest: { services: [{ name: 'web' }] } })).toBe(true)+ expect(validateDeployment({ kind: 'apply', manifest: { services: [{}] } })).toBe(false)+ expect(validateDeployment({ kind: 'deploy', manifest: {} })).toBe(false)+ expect(JSON.stringify(document)).not.toMatch(/"const":|"type":\[/)+ })+})diff --git a/apps/api/src/platform-swagger.ts b/apps/api/src/platform-swagger.tsnew file mode 100644index 000000000..ed6edc232--- /dev/null+++ b/apps/api/src/platform-swagger.ts@@ -0,0 +1,76 @@+/*+ * Copyright 2026 BoxLite AI+ * SPDX-License-Identifier: AGPL-3.0+ */++import type { INestApplication } from '@nestjs/common'+import { SwaggerModule, type OpenAPIObject } from '@nestjs/swagger'+import { readFileSync } from 'node:fs'+import { join } from 'node:path'+import { parse } from 'yaml'++// The Applet contract uses OpenAPI 3.1. Keep its schema constraints when+// rendering it in the platform's OpenAPI 3.0 document.+function platformSchema(_key: unknown, value: unknown): unknown {+ if (!value || typeof value !== 'object') return value+ const schema = value as Record<string, unknown>+ if ('const' in schema) {+ const { const: literal, ...rest } = schema+ return { ...rest, enum: [literal] }+ }+ if (!Array.isArray(schema.type)) return value+ const { type, ...rest } = schema+ if (type.includes('null')) return { ...rest, type: type.find((item) => item !== 'null'), nullable: true }+ // A manifest accepts either TOML text or the documented object.+ const { properties, ...metadata } = rest+ return { ...metadata, oneOf: type.map((item) => (item === 'object' ? { type: item, properties } : { type: item })) }+}++function withApplets(platform: OpenAPIObject, specDirectory: string): OpenAPIObject {+ const apps: OpenAPIObject = parse(readFileSync(join(specDirectory, 'apps.openapi.yaml'), 'utf8'), platformSchema)+ const paths = { ...platform.paths }+ for (const [path, item] of Object.entries(apps.paths)) {+ for (const operation of Object.values(item)) {+ if (operation.operationId) {+ operation.tags = ['Applet']+ operation.security = apps.security+ }+ }+ paths[apps.servers[0].url + path] = {+ ...item,+ servers: [{ url: '/' }],+ parameters: [+ { name: 'organizationId', in: 'path', required: true, schema: { type: 'string' } },+ ...(item.parameters ?? []),+ ],+ }+ }+ return {+ ...platform,+ paths,+ components: {+ ...platform.components,+ parameters: { ...platform.components?.parameters, ...apps.components.parameters },+ responses: { ...platform.components?.responses, ...apps.components.responses },+ schemas: { ...platform.components?.schemas, ...apps.components.schemas },+ },+ }+}++export function setupPlatformSwagger(+ app: INestApplication,+ document: OpenAPIObject,+ oauth: { clientId: string; audience: string },+ specDirectory: string,+) {+ SwaggerModule.setup('api', app, () => withApplets(document, specDirectory), {+ swaggerOptions: {+ initOAuth: {+ clientId: oauth.clientId,+ appName: 'BoxLite AI',+ scopes: ['openid', 'profile', 'email'],+ additionalQueryStringParams: { audience: oauth.audience },+ },+ },+ })+}diff --git a/apps/api/test/production-metadata.cjs b/apps/api/test/production-metadata.cjsindex 125369260..4b25ee490 100644--- a/apps/api/test/production-metadata.cjs+++ b/apps/api/test/production-metadata.cjs@@ -6,11 +6,10 @@ const { readFileSync } = require('node:fs')const { join } = require('node:path')const { test } = require('node:test')const { Socket } = require('node:net')-const { join } = require('node:path')const { NestFactory } = require('@nestjs/core')const { DataSource, getMetadataArgsStorage } = require('typeorm')-test('the API package contains the downloadable hosted Apps contract', () => {+test('the API package contains the Applet contract used by Swagger', () => {const shipped = readFileSync(join(__dirname, '../../dist/apps/api/assets/openapi/apps.openapi.yaml'))assert.deepEqual(shipped, readFileSync(join(__dirname, '../../../openapi/apps.openapi.yaml')))})diff --git a/apps/dashboard/app-hosting-ui.md b/apps/dashboard/app-hosting-ui.mdindex 7a97c4b3a..254bc5e9b 100644--- a/apps/dashboard/app-hosting-ui.md+++ b/apps/dashboard/app-hosting-ui.md@@ -47,7 +47,8 @@ preview region. Card links open details; open-app and menu actions are independeThe creation dialog explains the next step: getting setup instructions for yourcoding agent. CLI commands belong in the app overview’s handoff instructions.After creating an app, copy the instructions from its overview into your coding-agent. The instructions select the App and environment for `boxlite app deploy`.+agent. The prompt includes the [Applet agent guide](https://boxlite.ai/agent.applet.md)+and selects the App and environment for `boxlite app deploy`.The first healthy deployment publishes a stable preview URL with a generated hostname.diff --git a/apps/dashboard/src/components/apps/AgentHandoffPanel.tsx b/apps/dashboard/src/components/apps/AgentHandoffPanel.tsxindex 695d0c716..3dbac90a1 100644--- a/apps/dashboard/src/components/apps/AgentHandoffPanel.tsx+++ b/apps/dashboard/src/components/apps/AgentHandoffPanel.tsx@@ -8,7 +8,7 @@ import type { AppDetail } from '@/lib/apps/types'import { useState } from 'react'import { Link } from 'react-router-dom'import { AgentLogos } from './AgentLogos'-import { PromptBlock, SectionTitle } from './spec'+import { AppletAgentGuideLink, PromptBlock, SectionTitle } from './spec'import { ToolButton } from './SubNav'export function AgentHandoffPanel({ app }: { app: AppDetail }) {@@ -40,7 +40,8 @@ export function AgentHandoffPanel({ app }: { app: AppDetail }) {<div className="space-y-2"><h3 className="font-medium">2. {draft ? 'Start building' : 'Keep building'}</h3><p className="text-muted-foreground">- Copy the prompt to your agent and tell it what you want to {draft ? 'build' : 'change'}.+ The prompt includes the <AppletAgentGuideLink />. Copy it to your coding agent and describe what you want+ to {draft ? 'build' : 'change'}.</p><PromptBlock text={app.handoffPrompt} compact={!draft} /></div>diff --git a/apps/dashboard/src/components/apps/AppHostingAccess.tsx b/apps/dashboard/src/components/apps/AppHostingAccess.tsxindex b6ea94817..d10f3328f 100644--- a/apps/dashboard/src/components/apps/AppHostingAccess.tsx+++ b/apps/dashboard/src/components/apps/AppHostingAccess.tsx@@ -6,6 +6,7 @@ import { httpStatusOf } from '@/lib/apps/client'import { useMutation } from '@tanstack/react-query'import { AgentLogos } from './AgentLogos'import { AppHostingIllustration } from './AppHostingIllustration'+import { AppletAgentGuideLink } from './spec'export function AppHostingAccess({ organizationId }: { organizationId: string }) {const api = useApi()@@ -25,7 +26,7 @@ export function AppHostingAccess({ organizationId }: { organizationId: string })<div className="max-w-lg space-y-3"><h2 className="font-display text-section font-semibold">From insight to a cloud app.</h2><p className="text-body leading-relaxed text-muted-foreground">- Bring an idea to your coding agent. Build it, deploy it, and let BoxLite keep it running.+ Share the <AppletAgentGuideLink /> with your coding agent to build and deploy your app on BoxLite.</p></div><div className="flex flex-wrap items-center justify-center gap-x-5 gap-y-3 py-2">diff --git a/apps/dashboard/src/components/apps/spec.tsx b/apps/dashboard/src/components/apps/spec.tsxindex 88edce3cb..f087f4243 100644--- a/apps/dashboard/src/components/apps/spec.tsx+++ b/apps/dashboard/src/components/apps/spec.tsx@@ -7,12 +7,21 @@ import { Check, ChevronRight, Copy, MoreHorizontal, Search } from '@/components/import { Button } from '@/components/ui/button'import { ResourceSectionHeading } from '@/components/ResourceLayout'import { Spinner } from '@/components/ui/spinner'+import { BOXLITE_APPLET_AGENT_GUIDE_URL } from '@/constants/ExternalLinks'import { cn } from '@/lib/utils'import { useAppsScope } from '@/lib/apps/client'import { forwardRef, useState, type ComponentPropsWithoutRef, type ReactNode } from 'react'export { Panel } from '@/components/ascii'+export function AppletAgentGuideLink() {+ return (+ <a href={BOXLITE_APPLET_AGENT_GUIDE_URL} target="_blank" rel="noreferrer" className="resource-guide-link">+ Applet agent guide+ </a>+ )+}+/** App sections share the same heading hierarchy as other Console resources. */export function SectionTitle({ title, count, right }: { title: string; count?: ReactNode; right?: ReactNode }) {return <ResourceSectionHeading title={title} count={count} right={right} />diff --git a/apps/dashboard/src/constants/ExternalLinks.ts b/apps/dashboard/src/constants/ExternalLinks.tsindex 2021e0231..703e47d3c 100644--- a/apps/dashboard/src/constants/ExternalLinks.ts+++ b/apps/dashboard/src/constants/ExternalLinks.ts@@ -13,6 +13,7 @@ export const BOXLITE_CUSTOM_IMAGE_DOCS_URL = 'https://docs.boxlite.ai/cloud/use-export const BOXLITE_VOLUMES_DOCS_URL = 'https://docs.boxlite.ai/cloud/volumes'export const BOXLITE_SUBSCRIPTION_DOCS_URL = 'https://docs.boxlite.ai/cloud/plans#the-plans'export const BOXLITE_SSH_DOCS_URL = 'https://docs.boxlite.ai/cloud/ssh'+export const BOXLITE_APPLET_AGENT_GUIDE_URL = 'https://boxlite.ai/agent.applet.md'export const BOXLITE_SLACK_URL = 'https://go.boxlite.ai/discord'export const BOXLITE_CONTACT_URL = 'https://boxlite.ai/contact'diff --git a/apps/dashboard/src/lib/apps/scope.test.tsx b/apps/dashboard/src/lib/apps/scope.test.tsxindex 1f2b2e6d6..cf23813ad 100644--- a/apps/dashboard/src/lib/apps/scope.test.tsx+++ b/apps/dashboard/src/lib/apps/scope.test.tsx@@ -194,6 +194,7 @@ describe('cloud App organization isolation', () => {expect(host.textContent).toContain('with permission to view and manage apps')expect(host.textContent).not.toContain('boxlite auth login')expect(host.querySelector('a[href="/dashboard/keys"]')?.textContent).toBe('API Keys')+ expect(host.querySelector('a[href="https://boxlite.ai/agent.applet.md"]')?.textContent).toBe('Applet agent guide')const copy = [...host.querySelectorAll('button')].find((button) => button.textContent === 'Copy')expect(copy).toBeDefined()act(() => copy!.click())@@ -377,6 +378,7 @@ describe('cloud App organization isolation', () => {path,)expect(host.querySelector('h1')?.textContent).toBe('Applet')+ expect(host.querySelector('a[href="https://boxlite.ai/agent.applet.md"]')?.textContent).toBe('Applet agent guide')expect(host.textContent).toContain('From insight to a cloud app.')expect(host.textContent).toContain('experimental feature')expect(host.textContent).toContain('the BoxLite team will contact you by email')diff --git a/apps/dashboard/src/lib/apps/urls.test.tsx b/apps/dashboard/src/lib/apps/urls.test.tsxindex 82b18f3f8..f4a2437b0 100644--- a/apps/dashboard/src/lib/apps/urls.test.tsx+++ b/apps/dashboard/src/lib/apps/urls.test.tsx@@ -172,6 +172,8 @@ describe('cloud App URL availability', () => {render()await settled()expect(host.querySelector('h1')?.textContent).toBe('Applet')+ const guide = host.querySelector('header a[href="https://boxlite.ai/agent.applet.md"]')+ expect(guide?.textContent).toBe('Applet agent guide')expect(host.textContent).toContain('New app')const link = host.querySelector<HTMLAnchorElement>('a[aria-label="Open demo"]')!expect(link.getAttribute('href')).toBe('/dashboard/apps/demo')diff --git a/apps/dashboard/src/mocks/cloud-app-handlers.test.ts b/apps/dashboard/src/mocks/cloud-app-handlers.test.tsindex ce2fa53d7..67d0f6b4f 100644--- a/apps/dashboard/src/mocks/cloud-app-handlers.test.ts+++ b/apps/dashboard/src/mocks/cloud-app-handlers.test.ts@@ -34,6 +34,7 @@ describe('Apps mock preview', () => {it('creates a draft and returns it in the list without issuing credentials', async () => {const { data } = await client.post<CreatedApp>('/apps', { name: 'preview-created' })expect(data.app.status).toBe('draft')+ expect(data.app.handoffPrompt).toContain('https://boxlite.ai/agent.applet.md')expect(data.app.handoffPrompt).toContain('boxlite auth login --url https://api.example.test/api --method api-key')expect(data.app.handoffPrompt).toContain('boxlite app init --app preview-created --env main')expect(data).not.toHaveProperty('key')diff --git a/apps/dashboard/src/mocks/cloud-app-handlers.ts b/apps/dashboard/src/mocks/cloud-app-handlers.tsindex dd8c6c7f0..6eaa6051d 100644--- a/apps/dashboard/src/mocks/cloud-app-handlers.ts+++ b/apps/dashboard/src/mocks/cloud-app-handlers.ts@@ -1,6 +1,7 @@/* Copyright 2026 BoxLite AI · SPDX-License-Identifier: AGPL-3.0 */import { http, HttpResponse } from 'msw'+import { BOXLITE_APPLET_AGENT_GUIDE_URL } from '@/constants/ExternalLinks'import { nameProblem } from '@/lib/apps/format'import type { AppDetail, AppRelease } from '@/lib/apps/types'import { MOCK_ORGANIZATION_ID } from './fixtures'@@ -40,7 +41,7 @@ function draftApp(name: string): AppDetail {metrics: null,preview: null,previewAttempt: null,- handoffPrompt: `Build ${name} with the BoxLite CLI.+ handoffPrompt: `Read the Applet agent guide at ${BOXLITE_APPLET_AGENT_GUIDE_URL} before building and deploying ${name} with the BoxLite CLI.Connect using an organization API key with Apps read and write permissions.Guide the user through boxlite auth login --url ${server} --method api-key and have them enter the key at the secure prompt.In the project directory, run BOXLITE_API_URL=${server}/v1/${MOCK_ORGANIZATION_ID} boxlite app init --app ${name} --env main.`,diff --git a/apps/dashboard/src/pages/Apps.tsx b/apps/dashboard/src/pages/Apps.tsxindex 1ddf19193..9bce6dbf5 100644--- a/apps/dashboard/src/pages/Apps.tsx+++ b/apps/dashboard/src/pages/Apps.tsx@@ -10,7 +10,7 @@ import { CreateAppDialog } from '@/components/apps/CreateAppDialog'import { RecentlyDeleted } from '@/components/apps/RecentlyDeleted'import { OrganizationScope } from '@/components/apps/OrganizationScope'import { deleteAppBody, toastDeleted } from '@/components/apps/deleteCopy'-import { SearchField } from '@/components/apps/spec'+import { AppletAgentGuideLink, SearchField } from '@/components/apps/spec'import {AlertDialog,AlertDialogAction,@@ -69,7 +69,8 @@ const Apps: React.FC = () => {<header className="space-y-2"><h1 className="resource-title">Applet</h1><p className="text-body text-muted-foreground">- Applet is BoxLite’s app hosting platform. Build with your coding agent, and let BoxLite keep your apps running.+ Applet is BoxLite’s app hosting platform. Share the <AppletAgentGuideLink /> with your coding agent to build+ and deploy an app.</p></header>diff --git a/apps/e2e/README.md b/apps/e2e/README.mdindex a71e95d0e..28a0c2e20 100644--- a/apps/e2e/README.md+++ b/apps/e2e/README.md@@ -473,14 +473,25 @@ one particular instance name.## The cloud legs (CI)-`.github/workflows/e2e-cloud.yml` runs this suite against a deployed-stage. It is dispatch-only, plus one call from `deploy-infra.yml`:+`.github/workflows/e2e-cloud.yml` runs this suite against a deployed stage+on dispatch or when called by a deployment workflow.| Stage | Target | Selection | Sweep || --- | --- | --- | --- || `dev` | `api.dev.boxlite.ai` | everything | yes |+| `stage` | `api.stage.boxlite.ai` | main, identity and catalog suites | no || `prod` | `api.boxlite.ai` | `-m smoke` | no |+The cloud smoke suite opens the configured API homepage anonymously in Chrome+on dev, stage and prod. It checks that the default Swagger page displays the+box, volumes and Applet groups, opens without fetching a separate definition,+and publishes every Applet operation from `openapi/apps.openapi.yaml`. To run+just this case with Google Chrome, pytest, Playwright and PyYAML installed:++```bash+API_URL=https://api.stage.boxlite.ai python -m pytest apps/e2e/cloud/test_swagger.py+```+The workflow writes the selected stage's credentials to`~/.boxlite/credentials.toml` with mode `0600`. The workflow discovers each key'sorganization through `/v1/me` and reads its stored permission names throughdiff --git a/apps/e2e/cloud/test_swagger.py b/apps/e2e/cloud/test_swagger.pynew file mode 100644index 000000000..7aa2d4a26--- /dev/null+++ b/apps/e2e/cloud/test_swagger.py@@ -0,0 +1,49 @@+"""Check the anonymous Swagger homepage through the deployed stage's ingress."""+import os+from pathlib import Path+from urllib.parse import urlsplit++import pytest+import yaml+from playwright.sync_api import expect, sync_playwright+++def test_swagger_homepage_shows_applets_with_platform_operations():+ contract = Path(__file__).resolve().parents[3] / "openapi/apps.openapi.yaml"+ apps = yaml.safe_load(contract.read_text(encoding="utf-8"))+ prefix = apps["servers"][0]["url"]+ expected = {+ (prefix + path, method, operation["operationId"])+ for path, item in apps["paths"].items()+ for method, operation in item.items()+ if isinstance(operation, dict) and "operationId" in operation+ }++ with sync_playwright() as playwright:+ browser = playwright.chromium.launch(channel="chrome")+ page = browser.new_page()+ definition_requests = []++ def record_request(request):+ path = urlsplit(request.url).path+ if path.endswith(("/api-json", "/api-yaml", "/apps.openapi.yaml")):+ definition_requests.append(path)++ page.on("request", record_request)+ response = page.goto(os.environ["API_URL"])+ assert response.status == 200, f"Swagger homepage returned HTTP {response.status}"+ for tag in ("box", "volumes", "Applet"):+ expect(page.locator(f'h3[data-tag="{tag}"]')).to_be_visible()+ expect(page.locator(".topbar .download-url-wrapper")).to_be_hidden()+ expect(page.locator("#operations-Applet-listApps")).to_contain_text("/api/v1/{organizationId}/apps")+ assert not definition_requests, f"Swagger fetched separate definitions: {definition_requests}"++ paths = page.evaluate("window.ui.specSelectors.specJson().get('paths').toJS()")+ published = {+ (path, method, operation["operationId"])+ for path, item in paths.items()+ for method, operation in item.items()+ if isinstance(operation, dict) and "Applet" in operation.get("tags", [])+ }+ assert published == expecteddiff --git a/docs/contributing/architecture/platform/api.md b/docs/contributing/architecture/platform/api.mdindex ead9f0aab..bd825300c 100644--- a/docs/contributing/architecture/platform/api.md+++ b/docs/contributing/architecture/platform/api.md@@ -169,8 +169,8 @@ The [removal-release notes](../../../../apps/api/README.md#retired-cloud-operatiThe [hosted Apps OpenAPI document](../../../../openapi/apps.openapi.yaml) describes theorganization-scoped HTTP operations, deployment and log event streams, and PostgreSQL-WebSocket used by `boxlite app`. Each API server serves the contract at-`/api/apps.openapi.yaml`. Select **Hosted Apps** in the Swagger UI at `/api` to browse it.+WebSocket used by `boxlite app`. The platform Swagger UI at `/api` lists these+operations under **Applet**, alongside the box and volume operations.The Rust CLI’s private request builders travel with thecrate. Run `make generate:app-operations` after changing the contract. CI compares thebuilders with the document and checks each operation against its mounted API route and@@ -541,7 +541,7 @@ See [rotation ordering and recovery](../../../../apps/api/README.md#registry-cre</details><details>-<summary><b>Health and API documentation</b> · 6 routes</summary>+<summary><b>Health and API documentation</b> · 5 routes</summary>| Method | Path | What it does || ------ | ------------------- | ------------------------------------------------------------- |@@ -550,7 +550,6 @@ See [rotation ordering and recovery](../../../../apps/api/README.md#registry-cre| `GET` | `/api` | Serves the interactive Swagger UI. || `GET` | `/api-json` | Returns the generated product OpenAPI document as JSON. || `GET` | `/api-yaml` | Returns the generated product OpenAPI document as YAML. |-| `GET` | `/api/apps.openapi.yaml` | Downloads the hosted Apps OpenAPI contract as YAML. |</details>diff --git a/docs/reference/cli/app.md b/docs/reference/cli/app.mdindex 280ff7221..e6b54e7f7 100644--- a/docs/reference/cli/app.md+++ b/docs/reference/cli/app.md@@ -1,11 +1,12 @@# Hosted App commands-The [hosted Apps OpenAPI contract](../../../openapi/apps.openapi.yaml) describes these management requests. On your API server, open `/api` and select **Hosted Apps**, or download the YAML from `/api/apps.openapi.yaml`.-`boxlite app` deploys a local project to BoxLite Cloud and manages its environments.The installed BoxLite executable contains these commands. Use `boxlite app --help`for the command list or `boxlite app deploy --help` for the options on a specific command.+To browse the CLI’s management requests, open `/api` on your API server and expand+**Applet**. The CLI uses the [hosted Apps OpenAPI contract](../../../openapi/apps.openapi.yaml).+## Authenticate and select an AppSign in to the server named by the Dashboard handoff. A named context stores the