feat(iteration): implement sdk v1 miniapp runtime loop

This commit is contained in:
2026-08-05 18:30:29 +08:00
parent 486280bec0
commit d2a2fd0aff
37 changed files with 2135 additions and 60 deletions
@@ -0,0 +1,58 @@
import type { MiniAppManifestV1 } from "@/runtime/app-management/miniapp-manifest";
/** The two bundled SDK reference manifests shipped by the Host in SDK v1. */
export const TASK_DASHBOARD_MANIFEST: MiniAppManifestV1 = {
app_scope: "task-dashboard",
version: "1.0.0",
kind: "bundled",
subscriptions: ["lineup.v1.app.call", "lineup.v1.tool.call", "lineup.v1.text"],
requested_capabilities: [],
host: { min_version: "1.0.0", surface_required: true },
tools: [
{
id: "task.create",
version: 1,
handling: "operation",
target: { app_scope: "task-dashboard", requires_foreground: true, restore_previous_focus: true },
input_schema: { type: "object", required: ["title"], properties: { title: { type: "string", minLength: 1, maxLength: 200 } }, additionalProperties: false },
output_schema: { type: "object", required: ["task_id"], properties: { task_id: { type: "string", minLength: 1 } }, additionalProperties: false },
},
{
id: "task.list",
version: 1,
handling: "direct",
target: { app_scope: "task-dashboard", requires_foreground: false, restore_previous_focus: false },
input_schema: { type: "object", additionalProperties: false },
output_schema: { type: "object" },
},
],
};
export const WHITEBOARD_MANIFEST: MiniAppManifestV1 = {
app_scope: "whiteboard",
version: "1.0.0",
kind: "bundled",
subscriptions: ["lineup.v1.ui.open", "lineup.v1.ui.patch", "lineup.v1.ui.close", "lineup.v1.artifact.offer"],
requested_capabilities: [],
host: { min_version: "1.0.0", surface_required: true },
tools: [
{
id: "whiteboard.open",
version: 1,
handling: "launch",
target: { app_scope: "whiteboard", requires_foreground: true, restore_previous_focus: true },
input_schema: { type: "object", additionalProperties: false },
output_schema: { type: "object" },
},
{
id: "whiteboard.export",
version: 1,
handling: "operation",
target: { app_scope: "whiteboard", requires_foreground: true, restore_previous_focus: true },
input_schema: { type: "object", additionalProperties: false },
output_schema: { type: "object", required: ["artifact_id"], properties: { artifact_id: { type: "string", minLength: 1 } }, additionalProperties: false },
},
],
};
export const BUNDLED_REFERENCE_MANIFESTS: readonly MiniAppManifestV1[] = [TASK_DASHBOARD_MANIFEST, WHITEBOARD_MANIFEST];