@assistant-ui/appos 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  export { compareVersions, parseVersion } from "./release";
2
- /** appos.actors: { Name: { main } }, the app's actors (01-spec/08-web-actors.md). */
3
- export type ActorsInfo = Record<string, {
2
+ /** appos.actors: { Name: { main } }, the app's LiveWorkers (01-spec/08-live-workers.md). */
3
+ export type LiveWorkersInfo = Record<string, {
4
4
  main: string;
5
5
  }>;
6
- /** The code a host runs for this app's actors: their one module and its classes. */
6
+ /** The code a host runs for this app's LiveWorkers: their one module and its classes. */
7
7
  export interface BackendInfo {
8
- /** The actors' module, a path inside the bundle ("board.js"). */
8
+ /** The LiveWorkers' module, a path inside the bundle ("board.js"). */
9
9
  main: string;
10
- /** The classes it exports, one per actor name. */
10
+ /** The classes it exports, one per LiveWorker name. */
11
11
  classes: string[];
12
12
  }
13
13
  /**
14
14
  * appos.server: one fetch handler (`export default { fetch }`) for the paths
15
15
  * it serves, such as a Next.js app's route handlers (docs/nextjs.md). The
16
- * cloud runs it as the app's Web Actor; without a cloud the page runs it.
16
+ * cloud runs it as the app's server Worker; without a cloud the page runs it.
17
17
  */
18
18
  export interface ServerInfo {
19
19
  /** The module, a path inside the bundle ("_appos/server.js"). */
@@ -38,19 +38,41 @@ export interface ManifestInfo {
38
38
  home?: true;
39
39
  /** appos.multiple: true when the app opens several files at once (a workspace). */
40
40
  multiple?: true;
41
+ /**
42
+ * appos.extension: what the app's files show after their name ("md", "board"), for show only: a file's app (its
43
+ * DID) is its type, and its path is the same with or without it (docs/backend.md, "File paths").
44
+ */
45
+ extension?: string;
46
+ /**
47
+ * appos.placement "server": the app's files work best on an always-on server host (a git server, an MCP server), so
48
+ * the New dialog warns before one goes on a device. Absent: no preference.
49
+ */
50
+ placement?: "server";
41
51
  /** appos.permissions: browser features the app's frame gets (FRAME_PERMISSIONS). */
42
52
  permissions?: FramePermission[];
53
+ /** appos.embeddable: the pages of the app other apps may show inside theirs (appos.embed), by path. */
54
+ embeddable?: string[];
43
55
  /** appos.actors as the code to run (module and classes), when well formed. */
44
56
  backend?: BackendInfo;
45
57
  /** appos.actors. */
46
- actors?: ActorsInfo;
58
+ actors?: LiveWorkersInfo;
47
59
  /** appos.server, when well formed. */
48
60
  server?: ServerInfo;
49
- /** Why appos.actors, appos.server or appos.network was refused. */
61
+ /**
62
+ * appos.openWeb: the app may ask its files' owners to open a file to the open web (docs/backend.md, "Open to the
63
+ * web"), with the largest request body such a request may carry. Declaring it opens nothing.
64
+ */
65
+ openWeb?: OpenWebInfo;
66
+ /**
67
+ * appos.mcp: true when each of the app's files serves an MCP server for agents at its address + /mcp, the
68
+ * LiveWorker's onMcp(request) (docs/backend.md, "MCP"). The manifest is the registration.
69
+ */
70
+ mcp?: true;
71
+ /** Why appos.actors, appos.server, appos.network, appos.openWeb or appos.mcp was refused. */
50
72
  backendError?: string;
51
73
  /**
52
- * appos.network: the hosts the actors may fetch (https only), or "none".
53
- * Missing means "none": an actor reaches nothing it did not declare.
74
+ * appos.network: the hosts the LiveWorkers may fetch (https only), or "none".
75
+ * Missing means "none": a LiveWorker reaches nothing it did not declare.
54
76
  */
55
77
  network?: "none" | string[];
56
78
  }
@@ -61,10 +83,14 @@ export declare const FRAME_PERMISSIONS: {
61
83
  export type FramePermission = keyof typeof FRAME_PERMISSIONS;
62
84
  /** appos.permissions: the known names, once each; anything else is ignored (a newer appOS may know it). */
63
85
  export declare function parsePermissions(v: unknown): FramePermission[] | undefined;
86
+ /** appos.embeddable: the paths it lists, once each, at most 16; anything else is ignored. */
87
+ export declare function parseEmbeddable(v: unknown): string[] | undefined;
64
88
  /**
65
89
  * What every app's frame gets: copying (share links and the like) and keeping the screen on while it's in front (a
66
90
  * dictation, a recipe). Without screen-wake-lock Chrome refuses navigator.wakeLock in the frame by permissions policy.
67
91
  */
92
+ /** appos.extension: 1 to 16 lowercase letters or digits, no dot. */
93
+ export declare const EXTENSION_RE: RegExp;
68
94
  export declare const BASE_FRAME_ALLOW: readonly ["clipboard-write", "screen-wake-lock"];
69
95
  /** The allow features for an app's frame: what it declared (FRAME_PERMISSIONS). */
70
96
  export declare function frameAllow(permissions: readonly FramePermission[] | undefined): string[];
@@ -72,10 +98,10 @@ export declare const MAX_BACKEND_CLASSES = 16;
72
98
  export declare const MAX_NETWORK_HOSTS = 32;
73
99
  /**
74
100
  * appos.actors: { Name: { main } }. v1 runs one bundled module per app, so
75
- * every actor names the same main. Returns the normalized actors or an error.
101
+ * every LiveWorker names the same main. Returns the normalized LiveWorkers or an error.
76
102
  */
77
- export declare function parseActors(v: unknown): {
78
- actors: ActorsInfo;
103
+ export declare function parseLiveWorkers(v: unknown): {
104
+ actors: LiveWorkersInfo;
79
105
  main: string;
80
106
  } | {
81
107
  error: string;
@@ -85,8 +111,20 @@ export declare const MAX_SERVER_ROUTES = 256;
85
111
  export declare function parseServer(v: unknown): ServerInfo | {
86
112
  error: string;
87
113
  };
88
- /** Validates appos.actors, appos.server and appos.network; never throws. */
89
- export declare function parseBackend(appos: Record<string, unknown>): Pick<ManifestInfo, "backend" | "backendError" | "network" | "actors" | "server">;
114
+ /** appos.openWeb: { maxBody } in bytes; the default and the most a request from the open web may carry. */
115
+ export interface OpenWebInfo {
116
+ maxBody: number;
117
+ }
118
+ export declare const OPEN_WEB_DEFAULT_BODY: number;
119
+ /** The most the platform streams to a LiveWorker in one request from the open web (the Workers runtime's own cap). */
120
+ export declare const OPEN_WEB_MAX_BODY: number;
121
+ /** appos.openWeb: true, {} or { maxBody: <bytes> }, the body capped at OPEN_WEB_MAX_BODY. */
122
+ export declare function parseOpenWeb(v: unknown): OpenWebInfo | {
123
+ error: string;
124
+ };
125
+ type BackendFields = "backend" | "backendError" | "network" | "actors" | "server" | "openWeb" | "mcp";
126
+ /** Validates appos.actors, appos.server, appos.network, appos.openWeb and appos.mcp; never throws. */
127
+ export declare function parseBackend(appos: Record<string, unknown>): Pick<ManifestInfo, BackendFields>;
90
128
  /** A channel name: lowercase, like "beta" or "dev". */
91
129
  export declare const CHANNEL_NAME: RegExp;
92
130
  /** The channel appos.update is. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@assistant-ui/appos",
3
- "version": "0.0.1",
3
+ "version": "0.0.2",
4
4
  "description": "Embed appOS apps in a website: <AppOSApp src>, host services, default permissions",
5
5
  "license": "MIT",
6
6
  "repository": {