@dopame/acde-linux-x64 0.0.0-stage → 0.0.10
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 +8 -0
- package/bin/acde +66 -0
- package/bin/acde.cmd +45 -0
- package/bin/acdebin-dbg +4 -0
- package/bin/app/brand/art.mjs +53 -0
- package/bin/app/brand/brand.css +39 -0
- package/bin/app/brand/lockup.mjs +17 -0
- package/bin/app/brand/mark.mjs +124 -0
- package/bin/app/dist/broker.js +1 -0
- package/bin/app/dist/web.js +1 -0
- package/bin/app/greet/index.html +177 -0
- package/bin/app/greet/package.json +16 -0
- package/bin/app/package.json +35 -0
- package/lib/acde/LICENSE +8 -0
- package/lib/acde/dist/chunk-0n69bv5q.js +1 -0
- package/lib/acde/dist/chunk-1cw92x19.js +1 -0
- package/lib/acde/dist/chunk-458e14zb.js +1 -0
- package/lib/acde/dist/chunk-88mxgp54.js +1 -0
- package/lib/acde/dist/chunk-8dv09ven.js +1 -0
- package/lib/acde/dist/chunk-8fxsj5h6.js +1 -0
- package/lib/acde/dist/chunk-8pf3kk8v.js +1 -0
- package/lib/acde/dist/chunk-8r65bz1e.js +1 -0
- package/lib/acde/dist/chunk-9hpnkmxn.js +1 -0
- package/lib/acde/dist/chunk-a7w41xr9.js +1 -0
- package/lib/acde/dist/chunk-db7qqt8a.js +1 -0
- package/lib/acde/dist/chunk-e3rzr5fj.js +1 -0
- package/lib/acde/dist/chunk-ehms6xjp.js +1 -0
- package/lib/acde/dist/chunk-ggykhab6.js +1 -0
- package/lib/acde/dist/chunk-gt70e8h2.js +1 -0
- package/lib/acde/dist/chunk-hcf0xd5c.js +1 -0
- package/lib/acde/dist/chunk-hdrvz9sa.js +1 -0
- package/lib/acde/dist/chunk-jjq2mn94.js +1 -0
- package/lib/acde/dist/chunk-k8f4m94e.js +7 -0
- package/lib/acde/dist/chunk-mtgy1bm0.js +1 -0
- package/lib/acde/dist/chunk-mtw6p7kv.js +1 -0
- package/lib/acde/dist/chunk-nwkq7cpp.js +1 -0
- package/lib/acde/dist/chunk-nyr54266.js +1 -0
- package/lib/acde/dist/chunk-p0h5kspx.js +1 -0
- package/lib/acde/dist/chunk-pdj3h86e.js +1 -0
- package/lib/acde/dist/chunk-q9dbzac5.js +1 -0
- package/lib/acde/dist/chunk-qrhbrjzk.js +1 -0
- package/lib/acde/dist/chunk-s8p0y5ap.js +1 -0
- package/lib/acde/dist/chunk-t0xqxe00.js +1 -0
- package/lib/acde/dist/chunk-tgn5c2mw.js +1 -0
- package/lib/acde/dist/chunk-wmj6zwvn.js +1 -0
- package/lib/acde/dist/chunk-wnk81fkc.js +1 -0
- package/lib/acde/dist/chunk-x208z38w.js +1 -0
- package/lib/acde/dist/chunk-xq76vbg6.js +1 -0
- package/lib/acde/dist/chunk-xr9gh5x2.js +1 -0
- package/lib/acde/dist/chunk-yytnhz6e.js +1 -0
- package/lib/acde/dist/chunk-z0ts25s1.js +1 -0
- package/lib/acde/dist/chunk-zdyw1ckt.js +1 -0
- package/lib/acde/dist/cli.js +1 -0
- package/lib/acde/dist/driver/index.js +1 -0
- package/lib/acde/dist/e2e/index.js +1 -0
- package/lib/acde/dist/types/configs.d.ts +1 -0
- package/lib/acde/dist/types/driver/acde.d.ts +106 -0
- package/lib/acde/dist/types/driver/clock.d.ts +32 -0
- package/lib/acde/dist/types/driver/expect.d.ts +60 -0
- package/lib/acde/dist/types/driver/format.d.ts +16 -0
- package/lib/acde/dist/types/driver/index.d.ts +13 -0
- package/lib/acde/dist/types/driver/input.d.ts +75 -0
- package/lib/acde/dist/types/driver/locator.d.ts +151 -0
- package/lib/acde/dist/types/driver/logs.d.ts +26 -0
- package/lib/acde/dist/types/driver/png.d.ts +31 -0
- package/lib/acde/dist/types/driver/poll.d.ts +4 -0
- package/lib/acde/dist/types/driver/screenshot.d.ts +37 -0
- package/lib/acde/dist/types/driver/trace.d.ts +26 -0
- package/lib/acde/dist/types/driver/types.d.ts +213 -0
- package/lib/acde/dist/types/driver/video.d.ts +14 -0
- package/lib/acde/dist/types/driver/window.d.ts +77 -0
- package/lib/acde/dist/types/e2e/index.d.ts +78 -0
- package/lib/acde/dist/types/e2e/settings.d.ts +39 -0
- package/lib/acde/dist/types/ipc.d.ts +24 -0
- package/lib/acde/dist/types/paths.d.ts +5 -0
- package/lib/acde/dist/types/pm.d.ts +20 -0
- package/lib/acde/dist/types/runtime.d.ts +49 -0
- package/lib/acde/dist/types/sessions.d.ts +80 -0
- package/lib/acde/dist/types/sockets.d.ts +4 -0
- package/lib/acde/launcher.d.mts +25 -0
- package/lib/acde/launcher.mjs +1 -0
- package/lib/acde/package.json +31 -0
- package/lib/acde/skills/acde/SKILL.md +114 -0
- package/lib/acde/skills/acde/references/guide/agents.md +50 -0
- package/lib/acde/skills/acde/references/guide/assets.md +40 -0
- package/lib/acde/skills/acde/references/guide/backend.md +94 -0
- package/lib/acde/skills/acde/references/guide/capabilities.md +157 -0
- package/lib/acde/skills/acde/references/guide/config.md +73 -0
- package/lib/acde/skills/acde/references/guide/desktop.md +165 -0
- package/lib/acde/skills/acde/references/guide/dev.md +66 -0
- package/lib/acde/skills/acde/references/guide/doctor.md +144 -0
- package/lib/acde/skills/acde/references/guide/files.md +181 -0
- package/lib/acde/skills/acde/references/guide/frameworks.md +74 -0
- package/lib/acde/skills/acde/references/guide/install.md +34 -0
- package/lib/acde/skills/acde/references/guide/mcp.md +64 -0
- package/lib/acde/skills/acde/references/guide/open.md +107 -0
- package/lib/acde/skills/acde/references/guide/services.md +147 -0
- package/lib/acde/skills/acde/references/guide/testing.md +378 -0
- package/lib/acde/skills/acde/references/guide/tools.md +291 -0
- package/lib/acde/skills/acde/references/guide/window.md +167 -0
- package/lib/acde/skills/acde/references/reference/cli.md +221 -0
- package/lib/acde/skills/acde/references/reference/config.md +51 -0
- package/lib/acde/skills/acde/references/reference/env.md +44 -0
- package/lib/acde/skills/acde/references/reference/manifest.md +92 -0
- package/lib/acde/skills/acde/references/reference/modules.md +586 -0
- package/lib/acde/skills/acde/references/reference/platforms.md +23 -0
- package/lib/acde/skills/acde/references/reference/service.md +47 -0
- package/lib/acde/skills/acde/references/reference/testing.md +265 -0
- package/lib/acde/skills/acde/references/reference/web.md +94 -0
- package/lib/acde/skills/acde/references/start/first-app.md +87 -0
- package/lib/acde/skills/acde/references/start/install.md +232 -0
- package/lib/acde/skills/acde/references/start/project.md +77 -0
- package/lib/acde/templates/app/acde.config.jsonc +27 -0
- package/lib/acde/templates/app/gitignore +2 -0
- package/lib/acde/templates/app/index.html +22 -0
- package/lib/acde/templates/app/package.json +5 -0
- package/lib/acde/templates/app/src/i18n.js +26 -0
- package/lib/acde/templates/app/src/locales/en.js +4 -0
- package/lib/acde/templates/app/src/locales/zh.js +4 -0
- package/lib/acde/templates/app/src/main.js +5 -0
- package/lib/acde/templates/backend/server.ts +7 -0
- package/lib/acde/templates/backend/src/main.js +6 -0
- package/lib/acde/templates/desktop/acde.config.jsonc +17 -0
- package/lib/acde/templates/desktop/gitignore +2 -0
- package/lib/acde/templates/desktop/index.html +19 -0
- package/lib/acde/templates/desktop/package.json +5 -0
- package/lib/acde/templates/desktop/src/desktop.js +16 -0
- package/lib/acde/templates/desktop/src/i18n.js +26 -0
- package/lib/acde/templates/desktop/src/locales/en.js +4 -0
- package/lib/acde/templates/desktop/src/locales/zh.js +4 -0
- package/lib/acde/templates/framework/acde.config.jsonc +26 -0
- package/lib/acde-api/LICENSE +5 -0
- package/lib/acde-api/config.schema.json +563 -0
- package/lib/acde-api/package.json +51 -0
- package/lib/acde-api/src/app.d.ts +36 -0
- package/lib/acde-api/src/frame.d.ts +15 -0
- package/lib/acde-api/src/frame.js +1 -0
- package/lib/acde-api/src/index.d.ts +11 -0
- package/lib/acde-api/src/index.js +1 -0
- package/lib/acde-api/src/modules/app-modules.d.ts +81 -0
- package/lib/acde-api/src/modules/modules.d.ts +113 -0
- package/lib/acde-api/src/modules/shell-modules.d.ts +32 -0
- package/lib/acde-api/src/runtime/level.d.ts +1 -0
- package/lib/acde-api/src/runtime/level.js +1 -0
- package/lib/acde-api/src/runtime/load.d.ts +8 -0
- package/lib/acde-api/src/runtime/load.js +1 -0
- package/lib/acde-api/src/runtime/places.d.ts +3 -0
- package/lib/acde-api/src/runtime/places.js +1 -0
- package/lib/acde-api/src/runtime/platforms.d.ts +5 -0
- package/lib/acde-api/src/runtime/platforms.js +1 -0
- package/lib/acde-api/src/shell.d.ts +14 -0
- package/lib/acde-api/src/types/capabilities.d.ts +34 -0
- package/lib/acde-api/src/types/config.d.ts +55 -0
- package/lib/acde-api/src/types/events.d.ts +151 -0
- package/lib/acde-api/src/types/manifest.d.ts +83 -0
- package/lib/acde-api/src/types/office.d.ts +118 -0
- package/lib/acde-api/src/types/page.d.ts +1090 -0
- package/lib/acde-api/src/types/permissions.d.ts +50 -0
- package/lib/acde-api/src/types/service.d.ts +35 -0
- package/lib/acde-api/src/validate.d.ts +64 -0
- package/lib/acde-api/src/validate.js +1 -0
- package/lib/acde-api/src/vite.d.ts +3 -0
- package/lib/acde-api/src/vite.js +9 -0
- package/package.json +11 -4
- package/README.md +0 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export type ApprovalCapability = 'camera' | 'microphone' | 'idleDetection'
|
|
2
|
+
|
|
3
|
+
export type FolderCapability = `fs.folder-${string}`
|
|
4
|
+
|
|
5
|
+
export interface PermissionPrompt {
|
|
6
|
+
readonly id: number
|
|
7
|
+
readonly app: string
|
|
8
|
+
readonly label: string
|
|
9
|
+
readonly capability: ApprovalCapability
|
|
10
|
+
readonly reason: 'request'
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface PermissionPromptEvent extends PermissionPrompt {
|
|
14
|
+
readonly type: 'permissionprompt'
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export interface PermissionAnsweredEvent {
|
|
18
|
+
readonly type: 'permissionanswered'
|
|
19
|
+
readonly id: number
|
|
20
|
+
readonly app: string
|
|
21
|
+
readonly capability: ApprovalCapability
|
|
22
|
+
readonly allowed: boolean
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export interface PermissionEventMap {
|
|
26
|
+
readonly prompt: PermissionPromptEvent
|
|
27
|
+
readonly answered: PermissionAnsweredEvent
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface PermissionDecision {
|
|
31
|
+
readonly app: string
|
|
32
|
+
readonly label: string | null
|
|
33
|
+
readonly capability: ApprovalCapability | FolderCapability
|
|
34
|
+
readonly decision: 'granted' | 'denied'
|
|
35
|
+
readonly folder?: { readonly label: string; readonly exists: boolean }
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export interface AcdePermissions {
|
|
39
|
+
pending(): Promise<PermissionPrompt[]>
|
|
40
|
+
answer(id: number, allow: boolean): Promise<void>
|
|
41
|
+
list(app?: string): Promise<PermissionDecision[]>
|
|
42
|
+
revoke(app: string, capability: ApprovalCapability | FolderCapability): Promise<boolean>
|
|
43
|
+
on<K extends keyof PermissionEventMap>(type: K, handler: (event: PermissionEventMap[K]) => void): () => boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface AcdePermissionError extends Error {
|
|
47
|
+
readonly status: 403
|
|
48
|
+
readonly code: 'denied' | 'not_asked' | 'asking'
|
|
49
|
+
readonly capability: string
|
|
50
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export interface ServiceContext {
|
|
2
|
+
readonly name: string
|
|
3
|
+
readonly package: string
|
|
4
|
+
readonly state: string
|
|
5
|
+
readonly native: Readonly<Record<string, unknown>> | null
|
|
6
|
+
readonly env: Readonly<Record<string, string | undefined>>
|
|
7
|
+
readonly inspect?: import('./page').AcdeInspect
|
|
8
|
+
log(line: string): void
|
|
9
|
+
spawn(argv: readonly string[], options?: SpawnOptions): ServiceProcess
|
|
10
|
+
import<K extends keyof import('./page').ServiceModuleTypes>(
|
|
11
|
+
specifier: `acde:${K}`,
|
|
12
|
+
): Promise<{ readonly default: import('./page').ServiceModuleTypes[K] } & { readonly [N in K]: import('./page').ServiceModuleTypes[K] }>
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface SpawnOptions {
|
|
16
|
+
readonly cwd?: string
|
|
17
|
+
readonly env?: Readonly<Record<string, string>>
|
|
18
|
+
onLine?(line: string): void
|
|
19
|
+
onExit?(code: number | null, signal: number | null): void
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface ServiceProcess {
|
|
23
|
+
readonly pid: number
|
|
24
|
+
write(text: string): boolean
|
|
25
|
+
end(): void
|
|
26
|
+
kill(signal?: 'SIGTERM' | 'SIGKILL' | 'SIGINT' | 'SIGHUP'): boolean
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export interface ServiceInstance {
|
|
30
|
+
readonly api: Readonly<Record<string, object>>
|
|
31
|
+
readonly sync?: readonly string[]
|
|
32
|
+
close?(): unknown
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type ServiceFactory = (context: ServiceContext) => ServiceInstance | Promise<ServiceInstance>
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { AppBackend, AppManifest as AppEntry, Capabilities, PackageManifest } from './types/manifest.js';
|
|
2
|
+
import { API_LEVEL } from './runtime/level.js';
|
|
3
|
+
import { SHARED_PLACES } from './runtime/places.js';
|
|
4
|
+
export type { Capabilities, PackageManifest } from './types/manifest.js';
|
|
5
|
+
export type { CapabilityState, CapabilityStatus, PlatformSupport, RunningMode, WindowFeatures } from './types/capabilities.js';
|
|
6
|
+
export { API_LEVEL, SHARED_PLACES };
|
|
7
|
+
export type { PlaceCapability, SharedPlace } from './runtime/places.js';
|
|
8
|
+
export { FrameThemes, type FrameThemeWire } from './frame.js';
|
|
9
|
+
export { PLATFORM_SUPPORT, RUNNING_MODES, platformSupport } from './runtime/platforms.js';
|
|
10
|
+
export declare const ICON_NAMES: readonly ["files", "browser", "editor", "office", "term", "projects", "dash", "team", "dopa", "settings", "store", "app", "timer", "cards", "list", "chart", "calc", "music", "video", "photo", "paint", "game", "chat", "mail", "calendar", "code", "book", "map", "weather"];
|
|
11
|
+
export type IconName = (typeof ICON_NAMES)[number];
|
|
12
|
+
export declare const SHELL_MODULES: readonly ["windows", "packages", "session", "desktops", "inspect", "desktop", "setDefault", "permissions"];
|
|
13
|
+
export declare const APP_MODULES: readonly ["launch", "apps", "open", "openPath", "handlers", "window"];
|
|
14
|
+
export type ShellModule = (typeof SHELL_MODULES)[number];
|
|
15
|
+
export declare const SYSTEM_CAPABILITIES: readonly ["fs", "terminal", "network", "system", "bluetooth", "audio", "devices", "power", "input", "display", "office", "launch", "slots", "open", "openFiles", "camera", "microphone", "idleDetection"];
|
|
16
|
+
export declare const WEB_CAPABILITIES: readonly ["notifications"];
|
|
17
|
+
export declare const CAPABILITY_MODULES: readonly ["fs", "terminal", "network", "system", "bluetooth", "audio", "devices", "power", "input", "display", "office"];
|
|
18
|
+
export declare const APPROVAL_CAPABILITIES: readonly ["camera", "microphone", "idleDetection"];
|
|
19
|
+
export interface ImportRule {
|
|
20
|
+
readonly allowed: boolean;
|
|
21
|
+
readonly missing: string | null;
|
|
22
|
+
readonly reason: string | null;
|
|
23
|
+
readonly unverified: string | null;
|
|
24
|
+
}
|
|
25
|
+
export declare const RESERVED_NAMES: ReadonlySet<string>;
|
|
26
|
+
export interface DesktopServiceGrant {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly modules: ShellModule[];
|
|
29
|
+
}
|
|
30
|
+
export interface ConfiguredService extends DesktopServiceGrant {
|
|
31
|
+
readonly module: string;
|
|
32
|
+
}
|
|
33
|
+
export type AppManifest = Required<Omit<AppEntry, 'backend' | 'size'>> & {
|
|
34
|
+
readonly backend: Required<AppBackend> | null;
|
|
35
|
+
readonly size: readonly [number, number] | null;
|
|
36
|
+
};
|
|
37
|
+
export interface Findings {
|
|
38
|
+
readonly errors: string[];
|
|
39
|
+
readonly warnings: string[];
|
|
40
|
+
}
|
|
41
|
+
export declare class Manifest {
|
|
42
|
+
#private;
|
|
43
|
+
static readonly HEAP_MB = 256;
|
|
44
|
+
static readonly MIN_HEAP_MB = 32;
|
|
45
|
+
static readonly CAPABILITIES: ReadonlySet<string>;
|
|
46
|
+
static places(caps: Capabilities): string[];
|
|
47
|
+
static place(capability: string): string | null;
|
|
48
|
+
static iconName(icon: string): icon is IconName;
|
|
49
|
+
static iconImage(icon: string): boolean;
|
|
50
|
+
static apiLevel(raw: unknown): number | null | string;
|
|
51
|
+
static shellModules(caps: Capabilities): ShellModule[];
|
|
52
|
+
static desktopServices(raw: unknown): DesktopServiceGrant[] | null | string;
|
|
53
|
+
static configServices(raw: unknown): ConfiguredService[] | string;
|
|
54
|
+
static readonly UNVERSIONED: string;
|
|
55
|
+
static refusal(level: number): string | null;
|
|
56
|
+
static heapMb(value: unknown, fallback: number): number;
|
|
57
|
+
static app(raw: unknown): AppManifest | string;
|
|
58
|
+
static importRule(name: string, app: AppManifest | null, origin: {
|
|
59
|
+
readonly system: boolean;
|
|
60
|
+
}): ImportRule;
|
|
61
|
+
static reserved(name: string): string | null;
|
|
62
|
+
static check(manifest: PackageManifest, isDir: (path: string) => boolean, resolve: (url: string) => boolean): Findings;
|
|
63
|
+
static readonly SYSTEM_REQUESTS: readonly string[];
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{API_LEVEL as S}from"./runtime/level.js";import{SHARED_PLACES as v}from"./runtime/places.js";import{FrameThemes as j}from"./frame.js";import{PLATFORM_SUPPORT as T,RUNNING_MODES as J,platformSupport as B}from"./runtime/platforms.js";const k=["files","browser","editor","office","term","projects","dash","team","dopa","settings","store","app","timer","cards","list","chart","calc","music","video","photo","paint","game","chat","mail","calendar","code","book","map","weather"],b=["windows","packages","session","desktops","inspect","desktop","setDefault","permissions"],A=["launch","apps","open","openPath","handlers","window"],E=["fs","terminal","network","system","bluetooth","audio","devices","power","input","display","office","launch","slots","open","openFiles","camera","microphone","idleDetection"],N=["notifications"],I=["fs","terminal","network","system","bluetooth","audio","devices","power","input","display","office"],P=["camera","microphone","idleDetection"],O=new Set([...E,...N,...b,...A,"capabilities"]);class r{static HEAP_MB=256;static MIN_HEAP_MB=32;static CAPABILITIES=new Set([...E,...b]);static#s=new Set(b);static#e=new Set(v);static#t=/^[\w.+-]+\/([\w.+-]+|\*)$/;static#n=new Set(k);static#i=/^\/(?!\/)[^\s\0?#]*\.(svg|png)$/i;static places(e){const s=e.fs;return typeof s=="object"&&s&&Array.isArray(s.roots)?s.roots.filter(t=>r.#e.has(t)):[]}static place(e){const s=e.startsWith("fs.")?e.slice(3):"";return r.#e.has(s)?s:null}static#r(e){if(typeof e!="object"||!e)return[];const s=v.join(", "),t=e.roots;return Array.isArray(t)?t.filter(i=>!r.#e.has(i)).map(i=>{const n=r.#o(i),u=n?`: write "${n}", the runtime finds that folder through the system (also when it was moved)`:` (${s}); any other folder is one the user picks (showDirectoryPicker() with "fs": true)`;return`fs.roots ${JSON.stringify(i)} is not a shared place${u}`}):[`fs.roots lists shared places (${s})`]}static#o(e){if(typeof e!="string")return null;const s=e.split(/[\\/]+/).filter(Boolean).at(-1)?.toLowerCase()??"";return r.#e.has(s)?s:null}static iconName(e){return r.#n.has(e)}static iconImage(e){return r.#i.test(e)}static apiLevel(e){return e===void 0?null:Number.isInteger(e)&&e>0?e:"acde.apiLevel must be a positive whole number (the contract level)"}static shellModules(e){return b.filter(s=>!!e[s])}static desktopServices(e){if(e==null)return null;if(!Array.isArray(e))return"services lists service names or {name, modules}";const s=[];for(const t of e){if(typeof t=="string"&&t){s.push({name:t,modules:[]});continue}const{name:i,modules:n=[]}=typeof t=="object"&&t!==null?t:{};if(typeof i!="string"||!i)return"services lists service names or {name, modules}";if(!Array.isArray(n)||n.some(u=>!r.#s.has(u)))return`service ${JSON.stringify(i)}: modules lists shell modules (${b.join(", ")})`;s.push({name:i,modules:[...n]})}return s}static configServices(e){if(e==null)return[];if(typeof e!="object"||Array.isArray(e))return"services maps each service name to its module or {module, modules}";const s=[];for(const[t,i]of Object.entries(e)){const n=`service ${JSON.stringify(t)}`;if(typeof i=="string"&&i){s.push({name:t,module:i,modules:[]});continue}const u=typeof i=="object"&&i!==null&&!Array.isArray(i)?i:{},{module:p,modules:c,...f}=u;if(typeof p!="string"||!p)return`${n}: a service is its module or {module, modules}`;const[m]=Object.keys(f);if(m!==void 0)return`${n}: ${JSON.stringify(m)} is not a field of a service (module, modules)`;const y=r.desktopServices([{name:t,modules:c}]);if(!Array.isArray(y))return y??`${n}: a service is its module or {module, modules}`;s.push({name:t,module:p,modules:y[0].modules})}return s}static UNVERSIONED=`no acde.apiLevel: a package built before contract levels; rebuild it with the current acde (level ${S})`;static refusal(e){return e===S?null:`needs level ${e}, runtime is level ${S}`}static heapMb(e,s){const t=Number(e);return Number.isFinite(t)&&t>=r.MIN_HEAP_MB?t:s}static app(e){const s="an app needs id, label, icon and entry";if(typeof e!="object"||e===null)return s;const t=g=>e[g],i=g=>typeof t(g)=="string"&&t(g)?t(g):null,n=i("id"),u=i("label"),p=i("icon"),c=i("entry");if(!n||!u||!p||!c||!/^[\w-]+$/.test(n)||!c.startsWith("/"))return s;const f=r.#d(t("backend"));if(typeof f=="string")return`app ${n}: ${f}`;if(c.endsWith("/")&&!f)return`app ${n}: an entry ending in / is a page the backend renders: it needs a backend`;const m=typeof t("capabilities")=="object"&&t("capabilities")!==null?t("capabilities"):{},y=t("mimeTypes");if(y!==void 0&&(!Array.isArray(y)||y.some(g=>typeof g!="string"||!r.#t.test(g))))return`app ${n}: mimeTypes must be MIME types (type/subtype, or type/* for all of a type)`;const $=y??[],a=r.#l(t("schemes"));if(typeof a=="string")return`app ${n}: ${a}`;const o=r.#a(t("requests"));if(typeof o=="string")return`app ${n}: ${o}`;const l=r.#p(t("size"));if(l===void 0)return`app ${n}: size must be [width, height] in whole logical pixels`;const d=r.#c(t("services"));if(typeof d=="string")return`app ${n}: ${d}`;const h=r.#u(t("optional"),m);return typeof h=="string"?`app ${n}: ${h}`:{id:n,label:u,icon:p,entry:c,capabilities:m,heapMb:r.heapMb(t("heapMb"),r.HEAP_MB),multiple:t("multiple")===!0,frame:t("frame")!==!1,mimeTypes:$,schemes:a,requests:o,backend:f,size:l,optional:h,services:d}}static importRule(e,s,t){const i={allowed:!0,missing:null,reason:null,unverified:null};if(!s)return i;const n=s.capabilities,u=`the capabilities of ${s.label}`,p=(c,f)=>({allowed:!1,missing:c,reason:f,unverified:null});if(r.#s.has(e)){if(!t.system){const c=`only the desktop, its services and system apps may import it, and ${s.label} is not a system app`;return p(null,`acde:${e} is a shell module: ${c}`)}return n[e]?i:p(e,`acde:${e} is a shell module: declare "${e}" in ${u}`)}if(e==="launch")return n.launch||n.slots?i:p("launch",`acde:launch needs "launch" or "slots" in ${u}`);if(e==="openPath"||e==="handlers")return n.openFiles?i:p("openFiles",`acde:${e} needs "openFiles" in ${u}`);if(I.includes(e))return n[e]?i:p(e,`acde:${e} needs "${e}" in ${u}`);if(A.includes(e)||e==="capabilities"||s.services.includes(e))return i;if(s.services.length>0){const c=s.services.map(m=>JSON.stringify(m)).join(", "),f=s.services.length===1?"the service":"one of the services";return{...i,unverified:`acde:${e} resolves only if ${f} ${s.label} lists (${c}) provides the "${e}" namespace`}}return p(null,`acde:${e} is not a system module; if a desktop service provides it, list that service's name in the services of ${s.label}`)}static reserved(e){return O.has(e)?`service ${JSON.stringify(e)} has the name of a system module (acde:${e}); system module names are reserved`:null}static check(e,s,t){const i={errors:[],warnings:[]},{errors:n,warnings:u}=i,p=e.apps??[],c=r.apiLevel(e.apiLevel);c===null?n.push(r.UNVERSIONED):typeof c=="string"?n.push(c):r.refusal(c)&&n.push(`acde.apiLevel ${c}: ${r.refusal(c)}`),p.length===0&&(e.desktops??[]).length===0&&n.push("acde.apps is empty: no app");for(const[a,o]of Object.entries(e.assets??{})){(!a.startsWith("/")||!a.endsWith("/"))&&n.push(`assets ${JSON.stringify(a)}: a prefix is /\u2026/`);for(const l of o.filter(d=>!s(d)))n.push(`assets ${JSON.stringify(a)}: no directory ${JSON.stringify(l)}`)}const f=new Set((e.services??[]).map(a=>a.name));for(const a of f){const o=r.reserved(a);o&&n.push(o)}for(const a of e.desktops??[]){const o=`desktop ${JSON.stringify(a?.id)}`;a&&typeof a=="object"&&"frame"in a&&n.push(`${o}: frame is not a desktop field (only apps have a frame)`);const l=r.desktopServices(a?.services);typeof l=="string"&&n.push(`${o}: ${l}`);for(const d of Array.isArray(l)?l:[])f.has(d.name)||u.push(`${o}: no service ${JSON.stringify(d.name)} in acde.services`)}const m=(e.desktops??[]).length>0,y=n,$=new Set;for(const a of p){const o=r.app(a);if(typeof o=="string"){n.push(o);continue}const l=`app ${JSON.stringify(o.id)}`;if($.has(o.id)&&n.push(`${l}: twice`),$.add(o.id),!o.entry.endsWith("/")&&!t(o.entry)&&n.push(`${l}: entry ${JSON.stringify(o.entry)} is in no assets directory`),o.backend&&!t(o.backend.entry)&&n.push(`${l}: backend.entry ${JSON.stringify(o.backend.entry)} is in no assets directory`),r.iconImage(o.icon)?t(o.icon)||n.push(`${l}: icon ${JSON.stringify(o.icon)} is in no assets directory`):r.iconName(o.icon)||u.push(`${l}: icon ${JSON.stringify(o.icon)} is neither an icon name (${k.join(", ")}) nor an image (.svg or .png) under the assets, such as /app/${o.id}/icon.svg`),a.heapMb!==void 0&&r.heapMb(a.heapMb,0)===0&&u.push(`${l}: heapMb below ${r.MIN_HEAP_MB} is ignored (${r.HEAP_MB} then)`),!m)for(const d of r.shellModules(o.capabilities))y.push(`${l}: acde:${d} is a shell module: only apps of a desktop package (system apps) may declare it`);for(const d of r.#r(o.capabilities.fs))y.push(`${l}: ${d}`);for(const d of Object.keys(o.capabilities).filter(h=>!r.CAPABILITIES.has(h)))f.has(d)?n.push(`${l}: capability ${JSON.stringify(d)} is a desktop service: list it under services`):y.push(`${l}: capability ${JSON.stringify(d)} is not a system capability; list desktop services under services`)}return i}static SYSTEM_REQUESTS=["open-file","open-link"];static#a(e){if(e==null)return[];const s=i=>typeof i=="string"&&/^[a-z][a-z0-9-]*$/.test(i)&&!r.SYSTEM_REQUESTS.includes(i),t=r.SYSTEM_REQUESTS.join(" and ");return!Array.isArray(e)||!e.every(s)?`requests lists private request kinds (lower-case words such as task); ${t} are system requests`:[...e]}static#l(e){if(e==null)return[];const s=t=>typeof t=="string"&&/^[a-z][a-z0-9+.-]*$/.test(t)&&t!=="file";return!Array.isArray(e)||!e.every(s)?"schemes lists lower-case URL schemes without the colon (https, mailto); file is not one":[...e]}static#c(e){if(e==null)return[];if(!Array.isArray(e)||e.some(s=>typeof s!="string"||!s))return"services lists desktop service names";for(const s of e){const t=r.reserved(s);if(t)return t}return[...e]}static#u(e,s){if(e==null)return[];if(!Array.isArray(e)||e.some(i=>typeof i!="string"||!i))return"optional lists capability names";const t=e.find(i=>!s[i]);return t?`optional ${JSON.stringify(t)} is not in capabilities (optional lists declared capabilities that the app can run without)`:[...e]}static#p(e){return e==null?null:Array.isArray(e)&&e.length===2&&e.every(s=>Number.isInteger(s)&&s>0)?[e[0],e[1]]:void 0}static#d(e){if(e==null)return null;if(typeof e!="object"||Array.isArray(e))return"backend must be an object {entry, port?}";const{entry:s,port:t=3e3}=e;return typeof s!="string"||!s.startsWith("/")||s.startsWith("//")||/[\s\0?#]/.test(s)||!/\.m?js$/.test(s)?"backend.entry must be a same-origin URL of a .js module under the assets (/app/<id>/backend/server.js)":typeof t!="number"||!Number.isInteger(t)||t<0||t>65535?"backend.port must be a port number (0 to 65535)":{entry:s,port:t}}}export{S as API_LEVEL,P as APPROVAL_CAPABILITIES,A as APP_MODULES,I as CAPABILITY_MODULES,j as FrameThemes,k as ICON_NAMES,r as Manifest,T as PLATFORM_SUPPORT,O as RESERVED_NAMES,J as RUNNING_MODES,v as SHARED_PLACES,b as SHELL_MODULES,E as SYSTEM_CAPABILITIES,N as WEB_CAPABILITIES,B as platformSupport};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const n="acde:",a="\0acde-stub:",r=t=>`const fail = (path) => Promise.reject(new Error(\`\${path}: only there when the app runs in acde\`))
|
|
2
|
+
const make = (path) => new Proxy(function () {}, {
|
|
3
|
+
get: (_, key) => (key === 'then' || typeof key === 'symbol' ? undefined : key === 'on' ? () => () => false : make(\`\${path}.\${key}\`)),
|
|
4
|
+
apply: () => fail(path),
|
|
5
|
+
})
|
|
6
|
+
const value = make(${JSON.stringify(n+t)})
|
|
7
|
+
export { value as ${JSON.stringify(t)} }
|
|
8
|
+
export default value
|
|
9
|
+
`;function s(){let t=!1;return{name:"acde",enforce:"pre",configResolved(e){t=e.command==="serve"},resolveId(e){return e.startsWith(n)?t?a+e.slice(n.length):{id:e,external:!0}:null},load(e){return e.startsWith(a)?r(e.slice(a.length)):null}}}export{s as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dopame/acde-linux-x64",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.10",
|
|
4
|
+
"description": "acde for linux-x64: the acdebin-dbg runtime, the acde CLI and the host files",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"os": [
|
|
7
|
+
"linux"
|
|
8
|
+
],
|
|
9
|
+
"cpu": [
|
|
10
|
+
"x64"
|
|
11
|
+
],
|
|
12
|
+
"preferUnplugged": true
|
|
13
|
+
}
|
package/README.md
DELETED