feat(iteration): implement sdk v1 miniapp runtime loop
This commit is contained in:
@@ -6,11 +6,11 @@
|
||||
*/
|
||||
import type { CapabilityDefinition } from "@/runtime/capabilities/capability-registry";
|
||||
import type { SurfaceRegistrySnapshot } from "@/runtime/surfaces/surface-registry";
|
||||
import type { CoreAppRecord } from "@/runtime/app-management/app-registry";
|
||||
import type { CoreAppRecordInput } from "@/runtime/app-management/app-registry";
|
||||
|
||||
export type ClientInventory = Readonly<{
|
||||
revision: string;
|
||||
standard_components: readonly Readonly<{ id: "choice" | "confirm" | "input"; version: "1" }>[];
|
||||
standard_components: readonly Readonly<{ id: "notice" | "choice" | "confirm" | "input"; version: "1" }>[];
|
||||
applications: readonly Readonly<{
|
||||
id: string;
|
||||
version: string;
|
||||
@@ -31,7 +31,7 @@ export class ClientInventoryPublisher {
|
||||
private previousFingerprint = "";
|
||||
private current: ClientInventory | undefined;
|
||||
|
||||
public sync(surfaces: SurfaceRegistrySnapshot, capabilities: readonly CapabilityDefinition[], apps: readonly CoreAppRecord[] = []): { changed: boolean; inventory: ClientInventory } {
|
||||
public sync(surfaces: SurfaceRegistrySnapshot, capabilities: readonly CapabilityDefinition[], apps: readonly CoreAppRecordInput[] = []): { changed: boolean; inventory: ClientInventory } {
|
||||
const surfaceApplications = surfaces.enabled
|
||||
.map(enabled => ({ id: enabled.app_id, version: enabled.version, surfaces: [{ id: "task-dashboard" as const, events: ["cancel"] as ["cancel"] }] }))
|
||||
const manifestApplications = apps.filter(app => app.enabled).map(app => ({
|
||||
@@ -50,6 +50,7 @@ export class ClientInventoryPublisher {
|
||||
this.current = {
|
||||
revision: `catalog-${this.revision}`,
|
||||
standard_components: [
|
||||
{ id: "notice", version: "1" },
|
||||
{ id: "choice", version: "1" },
|
||||
{ id: "confirm", version: "1" },
|
||||
{ id: "input", version: "1" },
|
||||
|
||||
Reference in New Issue
Block a user