@assistant-ui/appos 0.0.0-stage → 0.0.1
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.
- package/LICENSE +21 -0
- package/dist/chunks/ai-call.js +71 -0
- package/dist/chunks/ai-sdk.js +66 -0
- package/dist/chunks/src.js +1174 -0
- package/dist/index.js +1618 -0
- package/dist/next-page.js +150 -0
- package/dist/next-runtime.js +102 -0
- package/dist/next-server.js +50 -0
- package/dist/next.js +215 -0
- package/dist/pack.js +107 -0
- package/dist/server.js +77 -0
- package/dist/types/packages/appos-client/src/ai-sdk.d.ts +7 -0
- package/dist/types/packages/appos-client/src/index.d.ts +467 -0
- package/dist/types/packages/appos-client/src/theme.d.ts +16 -0
- package/dist/types/packages/appos-client/src/update-text.d.ts +13 -0
- package/dist/types/packages/appos-host/src/AppOSApp.d.ts +20 -0
- package/dist/types/packages/appos-host/src/ai-call.d.ts +31 -0
- package/dist/types/packages/appos-host/src/ai.d.ts +61 -0
- package/dist/types/packages/appos-host/src/embed.d.ts +119 -0
- package/dist/types/packages/appos-host/src/index.d.ts +6 -0
- package/dist/types/packages/appos-host/src/next/adapter.d.ts +43 -0
- package/dist/types/packages/appos-host/src/next/page.d.ts +1 -0
- package/dist/types/packages/appos-host/src/next/routes.d.ts +2 -0
- package/dist/types/packages/appos-host/src/next/runtime.d.ts +11 -0
- package/dist/types/packages/appos-host/src/next/server.d.ts +22 -0
- package/dist/types/packages/appos-host/src/pack.d.ts +16 -0
- package/dist/types/packages/appos-host/src/server.d.ts +23 -0
- package/dist/types/src/lib/ai-spend.d.ts +51 -0
- package/dist/types/src/lib/bundle-meta.d.ts +13 -0
- package/dist/types/src/lib/color-scheme.d.ts +17 -0
- package/dist/types/src/lib/external-link.d.ts +5 -0
- package/dist/types/src/lib/frame-pinch.d.ts +6 -0
- package/dist/types/src/lib/pack.d.ts +17 -0
- package/dist/types/src/lib/swbn/cbor.d.ts +16 -0
- package/dist/types/src/lib/swbn/identity.d.ts +121 -0
- package/dist/types/src/lib/swbn/integrity.d.ts +51 -0
- package/dist/types/src/lib/swbn/keys.d.ts +25 -0
- package/dist/types/src/lib/swbn/manifest.d.ts +106 -0
- package/dist/types/src/lib/swbn/release.d.ts +39 -0
- package/package.json +43 -4
- package/README.md +0 -3
|
@@ -0,0 +1,106 @@
|
|
|
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, {
|
|
4
|
+
main: string;
|
|
5
|
+
}>;
|
|
6
|
+
/** The code a host runs for this app's actors: their one module and its classes. */
|
|
7
|
+
export interface BackendInfo {
|
|
8
|
+
/** The actors' module, a path inside the bundle ("board.js"). */
|
|
9
|
+
main: string;
|
|
10
|
+
/** The classes it exports, one per actor name. */
|
|
11
|
+
classes: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* appos.server: one fetch handler (`export default { fetch }`) for the paths
|
|
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.
|
|
17
|
+
*/
|
|
18
|
+
export interface ServerInfo {
|
|
19
|
+
/** The module, a path inside the bundle ("_appos/server.js"). */
|
|
20
|
+
main: string;
|
|
21
|
+
/** The paths it answers, as Next.js route patterns ("/api/items/[id]"). */
|
|
22
|
+
routes: string[];
|
|
23
|
+
}
|
|
24
|
+
export interface ManifestInfo {
|
|
25
|
+
/** appos.did; non-strings are stringified so they never match a DID. */
|
|
26
|
+
did?: string;
|
|
27
|
+
/** "version", if present (validated by verifyBundle, see release.ts). */
|
|
28
|
+
version?: string;
|
|
29
|
+
/** appos.build, if present and a positive integer. */
|
|
30
|
+
build?: number;
|
|
31
|
+
/** Why appos.build was refused, when it is present but malformed. */
|
|
32
|
+
buildError?: string;
|
|
33
|
+
/** appos.channels: more update feeds by name (the default is appos.update). */
|
|
34
|
+
channels?: Record<string, string>;
|
|
35
|
+
/** appos.update: the update manifest URL, if it is a string. */
|
|
36
|
+
update?: string;
|
|
37
|
+
/** appos.home: true when the app has a home file (01-spec/01-app-files.md, "Home files"). */
|
|
38
|
+
home?: true;
|
|
39
|
+
/** appos.multiple: true when the app opens several files at once (a workspace). */
|
|
40
|
+
multiple?: true;
|
|
41
|
+
/** appos.permissions: browser features the app's frame gets (FRAME_PERMISSIONS). */
|
|
42
|
+
permissions?: FramePermission[];
|
|
43
|
+
/** appos.actors as the code to run (module and classes), when well formed. */
|
|
44
|
+
backend?: BackendInfo;
|
|
45
|
+
/** appos.actors. */
|
|
46
|
+
actors?: ActorsInfo;
|
|
47
|
+
/** appos.server, when well formed. */
|
|
48
|
+
server?: ServerInfo;
|
|
49
|
+
/** Why appos.actors, appos.server or appos.network was refused. */
|
|
50
|
+
backendError?: string;
|
|
51
|
+
/**
|
|
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.
|
|
54
|
+
*/
|
|
55
|
+
network?: "none" | string[];
|
|
56
|
+
}
|
|
57
|
+
/** What appos.permissions may list, and the iframe allow feature each delegates. */
|
|
58
|
+
export declare const FRAME_PERMISSIONS: {
|
|
59
|
+
readonly "local-network": "local-network-access";
|
|
60
|
+
};
|
|
61
|
+
export type FramePermission = keyof typeof FRAME_PERMISSIONS;
|
|
62
|
+
/** appos.permissions: the known names, once each; anything else is ignored (a newer appOS may know it). */
|
|
63
|
+
export declare function parsePermissions(v: unknown): FramePermission[] | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* What every app's frame gets: copying (share links and the like) and keeping the screen on while it's in front (a
|
|
66
|
+
* dictation, a recipe). Without screen-wake-lock Chrome refuses navigator.wakeLock in the frame by permissions policy.
|
|
67
|
+
*/
|
|
68
|
+
export declare const BASE_FRAME_ALLOW: readonly ["clipboard-write", "screen-wake-lock"];
|
|
69
|
+
/** The allow features for an app's frame: what it declared (FRAME_PERMISSIONS). */
|
|
70
|
+
export declare function frameAllow(permissions: readonly FramePermission[] | undefined): string[];
|
|
71
|
+
export declare const MAX_BACKEND_CLASSES = 16;
|
|
72
|
+
export declare const MAX_NETWORK_HOSTS = 32;
|
|
73
|
+
/**
|
|
74
|
+
* 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.
|
|
76
|
+
*/
|
|
77
|
+
export declare function parseActors(v: unknown): {
|
|
78
|
+
actors: ActorsInfo;
|
|
79
|
+
main: string;
|
|
80
|
+
} | {
|
|
81
|
+
error: string;
|
|
82
|
+
};
|
|
83
|
+
export declare const MAX_SERVER_ROUTES = 256;
|
|
84
|
+
/** appos.server: { main, routes }. Returns it normalized, or an error. */
|
|
85
|
+
export declare function parseServer(v: unknown): ServerInfo | {
|
|
86
|
+
error: string;
|
|
87
|
+
};
|
|
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">;
|
|
90
|
+
/** A channel name: lowercase, like "beta" or "dev". */
|
|
91
|
+
export declare const CHANNEL_NAME: RegExp;
|
|
92
|
+
/** The channel appos.update is. */
|
|
93
|
+
export declare const DEFAULT_CHANNEL = "stable";
|
|
94
|
+
export declare const MAX_CHANNELS = 8;
|
|
95
|
+
/**
|
|
96
|
+
* appos.channels: { name: feed URL }. Malformed entries, and "stable" (that
|
|
97
|
+
* is appos.update), are dropped; the URLs are checked when used.
|
|
98
|
+
*/
|
|
99
|
+
export declare function parseChannels(v: unknown): Record<string, string> | undefined;
|
|
100
|
+
/** Reads the app's manifest from a .wbn: the <link rel=manifest>, else
|
|
101
|
+
* /manifest.webmanifest or /manifest.json. */
|
|
102
|
+
export declare function readManifest(wbn: Uint8Array): ManifestInfo;
|
|
103
|
+
/** One file of a .wbn by path ("/backend.js"), or undefined if it has none. */
|
|
104
|
+
export declare function readBundleFile(wbn: Uint8Array, path: string): Uint8Array | undefined;
|
|
105
|
+
/** The manifest's appos.did, read from a .wbn. */
|
|
106
|
+
export declare function manifestDid(wbn: Uint8Array): string | undefined;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** A bundle's place in its app's history. */
|
|
2
|
+
export interface Release {
|
|
3
|
+
/** The manifest's "version": display only once `build` is set. */
|
|
4
|
+
version?: string;
|
|
5
|
+
/** appos.build. */
|
|
6
|
+
build?: number;
|
|
7
|
+
}
|
|
8
|
+
/** Largest build number accepted (fits every store and header). */
|
|
9
|
+
export declare const MAX_BUILD: number;
|
|
10
|
+
/** Longest display version accepted. */
|
|
11
|
+
export declare const MAX_VERSION_LENGTH = 64;
|
|
12
|
+
/** "1.2.3" -> [1, 2, 3]. Undefined if it is not 1–4 dot-separated integers. */
|
|
13
|
+
export declare function parseVersion(v: string): number[] | undefined;
|
|
14
|
+
/** Compares versions; missing parts are 0 ("1" == "1.0"). */
|
|
15
|
+
export declare function compareVersions(a: number[], b: number[]): number;
|
|
16
|
+
/** appos.build: a positive integer, or undefined. */
|
|
17
|
+
export declare function parseBuild(v: unknown): number | undefined;
|
|
18
|
+
/** A display version: 1–64 characters, no control characters. */
|
|
19
|
+
export declare function isDisplayVersion(v: unknown): v is string;
|
|
20
|
+
/**
|
|
21
|
+
* Why a bundle's release is not acceptable, or undefined. With a build the
|
|
22
|
+
* version is display text; without one it must be a dot-number (missing
|
|
23
|
+
* counts as "0"), because it is what orders the app.
|
|
24
|
+
*/
|
|
25
|
+
export declare function releaseError(r: Release): string | undefined;
|
|
26
|
+
/** A stored release: older records kept only the version string. */
|
|
27
|
+
export declare function asRelease(r: Release | string | undefined | null): Release;
|
|
28
|
+
/**
|
|
29
|
+
* -1, 0 or 1. Both with builds: by build. Neither: by dot-version (one
|
|
30
|
+
* that doesn't parse counts as 0). Mixed: the one with a build is newer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function compareReleases(a: Release, b: Release): number;
|
|
33
|
+
export declare const releaseLess: (a: Release, b: Release) => boolean;
|
|
34
|
+
/** The same build: equal builds, or (no builds) the same version text. */
|
|
35
|
+
export declare function sameRelease(a: Release, b: Release): boolean;
|
|
36
|
+
/** "2.3.1 (42)", or the version alone for apps without builds. */
|
|
37
|
+
export declare function releaseLabel(r: Release): string;
|
|
38
|
+
/** The higher of two releases (ties keep `a`). */
|
|
39
|
+
export declare function maxRelease(a: Release, b: Release): Release;
|
package/package.json
CHANGED
|
@@ -1,6 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@assistant-ui/appos",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"description": "Embed appOS apps in a website: <AppOSApp src>, host services, default permissions",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/assistant-ui/appOS.git",
|
|
9
|
+
"directory": "packages/appos-host"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"files": [
|
|
13
|
+
"dist"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/types/packages/appos-host/src/index.d.ts",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./server": {
|
|
21
|
+
"types": "./dist/types/packages/appos-host/src/server.d.ts",
|
|
22
|
+
"default": "./dist/server.js"
|
|
23
|
+
},
|
|
24
|
+
"./pack": {
|
|
25
|
+
"types": "./dist/types/packages/appos-host/src/pack.d.ts",
|
|
26
|
+
"default": "./dist/pack.js"
|
|
27
|
+
},
|
|
28
|
+
"./next": {
|
|
29
|
+
"types": "./dist/types/packages/appos-host/src/next/adapter.d.ts",
|
|
30
|
+
"default": "./dist/next.js"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"esbuild": "0.28.2",
|
|
35
|
+
"wbn": "0.0.10"
|
|
36
|
+
},
|
|
37
|
+
"peerDependencies": {
|
|
38
|
+
"react": "^19.0.0"
|
|
39
|
+
},
|
|
40
|
+
"peerDependenciesMeta": {
|
|
41
|
+
"react": {
|
|
42
|
+
"optional": true
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
package/README.md
DELETED