@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.
Files changed (165) hide show
  1. package/LICENSE +8 -0
  2. package/bin/acde +66 -0
  3. package/bin/acde.cmd +45 -0
  4. package/bin/acdebin-dbg +4 -0
  5. package/bin/app/brand/art.mjs +53 -0
  6. package/bin/app/brand/brand.css +39 -0
  7. package/bin/app/brand/lockup.mjs +17 -0
  8. package/bin/app/brand/mark.mjs +124 -0
  9. package/bin/app/dist/broker.js +1 -0
  10. package/bin/app/dist/web.js +1 -0
  11. package/bin/app/greet/index.html +177 -0
  12. package/bin/app/greet/package.json +16 -0
  13. package/bin/app/package.json +35 -0
  14. package/lib/acde/LICENSE +8 -0
  15. package/lib/acde/dist/chunk-0n69bv5q.js +1 -0
  16. package/lib/acde/dist/chunk-1cw92x19.js +1 -0
  17. package/lib/acde/dist/chunk-458e14zb.js +1 -0
  18. package/lib/acde/dist/chunk-88mxgp54.js +1 -0
  19. package/lib/acde/dist/chunk-8dv09ven.js +1 -0
  20. package/lib/acde/dist/chunk-8fxsj5h6.js +1 -0
  21. package/lib/acde/dist/chunk-8pf3kk8v.js +1 -0
  22. package/lib/acde/dist/chunk-8r65bz1e.js +1 -0
  23. package/lib/acde/dist/chunk-9hpnkmxn.js +1 -0
  24. package/lib/acde/dist/chunk-a7w41xr9.js +1 -0
  25. package/lib/acde/dist/chunk-db7qqt8a.js +1 -0
  26. package/lib/acde/dist/chunk-e3rzr5fj.js +1 -0
  27. package/lib/acde/dist/chunk-ehms6xjp.js +1 -0
  28. package/lib/acde/dist/chunk-ggykhab6.js +1 -0
  29. package/lib/acde/dist/chunk-gt70e8h2.js +1 -0
  30. package/lib/acde/dist/chunk-hcf0xd5c.js +1 -0
  31. package/lib/acde/dist/chunk-hdrvz9sa.js +1 -0
  32. package/lib/acde/dist/chunk-jjq2mn94.js +1 -0
  33. package/lib/acde/dist/chunk-k8f4m94e.js +7 -0
  34. package/lib/acde/dist/chunk-mtgy1bm0.js +1 -0
  35. package/lib/acde/dist/chunk-mtw6p7kv.js +1 -0
  36. package/lib/acde/dist/chunk-nwkq7cpp.js +1 -0
  37. package/lib/acde/dist/chunk-nyr54266.js +1 -0
  38. package/lib/acde/dist/chunk-p0h5kspx.js +1 -0
  39. package/lib/acde/dist/chunk-pdj3h86e.js +1 -0
  40. package/lib/acde/dist/chunk-q9dbzac5.js +1 -0
  41. package/lib/acde/dist/chunk-qrhbrjzk.js +1 -0
  42. package/lib/acde/dist/chunk-s8p0y5ap.js +1 -0
  43. package/lib/acde/dist/chunk-t0xqxe00.js +1 -0
  44. package/lib/acde/dist/chunk-tgn5c2mw.js +1 -0
  45. package/lib/acde/dist/chunk-wmj6zwvn.js +1 -0
  46. package/lib/acde/dist/chunk-wnk81fkc.js +1 -0
  47. package/lib/acde/dist/chunk-x208z38w.js +1 -0
  48. package/lib/acde/dist/chunk-xq76vbg6.js +1 -0
  49. package/lib/acde/dist/chunk-xr9gh5x2.js +1 -0
  50. package/lib/acde/dist/chunk-yytnhz6e.js +1 -0
  51. package/lib/acde/dist/chunk-z0ts25s1.js +1 -0
  52. package/lib/acde/dist/chunk-zdyw1ckt.js +1 -0
  53. package/lib/acde/dist/cli.js +1 -0
  54. package/lib/acde/dist/driver/index.js +1 -0
  55. package/lib/acde/dist/e2e/index.js +1 -0
  56. package/lib/acde/dist/types/configs.d.ts +1 -0
  57. package/lib/acde/dist/types/driver/acde.d.ts +106 -0
  58. package/lib/acde/dist/types/driver/clock.d.ts +32 -0
  59. package/lib/acde/dist/types/driver/expect.d.ts +60 -0
  60. package/lib/acde/dist/types/driver/format.d.ts +16 -0
  61. package/lib/acde/dist/types/driver/index.d.ts +13 -0
  62. package/lib/acde/dist/types/driver/input.d.ts +75 -0
  63. package/lib/acde/dist/types/driver/locator.d.ts +151 -0
  64. package/lib/acde/dist/types/driver/logs.d.ts +26 -0
  65. package/lib/acde/dist/types/driver/png.d.ts +31 -0
  66. package/lib/acde/dist/types/driver/poll.d.ts +4 -0
  67. package/lib/acde/dist/types/driver/screenshot.d.ts +37 -0
  68. package/lib/acde/dist/types/driver/trace.d.ts +26 -0
  69. package/lib/acde/dist/types/driver/types.d.ts +213 -0
  70. package/lib/acde/dist/types/driver/video.d.ts +14 -0
  71. package/lib/acde/dist/types/driver/window.d.ts +77 -0
  72. package/lib/acde/dist/types/e2e/index.d.ts +78 -0
  73. package/lib/acde/dist/types/e2e/settings.d.ts +39 -0
  74. package/lib/acde/dist/types/ipc.d.ts +24 -0
  75. package/lib/acde/dist/types/paths.d.ts +5 -0
  76. package/lib/acde/dist/types/pm.d.ts +20 -0
  77. package/lib/acde/dist/types/runtime.d.ts +49 -0
  78. package/lib/acde/dist/types/sessions.d.ts +80 -0
  79. package/lib/acde/dist/types/sockets.d.ts +4 -0
  80. package/lib/acde/launcher.d.mts +25 -0
  81. package/lib/acde/launcher.mjs +1 -0
  82. package/lib/acde/package.json +31 -0
  83. package/lib/acde/skills/acde/SKILL.md +114 -0
  84. package/lib/acde/skills/acde/references/guide/agents.md +50 -0
  85. package/lib/acde/skills/acde/references/guide/assets.md +40 -0
  86. package/lib/acde/skills/acde/references/guide/backend.md +94 -0
  87. package/lib/acde/skills/acde/references/guide/capabilities.md +157 -0
  88. package/lib/acde/skills/acde/references/guide/config.md +73 -0
  89. package/lib/acde/skills/acde/references/guide/desktop.md +165 -0
  90. package/lib/acde/skills/acde/references/guide/dev.md +66 -0
  91. package/lib/acde/skills/acde/references/guide/doctor.md +144 -0
  92. package/lib/acde/skills/acde/references/guide/files.md +181 -0
  93. package/lib/acde/skills/acde/references/guide/frameworks.md +74 -0
  94. package/lib/acde/skills/acde/references/guide/install.md +34 -0
  95. package/lib/acde/skills/acde/references/guide/mcp.md +64 -0
  96. package/lib/acde/skills/acde/references/guide/open.md +107 -0
  97. package/lib/acde/skills/acde/references/guide/services.md +147 -0
  98. package/lib/acde/skills/acde/references/guide/testing.md +378 -0
  99. package/lib/acde/skills/acde/references/guide/tools.md +291 -0
  100. package/lib/acde/skills/acde/references/guide/window.md +167 -0
  101. package/lib/acde/skills/acde/references/reference/cli.md +221 -0
  102. package/lib/acde/skills/acde/references/reference/config.md +51 -0
  103. package/lib/acde/skills/acde/references/reference/env.md +44 -0
  104. package/lib/acde/skills/acde/references/reference/manifest.md +92 -0
  105. package/lib/acde/skills/acde/references/reference/modules.md +586 -0
  106. package/lib/acde/skills/acde/references/reference/platforms.md +23 -0
  107. package/lib/acde/skills/acde/references/reference/service.md +47 -0
  108. package/lib/acde/skills/acde/references/reference/testing.md +265 -0
  109. package/lib/acde/skills/acde/references/reference/web.md +94 -0
  110. package/lib/acde/skills/acde/references/start/first-app.md +87 -0
  111. package/lib/acde/skills/acde/references/start/install.md +232 -0
  112. package/lib/acde/skills/acde/references/start/project.md +77 -0
  113. package/lib/acde/templates/app/acde.config.jsonc +27 -0
  114. package/lib/acde/templates/app/gitignore +2 -0
  115. package/lib/acde/templates/app/index.html +22 -0
  116. package/lib/acde/templates/app/package.json +5 -0
  117. package/lib/acde/templates/app/src/i18n.js +26 -0
  118. package/lib/acde/templates/app/src/locales/en.js +4 -0
  119. package/lib/acde/templates/app/src/locales/zh.js +4 -0
  120. package/lib/acde/templates/app/src/main.js +5 -0
  121. package/lib/acde/templates/backend/server.ts +7 -0
  122. package/lib/acde/templates/backend/src/main.js +6 -0
  123. package/lib/acde/templates/desktop/acde.config.jsonc +17 -0
  124. package/lib/acde/templates/desktop/gitignore +2 -0
  125. package/lib/acde/templates/desktop/index.html +19 -0
  126. package/lib/acde/templates/desktop/package.json +5 -0
  127. package/lib/acde/templates/desktop/src/desktop.js +16 -0
  128. package/lib/acde/templates/desktop/src/i18n.js +26 -0
  129. package/lib/acde/templates/desktop/src/locales/en.js +4 -0
  130. package/lib/acde/templates/desktop/src/locales/zh.js +4 -0
  131. package/lib/acde/templates/framework/acde.config.jsonc +26 -0
  132. package/lib/acde-api/LICENSE +5 -0
  133. package/lib/acde-api/config.schema.json +563 -0
  134. package/lib/acde-api/package.json +51 -0
  135. package/lib/acde-api/src/app.d.ts +36 -0
  136. package/lib/acde-api/src/frame.d.ts +15 -0
  137. package/lib/acde-api/src/frame.js +1 -0
  138. package/lib/acde-api/src/index.d.ts +11 -0
  139. package/lib/acde-api/src/index.js +1 -0
  140. package/lib/acde-api/src/modules/app-modules.d.ts +81 -0
  141. package/lib/acde-api/src/modules/modules.d.ts +113 -0
  142. package/lib/acde-api/src/modules/shell-modules.d.ts +32 -0
  143. package/lib/acde-api/src/runtime/level.d.ts +1 -0
  144. package/lib/acde-api/src/runtime/level.js +1 -0
  145. package/lib/acde-api/src/runtime/load.d.ts +8 -0
  146. package/lib/acde-api/src/runtime/load.js +1 -0
  147. package/lib/acde-api/src/runtime/places.d.ts +3 -0
  148. package/lib/acde-api/src/runtime/places.js +1 -0
  149. package/lib/acde-api/src/runtime/platforms.d.ts +5 -0
  150. package/lib/acde-api/src/runtime/platforms.js +1 -0
  151. package/lib/acde-api/src/shell.d.ts +14 -0
  152. package/lib/acde-api/src/types/capabilities.d.ts +34 -0
  153. package/lib/acde-api/src/types/config.d.ts +55 -0
  154. package/lib/acde-api/src/types/events.d.ts +151 -0
  155. package/lib/acde-api/src/types/manifest.d.ts +83 -0
  156. package/lib/acde-api/src/types/office.d.ts +118 -0
  157. package/lib/acde-api/src/types/page.d.ts +1090 -0
  158. package/lib/acde-api/src/types/permissions.d.ts +50 -0
  159. package/lib/acde-api/src/types/service.d.ts +35 -0
  160. package/lib/acde-api/src/validate.d.ts +64 -0
  161. package/lib/acde-api/src/validate.js +1 -0
  162. package/lib/acde-api/src/vite.d.ts +3 -0
  163. package/lib/acde-api/src/vite.js +9 -0
  164. package/package.json +11 -4
  165. package/README.md +0 -3
@@ -0,0 +1,77 @@
1
+ import type { InspectWindow } from '@dopame/acde-api';
2
+ import { type Acde, type ActResult, type ConsoleEntry, type ConsoleOptions, type DevPage, type Dialog, type DialogAnswer, type DialogType, type DropOptions, type Dropped, type NetworkOptions, type RequestEntry, type RouteOptions, type RouteResponse, type Shot, type UrlMatch, type WaitConsoleOptions, type WaitRequestOptions } from './acde.ts';
3
+ import { Locator, type RoleOptions, type Scope, type Source, type TextMatch, type TextOptions, type Timeout, type Tree } from './locator.ts';
4
+ import { Clock } from './clock.ts';
5
+ import { Keyboard, Mouse } from './input.ts';
6
+ import { type Capture, type ScreenshotOptions } from './screenshot.ts';
7
+ export interface WindowMatch {
8
+ readonly ref?: string;
9
+ readonly id?: number;
10
+ readonly app?: string;
11
+ readonly title?: TextMatch;
12
+ }
13
+ export declare class AppWindow implements Scope {
14
+ #private;
15
+ readonly acde: Acde;
16
+ readonly match: WindowMatch;
17
+ readonly mouse: Mouse;
18
+ readonly keyboard: Keyboard;
19
+ readonly clock: Clock;
20
+ constructor(acde: Acde, match: WindowMatch);
21
+ describe(): string;
22
+ toString(): string;
23
+ static pick(windows: readonly InspectWindow[], match: WindowMatch): InspectWindow[];
24
+ find(): Promise<InspectWindow | null>;
25
+ info(options?: Timeout): Promise<InspectWindow>;
26
+ isOpen(): Promise<boolean>;
27
+ waitFor(options?: Timeout & {
28
+ readonly state?: 'open' | 'closed';
29
+ }): Promise<void>;
30
+ tree(): Promise<Tree>;
31
+ static source(acde: Acde, ref: string): Promise<Source>;
32
+ getByRole(role: string, options?: RoleOptions): Locator;
33
+ getByText(text: TextMatch, options?: TextOptions): Locator;
34
+ locator(selector: string): Locator;
35
+ getByTestId(id: string): Locator;
36
+ getByLabel(text: TextMatch, options?: TextOptions): Locator;
37
+ getByPlaceholder(text: TextMatch, options?: TextOptions): Locator;
38
+ getByTitle(text: TextMatch, options?: TextOptions): Locator;
39
+ getByAltText(text: TextMatch, options?: TextOptions): Locator;
40
+ route(url: UrlMatch, response: RouteResponse, options?: Omit<RouteOptions, 'web'>): Promise<number>;
41
+ drop(files: string | readonly string[], options?: Omit<DropOptions, 'web'>): Promise<Dropped>;
42
+ waitForRequest(url: UrlMatch, options?: Omit<WaitRequestOptions, 'web'>): Promise<RequestEntry>;
43
+ waitForConsole(text: string | RegExp, options?: Omit<WaitConsoleOptions, 'web'>): Promise<ConsoleEntry>;
44
+ addInitScript(code: string, options?: {
45
+ readonly once?: boolean;
46
+ }): Promise<number>;
47
+ reload(options?: Timeout): Promise<void>;
48
+ resize(width: number, height: number, options?: Timeout): Promise<{
49
+ width: number;
50
+ height: number;
51
+ }>;
52
+ seedLocalStorage(entries: Readonly<Record<string, string>>, options?: Timeout): Promise<void>;
53
+ answerDialog(answer?: DialogAnswer): Promise<void>;
54
+ dialogs(): Promise<Dialog[]>;
55
+ waitForDialog(options?: {
56
+ readonly type?: DialogType;
57
+ readonly timeout?: number;
58
+ }): Promise<Dialog>;
59
+ console(options?: Omit<ConsoleOptions, 'web'>): Promise<DevPage<ConsoleEntry>>;
60
+ network(options?: Omit<NetworkOptions, 'web'>): Promise<DevPage<RequestEntry>>;
61
+ snapshot(options?: {
62
+ readonly find?: string;
63
+ readonly diff?: boolean;
64
+ }): Promise<string>;
65
+ web(): Promise<string>;
66
+ evaluate<T = unknown>(code: string): Promise<NoInfer<T>>;
67
+ screenshot(options?: ScreenshotOptions): Promise<Shot>;
68
+ capture(): Promise<Capture>;
69
+ rects(): Promise<readonly (readonly [number, number, number, number])[]>;
70
+ press(keys: string): Promise<ActResult>;
71
+ focus(): Promise<ActResult>;
72
+ minimize(): Promise<ActResult>;
73
+ restore(): Promise<ActResult>;
74
+ fill(): Promise<ActResult>;
75
+ fullscreen(): Promise<ActResult>;
76
+ close(): Promise<ActResult>;
77
+ }
@@ -0,0 +1,78 @@
1
+ import { type Matchers } from 'bun:test';
2
+ import { Acde } from '../driver/acde.ts';
3
+ import { type LocatorAssertions, type WindowAssertions } from '../driver/expect.ts';
4
+ import { Locator } from '../driver/locator.ts';
5
+ import { AppWindow } from '../driver/window.ts';
6
+ import { type E2eSettings } from './settings.ts';
7
+ export { afterAll, afterEach, beforeAll, beforeEach, describe } from 'bun:test';
8
+ export * from '../driver/index.ts';
9
+ export { E2e, type E2eSettings } from './settings.ts';
10
+ export interface Fixtures {
11
+ readonly acde: Acde;
12
+ readonly app: AppWindow | null;
13
+ readonly home: string;
14
+ readonly settings: E2eSettings;
15
+ }
16
+ export type Body = (fixtures: Fixtures) => unknown;
17
+ export interface TestSetup {
18
+ readonly size?: readonly [number, number];
19
+ readonly localStorage?: Readonly<Record<string, string>>;
20
+ }
21
+ export type TestOptions = number | ({
22
+ readonly timeout?: number;
23
+ } & TestSetup);
24
+ export declare class TestTimeout extends Error {
25
+ constructor(message: string);
26
+ }
27
+ export declare class E2eRun {
28
+ #private;
29
+ static readonly MARGIN_MS = 3000;
30
+ static readonly GRACE_MS = 30000;
31
+ static readonly KEEP_MS = 15000;
32
+ static readonly VIDEO_MS = 5000;
33
+ static startTimeout(timeout: number): number;
34
+ static softFailures: Error[] | null;
35
+ static env(home: string): Record<string, string>;
36
+ static results(settings: E2eSettings, name: string): string;
37
+ static screenshots(settings: E2eSettings): string;
38
+ static run(name: string, body: Body, settings?: E2eSettings, timeout?: number, setup?: TestSetup, results?: string): Promise<void>;
39
+ static ownFrames(error: unknown, root?: string): void;
40
+ static within<T>(ms: number, work: () => Promise<T>, late: () => Error): Promise<T>;
41
+ static keep(acde: Acde | null, error: unknown, dir: string, name?: string): Promise<string>;
42
+ }
43
+ export declare const test: {
44
+ (name: string, body: Body, options?: TestOptions): void;
45
+ (name: string, options: TestOptions, body: Body): void;
46
+ } & {
47
+ only: {
48
+ (name: string, body: Body, options?: TestOptions): void;
49
+ (name: string, options: TestOptions, body: Body): void;
50
+ };
51
+ skip: {
52
+ (name: string, body: Body, options?: TestOptions): void;
53
+ (name: string, options: TestOptions, body: Body): void;
54
+ };
55
+ todo: (name: string) => void;
56
+ if: (condition: boolean) => {
57
+ (name: string, body: Body, options?: TestOptions): void;
58
+ (name: string, options: TestOptions, body: Body): void;
59
+ };
60
+ };
61
+ type Asynced<M> = {
62
+ [K in keyof M]: M[K] extends (...args: infer A) => unknown ? (...args: A) => Promise<void> : M[K] extends object ? Asynced<M[K]> : never;
63
+ };
64
+ export type PollMatchers<T> = Asynced<Omit<Matchers<T>, 'resolves' | 'rejects'>>;
65
+ export interface PollOptions {
66
+ readonly timeout?: number;
67
+ readonly message?: string;
68
+ }
69
+ declare function expectAny(target: Locator): LocatorAssertions;
70
+ declare function expectAny(target: AppWindow): WindowAssertions;
71
+ declare function expectAny<T>(value: T): Matchers<T>;
72
+ declare function soft(target: Locator): LocatorAssertions;
73
+ declare function soft(target: AppWindow): WindowAssertions;
74
+ declare function soft<T>(value: T): Matchers<T>;
75
+ export declare const expect: typeof expectAny & {
76
+ poll: <T>(read: () => T | Promise<T>, options?: PollOptions) => PollMatchers<Awaited<T>>;
77
+ soft: typeof soft;
78
+ };
@@ -0,0 +1,39 @@
1
+ export interface E2eSettings {
2
+ readonly dirs: readonly string[];
3
+ readonly desktop: string | null;
4
+ readonly headless: boolean;
5
+ readonly results: string;
6
+ readonly file: string | null;
7
+ readonly timeout: number;
8
+ readonly trace: boolean;
9
+ readonly update: boolean;
10
+ readonly retries: number;
11
+ readonly video: VideoMode;
12
+ readonly out: string;
13
+ }
14
+ export type VideoMode = 'off' | 'on' | 'failed';
15
+ export declare class E2e {
16
+ static readonly DIRS = "ACDE_TEST_DIRS";
17
+ static readonly DESKTOP = "ACDE_TEST_DESKTOP";
18
+ static readonly HEADLESS = "ACDE_TEST_HEADLESS";
19
+ static readonly RESULTS = "ACDE_TEST_RESULTS";
20
+ static readonly FILE = "ACDE_TEST_FILE";
21
+ static readonly TIMEOUT = "ACDE_TEST_TIMEOUT";
22
+ static readonly TRACE = "ACDE_TEST_TRACE";
23
+ static readonly UPDATE = "ACDE_TEST_UPDATE";
24
+ static readonly MARKS = "ACDE_TEST_MARKS";
25
+ static readonly PATTERN = "ACDE_TEST_PATTERN";
26
+ static readonly RETRIES = "ACDE_TEST_RETRIES";
27
+ static readonly VIDEO = "ACDE_TEST_VIDEO";
28
+ static readonly OUT = "ACDE_TEST_OUT";
29
+ static readonly BUILD: string;
30
+ static readonly TIMEOUT_MS = 60000;
31
+ static readonly SIZE = "1280x800";
32
+ static env(settings: E2eSettings): Record<string, string>;
33
+ static read(env?: NodeJS.ProcessEnv, cwd?: string): E2eSettings;
34
+ static mark(kind: 'registered' | 'ran', name: string, env?: NodeJS.ProcessEnv): void;
35
+ static selects(pattern: string | undefined, name: string): boolean;
36
+ static unselected(marks: string): boolean;
37
+ static project(from: string): string | null;
38
+ static slug(text: string): string;
39
+ }
@@ -0,0 +1,24 @@
1
+ import net from 'node:net';
2
+ export type Message = Readonly<Record<string, unknown>>;
3
+ export declare class Lines {
4
+ static read(socket: net.Socket, line: (message: Message) => void, bad?: (text: string) => void): void;
5
+ static write(socket: net.Socket, message: Message): void;
6
+ }
7
+ export declare class DevClient {
8
+ #private;
9
+ static readonly TIMEOUT_MS = 30000;
10
+ static readonly RETRY_MS = 50;
11
+ static readonly CLOSE_MS = 1000;
12
+ readonly closed: Promise<void>;
13
+ /** Events acdert sends on its own (`{ type: 'event', event, ... }`), only to the connection that said hello as acde dev. */
14
+ onEvent: (message: Message) => void;
15
+ private constructor();
16
+ static endpoint(pid?: number): string;
17
+ static prepare(endpoint: string): void;
18
+ static connect(endpoint: string, timeoutMs?: number): Promise<DevClient>;
19
+ static reach(endpoint: string, alive: () => boolean, waiting?: () => void, waitMs?: number): Promise<DevClient | null>;
20
+ get ended(): boolean;
21
+ send(message: Message): void;
22
+ request(op: string, args?: Readonly<Record<string, unknown>>): Promise<unknown>;
23
+ close(): void;
24
+ }
@@ -0,0 +1,5 @@
1
+ export declare const SKIPPED: Set<string>;
2
+ export declare const E2E_FILE: RegExp;
3
+ export declare function contains(dir: string, path: string): boolean;
4
+ export declare function up<T>(from: string, found: (dir: string) => T | null | undefined | false): T | null;
5
+ export declare function slug(text: string): string;
@@ -0,0 +1,20 @@
1
+ export type PmName = 'bun' | 'npm' | 'pnpm' | 'yarn';
2
+ export declare class PackageManager {
3
+ #private;
4
+ static readonly NAMES: readonly PmName[];
5
+ static readonly LOCKS: readonly (readonly [string, PmName])[];
6
+ static readonly RUNTIMES: Readonly<Record<string, PmName>>;
7
+ readonly name: PmName;
8
+ readonly at: string | null;
9
+ constructor(name: PmName, at?: string | null);
10
+ static named(name: string): PackageManager;
11
+ static invoking(): PackageManager;
12
+ static of(dir: string): PackageManager;
13
+ get runtime(): 'bun' | 'node';
14
+ version(): string | null;
15
+ get install(): string[];
16
+ run(script: string): string[];
17
+ exec(pkg: string, args: readonly string[]): string[];
18
+ static manifest(dir: string, dep: string): string | null;
19
+ static bin(dir: string, name: string, deps: ReadonlySet<string>): string | null;
20
+ }
@@ -0,0 +1,49 @@
1
+ import { type ChildProcess, type StdioOptions } from 'node:child_process';
2
+ import type { Env } from './sockets.ts';
3
+ export type { Env };
4
+ export interface SpawnOptions {
5
+ readonly cwd?: string;
6
+ readonly env?: Env;
7
+ readonly stdio?: StdioOptions;
8
+ }
9
+ export interface Child {
10
+ readonly process: ChildProcess;
11
+ readonly pid: number;
12
+ readonly exited: Promise<number>;
13
+ readonly gone: Promise<number>;
14
+ kill(signal?: NodeJS.Signals): void;
15
+ }
16
+ export interface RuntimeProbe {
17
+ readonly level: number;
18
+ readonly said: string;
19
+ readonly stderr: string;
20
+ readonly failed: string | null;
21
+ }
22
+ export interface Captured {
23
+ readonly code: number | null;
24
+ readonly stdout: string;
25
+ readonly stderr: string;
26
+ readonly error: string | null;
27
+ readonly timedOut: boolean;
28
+ }
29
+ export declare class Runtime {
30
+ #private;
31
+ static readonly bun: boolean;
32
+ static readonly CONDITIONS: string[];
33
+ static readonly KILL_MS = 5000;
34
+ static readonly VERSION_MS = 10000;
35
+ static spawn(argv: readonly string[], options?: SpawnOptions): Child;
36
+ static noDisplay(env?: Env, platform?: NodeJS.Platform): string | null;
37
+ static killTree(child: Child): void;
38
+ static level(acdert: string, timeout?: number): Promise<RuntimeProbe>;
39
+ static capture(argv: readonly string[], options: SpawnOptions & {
40
+ readonly timeout: number;
41
+ }): Promise<Captured>;
42
+ static readStdin(): Promise<string>;
43
+ static resolve(specifier: string, from: string): string;
44
+ }
45
+ export declare class Jsonc {
46
+ static parse(text: string, file?: string): unknown;
47
+ static strip(text: string): string;
48
+ static errorAt(json: string): number;
49
+ }
@@ -0,0 +1,80 @@
1
+ export interface Session {
2
+ readonly pid: number;
3
+ readonly endpoint: string;
4
+ readonly dirs: readonly string[];
5
+ readonly apps: readonly string[];
6
+ readonly desktop: string | null;
7
+ readonly headless?: boolean;
8
+ readonly test?: boolean;
9
+ readonly options?: Options;
10
+ readonly started: number;
11
+ readonly reloaded?: Reloaded;
12
+ }
13
+ export interface Options {
14
+ readonly desktop: string | null;
15
+ readonly app: string | null;
16
+ }
17
+ export interface Wanted extends Options {
18
+ readonly dirs: readonly string[];
19
+ readonly headless: boolean;
20
+ }
21
+ export interface Asked {
22
+ readonly dirs?: readonly string[] | undefined;
23
+ readonly desktop?: string | undefined;
24
+ readonly app?: string | undefined;
25
+ readonly headless?: boolean | undefined;
26
+ }
27
+ export interface Reloaded {
28
+ readonly console: number;
29
+ readonly network: number;
30
+ }
31
+ export declare class Sessions {
32
+ #private;
33
+ static readonly SETTLE_MS = 1000;
34
+ static readonly RETRY_MS = 50;
35
+ static readonly READS = 3;
36
+ static readonly PROBE_MS = 1000;
37
+ static readonly TEST_ENV = "ACDE_TEST_SESSION";
38
+ static dir(env?: NodeJS.ProcessEnv): string;
39
+ static file(pid: number, dir?: string): string;
40
+ static prepare(dir?: string): string;
41
+ static problem(dir?: string): string | null;
42
+ static socket(pid: number, dir?: string): string;
43
+ static write(session: Session, dir?: string): string;
44
+ static remove(pid: number, dir?: string): void;
45
+ static removeIfCurrent(session: Session, dir: string): void;
46
+ static alive(pid: number): boolean;
47
+ static sameDir(a: string, b: string): boolean;
48
+ static running(sessions: readonly Session[], dirs: readonly string[], self?: number): Session[];
49
+ static pathy(value: string): boolean;
50
+ static desktopProject(value: string, cwd?: string): string | null;
51
+ static desktopDir(value: string, cwd?: string): string | null;
52
+ static wanted(cwd: string, asked: Asked): Wanted;
53
+ static runs(session: Session, wanted: Wanted): boolean;
54
+ static answers(endpoint: string, timeoutMs?: number): Promise<boolean>;
55
+ static live(sessions: readonly Session[], dir?: string): Promise<Session[]>;
56
+ static list(dir?: string): Session[];
57
+ static scan(dir?: string): {
58
+ sessions: Session[];
59
+ busy: boolean;
60
+ };
61
+ static find(cwd: string, pid?: number, say?: (line: string) => void, dir?: string): Promise<Session>;
62
+ static pick(listed: readonly Session[], cwd: string, pid?: number, say?: (line: string) => void, dir?: string): Session;
63
+ static what(session: Session): string;
64
+ static describe(session: Session): string;
65
+ }
66
+ export interface Holder {
67
+ readonly pid: number;
68
+ readonly dir: string;
69
+ }
70
+ export declare class Claims {
71
+ #private;
72
+ static readonly NAME: RegExp;
73
+ static readonly TRIES = 20;
74
+ static file(project: string, dir?: string): string;
75
+ static beacon(pid: number, started: number, dir?: string): string;
76
+ static take(projects: readonly string[], started: number, dir?: string): Promise<Claims | Holder>;
77
+ static sweep(file: string): void;
78
+ private constructor();
79
+ release(): void;
80
+ }
@@ -0,0 +1,4 @@
1
+ export type Env = Readonly<Record<string, string | undefined>>;
2
+ export declare const WINDOWS_PATH_MAX = 107;
3
+ export declare function socketDir(env?: Env, platform?: string): string;
4
+ export declare function socketPath(port: number, env?: Env, platform?: string): string;
@@ -0,0 +1,25 @@
1
+ export declare const NODE_MINIMUM: readonly [number, number]
2
+ export declare const BUN_MINIMUM: readonly [number, number]
3
+ export declare function packageRoot(): string
4
+ export declare function runtime(): 'bun' | 'node'
5
+ export declare function installDir(env?: Record<string, string | undefined>): string
6
+ export declare function installed(root?: string): boolean
7
+ export declare function which(name: string, env?: Record<string, string | undefined>): string | null
8
+ export declare function acdertBeside(root?: string): string | null
9
+ export interface FoundAcdert {
10
+ readonly path: string | null
11
+ readonly from: 'ACDERT' | 'install' | 'PATH' | null
12
+ readonly problem?: string
13
+ }
14
+ export declare function findAcdert(root?: string, env?: Record<string, string | undefined>): FoundAcdert
15
+ export declare function requireAcdert(root?: string, env?: Record<string, string | undefined>): string
16
+ export declare function atLeast(version: string, minimum: readonly [number, number]): boolean
17
+ export declare function runtimes(env?: Record<string, string | undefined>): { bun: string | null; node: string | null }
18
+ export declare function cliFile(root?: string): string
19
+ export declare function cliRuntime(root?: string): string
20
+ export declare function cliEnv(
21
+ exe: string,
22
+ env?: Record<string, string | undefined>,
23
+ platform?: NodeJS.Platform,
24
+ ): Record<string, string | undefined>
25
+ export declare function run(args: readonly string[], exe?: string): Promise<number>
@@ -0,0 +1 @@
1
+ const _0x2338a4=_0x4930;(function(_0x2ebb42,_0x5a0822){const _0x1c09dc=_0x4930,_0x4f13ec=_0x2ebb42();while(!![]){try{const _0x41b4f6=-parseInt(_0x1c09dc(0x1c0))/0x1+-parseInt(_0x1c09dc(0x1e3))/0x2+parseInt(_0x1c09dc(0x1c7))/0x3+parseInt(_0x1c09dc(0x1b8))/0x4*(-parseInt(_0x1c09dc(0x1d1))/0x5)+parseInt(_0x1c09dc(0x1b9))/0x6+parseInt(_0x1c09dc(0x1b0))/0x7*(parseInt(_0x1c09dc(0x1e1))/0x8)+parseInt(_0x1c09dc(0x1ac))/0x9*(-parseInt(_0x1c09dc(0x1cb))/0xa);if(_0x41b4f6===_0x5a0822)break;else _0x4f13ec['push'](_0x4f13ec['shift']());}catch(_0x22b5a1){_0x4f13ec['push'](_0x4f13ec['shift']());}}}(_0x1546,0xab7fb));import{spawn as _0xdbb0dd,spawnSync as _0x320ecf}from'node:child_process';import{existsSync as _0x385eb3,statSync as _0x49d6ca}from'node:fs';import{constants as _0x5a168f,homedir as _0x579671}from'node:os';function _0x1546(){const _0x44cc15=['zMLUza','u0Lhsu5u','DgvZDa','mtG5CgTXAM1d','AM9PBG','CgfJA2fNzs5QC29U','lcb3AgLJAcb0AguGywnKzsbPBNn0ywXSzxiGChv0CYb0AgvYztOGCNvUihrOzsbPBNn0ywXSzxiGywDHAw4Sia','Aw5ZDgfSBa','C3jJ','BM9Kzq','ChjVyMXLBq','ndC4ngX3weDwta','nJe1nJu4oe5zANb6zq','ls12zxjZAw9U','C2v0iefdrevsvcb0BYbHBIbHy2rLCNqGyMLUyxj5lcbVCIbWDxqGywnKzxj0ig9UifbbveG','lKnpttSUrvHfoY5cqvq7lKnnra','zw5KC1DPDgG','zxHPDa','qunervju','mtuWotGYBg9xAuXY','ywnKzsbKzxyGBMvLzhmGDgHLierVCgfTzsbYDw50Aw1LicHHy2rLCNqPigfUzcbMB3vUzcbUB25LoIa','zxjYB3i','AxngAwXL','C3rKB3v0','A2LSBa','DxrMoa','mZm1nZGWmvbjweDgzG','ywnKzwjPBI1KyMC','y2XPlMPZ','C2LNBMfSCW','nJm3nJCWqK15z2ft','ywnKzxj0','zMLSDgvY','uefusa','C3rKzxjY','yNvU','mJq4mgzLqKnwvG','Cgf0Aa','C3bSAxq','zgLZDa','ywnKzsbUzwvKCYboB2rLlMPZia','ktOGDxbKyxrLigL0icHODhrWCZOVl25VzgvQCY5VCMCP','BM8G','ywnKztOG','oIbUBYbZDwnOigzPBgu7ihbVAw50iefdrevsvcbHDcbHBIbHy2rLCNqGyMLUyxj5lcbVCIb1BNnLDcbPDa','D3jPDgu','BwfW','D2LUmZi','u0Lhvevstq','BgLI','zxHLy1bHDgG','ig9Yig5LD2vYicH0AgLZigLZia','mJC4oty4s3j6qMzU','ktOGDxbKyxrLigL0icHIDw4GDxbNCMfKzsWGB3iGAhr0Chm6lY9IDw4UC2GP','mtiZotKWnMTctxLXrW','lMv4zq','y2XPlNrZ','CgXHDgzVCM0','DMvYC2LVBNm','lMfJzgu','icHHy2rLigrVy3rVCIbJAgvJA3mGDgHLihDOB2XLihnLDhvWkq','u0Lhsfvq','Dg9vChbLCKnHC2u','ChjVy2vZCY52zxjZAw9UCY5IDw4GpYaNjYa6ihbYB2nLC3mUDMvYC2LVBNmUBM9Kzq','mtq0y3botfDv'];_0x1546=function(){return _0x44cc15;};return _0x1546();}import{basename as _0x41b54b,delimiter as _0x31833d,dirname as _0xbce53f,join as _0x2d5c7f}from'node:path';import{fileURLToPath as _0x69a970}from'node:url';var _0x38c379=_0xbce53f(_0x69a970(import.meta.url)),_0x19a68a=process[_0x2338a4(0x1e6)]===_0x2338a4(0x1dc),_0x328e37=_0x19a68a?_0x2338a4(0x1e4):'',_0xa29449=[0x16,0x3],_0x5a7c55=[0x1,0x4];function _0x3a6717(){return _0x38c379;}function _0x5640b3(){const _0x59897f=_0x2338a4;return process[_0x59897f(0x1e7)]['bun']?_0x59897f(0x1d0):_0x59897f(0x1b6);}function _0x4bf819(_0x57e6c7=process.env){const _0x9c611e=_0x2338a4;return _0x57e6c7['ACDE_INSTALL']||_0x2d5c7f(_0x579671(),_0x9c611e(0x1e8));}function _0x5672ec(_0x3b846a=_0x38c379){const _0x20f8b9=_0x2338a4;return _0x41b54b(_0xbce53f(_0x3b846a))===_0x20f8b9(0x1de)&&_0x385eb3(_0x2d5c7f(_0x3b846a,'..','acde-api',_0x20f8b9(0x1b2)));}function _0x2dd4c4(_0x3e0244,_0x237736=process.env){const _0x40e35a=_0x2338a4;let _0x434766=_0x19a68a&&!/\.[^\\/.]+$/[_0x40e35a(0x1af)](_0x3e0244)?(_0x237736['PATHEXT']||_0x40e35a(0x1bc))['split'](';')[_0x40e35a(0x1cd)](Boolean):[''];for(let _0x42ca54 of(_0x237736['PATH']||_0x237736['Path']||'')['split'](_0x31833d)){if(!_0x42ca54)continue;for(let _0x21e1e9 of _0x434766){let _0x21dbc5=_0x2d5c7f(_0x42ca54,_0x3e0244+_0x21e1e9);try{if(_0x49d6ca(_0x21dbc5)[_0x40e35a(0x1c3)]())return _0x21dbc5;}catch{}}}return null;}var _0x291999=[_0x2338a4(0x1c8),_0x2338a4(0x1cc)];function _0x35105c(_0x25e10c=_0x38c379){const _0x596684=_0x2338a4;if(!_0x5672ec(_0x25e10c))return null;let _0x230430=_0x291999[_0x596684(0x1db)](_0x4b97fd=>_0x2d5c7f(_0x25e10c,'..','..','bin',''+_0x4b97fd+_0x328e37));return _0x230430['find'](_0x16b425=>_0x385eb3(_0x16b425))??_0x230430[0x0];}function _0x34948b(_0x5576ff=_0x38c379,_0x4f359f=process.env){const _0x179749=_0x2338a4;let _0x2f81be=_0x4f359f[_0x179749(0x1bf)];if(_0x2f81be){if(_0x385eb3(_0x2f81be))return{'path':_0x2f81be,'from':_0x179749(0x1bf)};let _0x2fff5d=/[\\/]/[_0x179749(0x1af)](_0x2f81be)?null:_0x2dd4c4(_0x2f81be,_0x4f359f);if(_0x2fff5d)return{'path':_0x2fff5d,'from':_0x179749(0x1bf)};return{'path':null,'from':_0x179749(0x1bf),'problem':'ACDERT='+_0x2f81be+_0x179749(0x1d9)};}let _0x5c66ea=_0x35105c(_0x5576ff);if(_0x5c66ea&&_0x385eb3(_0x5c66ea))return{'path':_0x5c66ea,'from':_0x179749(0x1b4)};let _0x36d55a=_0x291999['map'](_0x1a5b5f=>_0x2dd4c4(''+_0x1a5b5f+_0x328e37,_0x4f359f))[_0x179749(0x1ad)](Boolean);if(_0x36d55a)return{'path':_0x36d55a,'from':_0x179749(0x1ce)};return{'path':null,'from':null,'problem':_0x179749(0x1c1)+(_0x5c66ea?_0x179749(0x1d7)+_0x5c66ea+_0x179749(0x1b3):'')+_0x179749(0x1bb)};}function _0x5b111a(_0xd0b13d=_0x38c379,_0x130b9c=process.env){const _0x5ef69f=_0x2338a4;let _0x291b3f=_0x34948b(_0xd0b13d,_0x130b9c);if(_0x291b3f[_0x5ef69f(0x1d2)])return _0x291b3f[_0x5ef69f(0x1d2)];throw Error(_0x291b3f[_0x5ef69f(0x1b7)]+_0x5ef69f(0x1a8));}function _0x362aa7(_0x78051e,_0xec4f00){const _0x5395b5=_0x2338a4;let [_0x63d7ca,_0x25efb7]=_0x78051e[_0x5395b5(0x1d3)]('.')[_0x5395b5(0x1db)](Number),[_0x85ec77,_0x194dd8]=_0xec4f00;return _0x63d7ca>_0x85ec77||_0x63d7ca===_0x85ec77&&_0x25efb7>=_0x194dd8;}function _0x17d827(_0x86fee8,_0x51a684,_0xfded0c,_0x2a612f){const _0x402816=_0x2338a4;let _0x5e7e5f=_0x2dd4c4(''+_0x86fee8+_0x328e37,_0x2a612f),_0x43adff=_0x5e7e5f?_0x320ecf(_0x5e7e5f,_0x51a684,{'encoding':_0x402816(0x1c6)}):null;return _0x43adff?.['status']===0x0&&_0x362aa7(_0x43adff[_0x402816(0x1c4)]['trim'](),_0xfded0c)?_0x5e7e5f:null;}function _0x447083(_0x3fac14=process.env){const _0x4ee3bd=_0x2338a4;if(process[_0x4ee3bd(0x1e7)][_0x4ee3bd(0x1d0)]){let _0x53166b=_0x17d827(_0x4ee3bd(0x1b6),['-p',_0x4ee3bd(0x1ab)],_0xa29449,_0x3fac14);return{'bun':process[_0x4ee3bd(0x1df)],'node':_0x53166b};}return{'bun':_0x17d827(_0x4ee3bd(0x1d0),[_0x4ee3bd(0x1ba)],_0x5a7c55,_0x3fac14),'node':process[_0x4ee3bd(0x1df)]};}function _0x54cf23(_0x46bd02=_0x38c379){const _0x599f4c=_0x2338a4;return[_0x2d5c7f(_0x46bd02,_0x599f4c(0x1d4),_0x599f4c(0x1c9)),_0x2d5c7f(_0x46bd02,_0x599f4c(0x1b5),_0x599f4c(0x1e5))]['find'](_0x3f1bb2=>_0x385eb3(_0x3f1bb2));}function _0x4854b9(_0x38bbee=_0x38c379){const _0x3a8e0a=_0x2338a4;if(process[_0x3a8e0a(0x1e7)][_0x3a8e0a(0x1d0)])return process['execPath'];if(_0x54cf23(_0x38bbee)?.[_0x3a8e0a(0x1bd)]('.ts'))return _0x2dd4c4('bun')??process[_0x3a8e0a(0x1df)];return process[_0x3a8e0a(0x1df)];}function _0x337840(_0x5a5611,_0x2793fc=process.env,_0x1e889e=process[_0x2338a4(0x1e6)]){const _0x3ff291=_0x2338a4;let _0x2dda87={..._0x2793fc},_0x133b55=_0x4ec46f=>_0x1e889e==='win32'?_0x4ec46f[_0x3ff291(0x1aa)]()===_0x3ff291(0x1ce):_0x4ec46f===_0x3ff291(0x1ce),_0x155afc=Object['keys'](_0x2dda87)[_0x3ff291(0x1cd)](_0x133b55),_0x3ed153=_0x155afc['length']>0x0?_0x2dda87[_0x155afc['at'](-0x1)]:void 0x0;for(let _0x287f42 of _0x155afc)delete _0x2dda87[_0x287f42];return{..._0x2dda87,'PATH':''+_0xbce53f(_0x5a5611)+_0x31833d+(_0x3ed153||''),'ACDE_HOST_RUNTIME':_0x2793fc['ACDE_HOST_RUNTIME']||_0x5640b3()};}function _0x55f2b6(){const _0x43f74b=_0x2338a4;if(process[_0x43f74b(0x1e7)]['bun']){if(!_0x362aa7(process['versions'][_0x43f74b(0x1d0)],_0x5a7c55))throw Error('acde\x20needs\x20Bun\x20'+_0x5a7c55[_0x43f74b(0x1b1)]('.')+_0x43f74b(0x1e0)+process['versions'][_0x43f74b(0x1d0)]+_0x43f74b(0x1e2));return;}if(!_0x362aa7(process[_0x43f74b(0x1e7)]['node'],_0xa29449))throw Error(_0x43f74b(0x1d5)+_0xa29449[_0x43f74b(0x1b1)]('.')+_0x43f74b(0x1e0)+process['version']+_0x43f74b(0x1d6));}function _0x29fa94(_0x10e48b,_0x349878=_0x4854b9()){const _0x56e47a=_0x2338a4;_0x55f2b6();let _0x46fece=_0xdbb0dd(_0x349878,[_0x54cf23(),..._0x10e48b],{'stdio':'inherit','env':_0x337840(_0x349878)});if(_0x19a68a)process['on']('SIGINT',()=>{});else{for(let _0x1b4f7b of[_0x56e47a(0x1ae),_0x56e47a(0x1dd),_0x56e47a(0x1a9)])process['on'](_0x1b4f7b,()=>_0x46fece[_0x56e47a(0x1c5)](_0x1b4f7b));}return new Promise(_0x691637=>{const _0x29456d=_0x56e47a;_0x46fece['on'](_0x29456d(0x1c2),_0x549fe8=>{const _0x3cb2a5=_0x29456d;process[_0x3cb2a5(0x1cf)][_0x3cb2a5(0x1da)](_0x3cb2a5(0x1d8)+_0x349878+':\x20'+_0x549fe8['message']+'\x0a'),_0x691637(0x1);}),_0x46fece['on'](_0x29456d(0x1be),(_0x12a57b,_0x58e0e2)=>_0x691637(_0x12a57b??0x80+(_0x5a168f[_0x29456d(0x1ca)][_0x58e0e2]??0x0)));});}function _0x4930(_0x32b5dd,_0x32a931){_0x32b5dd=_0x32b5dd-0x1a8;const _0x154646=_0x1546();let _0x4930dd=_0x154646[_0x32b5dd];if(_0x4930['YPKNsM']===undefined){var _0x4d166e=function(_0x6443c9){const _0x3ee0c3='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';let _0x4fa001='',_0xdbb0dd='';for(let _0x320ecf=0x0,_0x385eb3,_0x49d6ca,_0x5a168f=0x0;_0x49d6ca=_0x6443c9['charAt'](_0x5a168f++);~_0x49d6ca&&(_0x385eb3=_0x320ecf%0x4?_0x385eb3*0x40+_0x49d6ca:_0x49d6ca,_0x320ecf++%0x4)?_0x4fa001+=String['fromCharCode'](0xff&_0x385eb3>>(-0x2*_0x320ecf&0x6)):0x0){_0x49d6ca=_0x3ee0c3['indexOf'](_0x49d6ca);}for(let _0x579671=0x0,_0x41b54b=_0x4fa001['length'];_0x579671<_0x41b54b;_0x579671++){_0xdbb0dd+='%'+('00'+_0x4fa001['charCodeAt'](_0x579671)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0xdbb0dd);};_0x4930['VATIev']=_0x4d166e,_0x4930['ODZjIz']={},_0x4930['YPKNsM']=!![];}const _0x204c10=_0x154646[0x0];_0x4930['ZLeRdh']!==_0x204c10&&(_0x4930['ODZjIz']={},_0x4930['ZLeRdh']=_0x204c10);const _0x513a45=_0x4930['ODZjIz'][_0x32b5dd];return _0x513a45===undefined?(_0x4930dd=_0x4930['VATIev'](_0x4930dd),_0x4930['ODZjIz'][_0x32b5dd]=_0x4930dd):_0x4930dd=_0x513a45,_0x4930dd;}export{_0x5a7c55 as BUN_MINIMUM,_0xa29449 as NODE_MINIMUM,_0x291999 as RUNTIMES,_0x35105c as acdertBeside,_0x362aa7 as atLeast,_0x337840 as cliEnv,_0x54cf23 as cliFile,_0x4854b9 as cliRuntime,_0x34948b as findAcdert,_0x4bf819 as installDir,_0x5672ec as installed,_0x3a6717 as packageRoot,_0x5b111a as requireAcdert,_0x29fa94 as run,_0x5640b3 as runtime,_0x447083 as runtimes,_0x2dd4c4 as which};
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "acde",
3
+ "version": "0.0.10",
4
+ "description": "The acde developer CLI (wrangler to acdert's workerd): acde new / check / build / install / dev. Builds a web app (any framework) or a desktop into a package acdert runs; the preload that puts an app backend's every listen on a unix socket",
5
+ "license": "UNLICENSED",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "http://gitea.dopamine/AC/acdebin-dbg",
9
+ "directory": "cli"
10
+ },
11
+ "type": "module",
12
+ "engines": {
13
+ "node": ">=22.3",
14
+ "bun": ">=1.4"
15
+ },
16
+ "exports": {
17
+ "./launcher": {
18
+ "types": "./launcher.d.mts",
19
+ "default": "./launcher.mjs"
20
+ },
21
+ "./driver": {
22
+ "types": "./dist/types/driver/index.d.ts",
23
+ "default": "./dist/driver/index.js"
24
+ },
25
+ "./test": {
26
+ "types": "./dist/types/e2e/index.d.ts",
27
+ "default": "./dist/e2e/index.js"
28
+ },
29
+ "./package.json": "./package.json"
30
+ }
31
+ }
@@ -0,0 +1,114 @@
1
+ ---
2
+ name: acde
3
+ description: Build, run, debug, and test apps and desktops for Dopame OS with the acde CLI and its runtime, acdert. Use when a project has an acde.config.jsonc, imports an acde: module (acde:fs, acde:window, ...) or depends on @dopame/acde-api, and when the user mentions acde, acdert, or Dopame OS, or asks to create, run, inspect, screenshot, drive, or end-to-end test a Dopame app or desktop.
4
+ ---
5
+
6
+ # acde
7
+
8
+ A Dopame OS app is a web project: HTML, CSS, and JS in any framework, optionally with a Bun or Node.js backend. `acde` is the developer CLI (create, check, build, run, inspect, test). `acdert` is the runtime that draws the desktop and the apps; `acde dev` starts it. The relation is wrangler to workerd.
9
+
10
+ This skill ships inside acde and describes the version it came with. When it and the CLI disagree, the CLI is right: `acde --help` prints every command, and `acde <command> --help` that command's options.
11
+
12
+ ## Check the environment first
13
+
14
+ Run `acde doctor`, in the project directory when there is one. It checks what follows and more (the runtime draws a test frame on the GPU), prints one line per check (`ok`, `warn`, `error` or `skip`) with a `fix:` line under each problem, and exits with code 1 on an error. Run it again whenever `acde dev`, `acde test` or the MCP `start` does not come up, before guessing. `acde doctor --fix` then fixes what acde may (the skill, `.acde/` in `.gitignore`, the sessions directory) and asks before what downloads, installs or stops something; without a terminal it skips those unless given `--yes`, which you pass only when the user agreed. Approvals, GPU drivers and the project's code it leaves to you and the user. See [Check the setup](references/guide/doctor.md).
15
+
16
+ 1. `acde` must be on PATH. If it is not, follow [Install](references/start/install.md).
17
+ 2. `acde dev` and `acde test` need the runtime, acdert. The acde installer sets up the acdert release that acde pairs with next to it; acde finds `ACDERT` (a path to the binary) first, then that one, then `acdert` on PATH (in the Dopame virtual machine it is already there). If `acde doctor` finds none, or one that does not run, run the acde installer again (`acde doctor --fix --yes` does that for an installed acde); only if it cannot run on this machine, offer the steps in [Install the runtime by hand](references/start/install.md#install-the-runtime-by-hand), and use them only if the user agrees. Get it from nowhere else. Without it, `acde new`, `acde check`, and `acde build` still work, and `acde dev` says what is missing.
18
+ 3. A project runs on Bun when its package manager is bun, and on Node.js with npm, pnpm, or yarn. `acde test` needs Bun.
19
+
20
+ ## What is not like a browser
21
+
22
+ acdert has its own renderer and is not Chromium. Standard APIs follow the spec, and what the runtime lacks is absent rather than faked. Before relying on anything beyond the DOM, `fetch`, and storage, read [Web compatibility](references/reference/web.md). The mistakes to avoid:
23
+
24
+ - **No modules from a CDN.** ES modules load only from the app's own files (`import('https://…')` fails): bundle every code dependency. Images, stylesheets and fonts can come from other hosts, as in a browser.
25
+ - **Missing APIs**: Web Workers, Service Workers, `crypto.subtle`, WebGL, OffscreenCanvas, fullscreen, pointer lock. `confirm()` returns `false` and `prompt()` returns `null`; build dialogs in the page.
26
+ - **System access goes through `acde:` modules only** (`import { fs } from 'acde:fs'`), and only for capabilities the config requests. There is no global object. Importing a module that was not requested fails. See [Capabilities](references/guide/capabilities.md).
27
+ - **The backend has no TCP port.** A backend's `listen(port)` becomes a unix socket, and the page reaches it with a same-origin `fetch('/api/…')`. Do not `curl localhost`. See [Backend](references/guide/backend.md).
28
+ - **Developer tools.** In 0.0.9 there are none: use the commands below to look at pages; after 0.0.9, F12 in an `acde dev` window or `acde devtools` opens the DevTools of Chrome or Edge on the page, over the Chrome DevTools Protocol. See [acde dev](references/guide/dev.md#devtools).
29
+ - **Platforms differ.** An app that requires a capability the platform lacks does not start there; one that lists it as optional gets `null` from `load()`. See [Platform support](references/reference/platforms.md).
30
+
31
+ ## The working loop
32
+
33
+ Create a project without prompts (`--yes` asks nothing; without it `acde new` waits for answers in a terminal):
34
+
35
+ ```sh
36
+ acde new my-app --template html --label "My App" --yes
37
+ ```
38
+
39
+ Run it. `acde dev` builds, starts acdert, and rebuilds and reloads on every change. It does not exit: start it in the background and keep it running while you work; `acde stop` ends it. Add `--headless` when no window is needed; pages still render and screenshots still work. It is ready when `acde webs`, run from the project directory, lists the app's page.
40
+
41
+ ```sh
42
+ acde dev --headless
43
+ ```
44
+
45
+ Look at what the app does, from another shell in the project directory:
46
+
47
+ ```sh
48
+ acde inspect # the screen as text, every visible element with a ref
49
+ acde query 'form button' # elements by CSS selector, hidden ones too, each with a ref
50
+ acde act w1.15 click # act on a ref: click, type, key, drag, ...
51
+ acde shot my-app -o shot.png # a PNG of the app's window; read it to see the page
52
+ acde console --level errors # console.error and uncaught errors
53
+ acde network --failed # requests that failed
54
+ acde eval my-app 'document.title' # run code in the page, print JSON
55
+ ```
56
+
57
+ After a change, wait for the rebuild line in the `acde dev` output, then check `acde console --level errors` and look at the page (`acde inspect` or `acde shot`) before saying it works. A failed build prints one error line and the window keeps the last good build, so a page that did not change may mean the build failed.
58
+
59
+ Write end-to-end tests in `*.e2e.ts` with the Playwright-like API from `acde/test`, and run them with `acde test`: each test gets its own isolated headless session. See [Testing](references/guide/testing.md).
60
+
61
+ Before handing over: `acde check` (config and entry), `acde build` (the package in `.acde/`), and `acde test` if the project has tests.
62
+
63
+ ## Rules
64
+
65
+ - Edit `acde.config.jsonc`, never the generated `.acde/package.json`.
66
+ - Request a capability in the config before importing its module.
67
+ - Declaring a capability grants it. Only the camera and the microphone ask the user, the first time a page calls `getUserMedia()`; the call waits for the answer: run `acde permissions`, then `acde allow` or `acde deny`. Answering is the user's decision, and it is kept for the app: allow only what the user asked for or agreed to, and say what you allowed. See [Capabilities](references/guide/capabilities.md#camera-and-microphone).
68
+ - In `acde:fs` a root is an id, not a path. `"fs": true` gives the app its own folder, the root `private`: keep the app's working files there. See [Files and folders](references/guide/files.md).
69
+ - An app that lists `services` only runs in the desktop that provides them: `acde dev` in the app project alone does not start it, `acde dev --desktop <dir>` does. See [Services](references/guide/services.md).
70
+ - Keep `.acde/` out of git.
71
+ - In scripts and tests, select elements by role and name (the semantic tree), not by coordinates.
72
+ - An MCP server with the same tools is available as `acde mcp`; the CLI commands above need no setup, so prefer them unless the user has set MCP up. See [MCP](references/guide/mcp.md).
73
+
74
+ ## References
75
+
76
+ Read the one that matches the task; each is self-contained.
77
+
78
+ Getting started:
79
+
80
+ - [Install](references/start/install.md): install, upgrade, uninstall, the runtime, and the Dopame desktop
81
+ - [First app](references/start/first-app.md): from `acde new` to a capability and a build
82
+ - [Project layout](references/start/project.md): files, config versus manifest, build output, the SDK
83
+
84
+ Guides:
85
+
86
+ - [Configuration](references/guide/config.md): `acde.config.jsonc` for apps and desktops
87
+ - [Frameworks](references/guide/frameworks.md): how React, Vue, Next.js, Nuxt, SvelteKit, Astro, and others are built
88
+ - [Assets and icons](references/guide/assets.md): `public/`, icons
89
+ - [Backend](references/guide/backend.md): `export default { fetch }` or any server that listens
90
+ - [Capabilities](references/guide/capabilities.md): requesting and importing `acde:` modules
91
+ - [Windows](references/guide/window.md): `acde:window`: title, menus, closing, shortcuts
92
+ - [Files and folders](references/guide/files.md): `acde:fs` and the file pickers
93
+ - [Opening apps](references/guide/open.md): `acde:open`, default apps, file handlers
94
+ - [Desktops](references/guide/desktop.md): writing a desktop instead of an app
95
+ - [Services](references/guide/services.md): desktop services and the capabilities they provide
96
+ - [acde dev](references/guide/dev.md): what runs, reloading, several projects, `--desktop`
97
+ - [Check the setup](references/guide/doctor.md): `acde doctor`, what it checks, what to do about each finding, and what `--fix` repairs
98
+ - [Debugging](references/guide/tools.md): `webs`, `eval`, `shot`, `screen`, `inspect`, `query`, `act`, `console`, `network`, `permissions`, `allow`, `deny`, `revoke`, and `devtools` (after 0.0.9)
99
+ - [Coding agents](references/guide/agents.md): this skill, `acde skills`, where it is installed
100
+ - [MCP](references/guide/mcp.md): `acde mcp` and its tools
101
+ - [Testing](references/guide/testing.md): `acde test`, locators, assertions, screenshots, traces
102
+ - [Local install](references/guide/install.md): `acde install`, `acde uninstall`, where packages are looked up
103
+
104
+ Reference:
105
+
106
+ - [CLI](references/reference/cli.md): every command and option
107
+ - [acde.config.jsonc](references/reference/config.md): every config field
108
+ - [Manifest](references/reference/manifest.md): the `acde` field of a built package
109
+ - [acde: modules](references/reference/modules.md): signatures of every module
110
+ - [Service API](references/reference/service.md): `ServiceFactory` and its context
111
+ - [Testing API](references/reference/testing.md): fixtures, locators, assertions, settings
112
+ - [Web compatibility](references/reference/web.md): storage, network, what is unsupported
113
+ - [Environment variables](references/reference/env.md): acde, the runtime, app backends
114
+ - [Platform support](references/reference/platforms.md): what works on macOS, Windows, Linux, and Dopame OS
@@ -0,0 +1,50 @@
1
+ # Coding agents
2
+
3
+ acde ships a **skill**: instructions and reference files that teach a coding agent (Claude Code, Codex, Cursor, Gemini CLI, and any other that reads the [Agent Skills](https://agentskills.io) format) how to create, run, inspect, and test acde projects. The skill is part of the acde archive, so it always describes the acde you have installed. These docs are generated from the same files.
4
+
5
+ ## Set up with one prompt
6
+
7
+ Paste this into your agent:
8
+
9
+ ```text
10
+ Read https://pkgs.dopame.ai/acde/install.md and follow it to set up acde on this machine.
11
+ ```
12
+
13
+ It installs acde, installs the skill for the agent, and reports what is ready and what is missing.
14
+
15
+ ## Install the skill yourself
16
+
17
+ ```sh
18
+ acde skills install
19
+ ```
20
+
21
+ This links the skill into:
22
+
23
+ - `~/.agents/skills/acde`, the directory shared by agents that follow the common convention (Codex, Cline, Zed, Warp, Pi, and others);
24
+ - the skills directory of every other agent found on this machine, such as `~/.claude/skills/acde` for Claude Code or `~/.cursor/skills/acde` for Cursor.
25
+
26
+ Each one is a link to the skill inside the acde install, so upgrading acde upgrades the skill.
27
+
28
+ | Command | What it does |
29
+ | --- | --- |
30
+ | `acde skills` | Shows where the skill is installed and whether each place is current |
31
+ | `acde skills install` | Installs it for every agent found |
32
+ | `acde skills install --agent claude-code,cursor` | Installs it for these agents, found or not |
33
+ | `acde skills install --dir DIR` | Installs it into `DIR/acde`; for an agent acde does not know, or a project's own skills directory such as `.agents/skills` |
34
+ | `acde skills install --copy` | Copies instead of linking; for agents that cannot follow links. Run it again after upgrading acde |
35
+ | `acde skills remove` | Removes it from everywhere it was installed (add `--dir DIR` for a directory you chose), and the skills directories `acde skills install` created there once they are empty |
36
+ | `acde skills path` | Prints the directory of the skill inside the acde install |
37
+
38
+ `acde skills install` never replaces a directory named `acde` that is not this skill; it stops and names it.
39
+
40
+ ## Agents without skills
41
+
42
+ Point the agent at the skill's entry file. For example, in the project's `AGENTS.md`:
43
+
44
+ ```text
45
+ This is an acde project. Before working on it, read the file SKILL.md in the directory `acde skills path` prints.
46
+ ```
47
+
48
+ ## What the agent can do
49
+
50
+ With an `acde dev` session running, the [debugging commands](tools.md) let an agent read the screen as text, click and type, take screenshots, and read the console and network logs; [`acde test`](testing.md) runs end-to-end tests. The same tools are available over [MCP](mcp.md) for agents that prefer it.