@fungi.computer/oyster 0.13.0 → 0.14.0

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 (52) hide show
  1. package/README.md +30 -15
  2. package/dist/agents.js +2 -1
  3. package/dist/approval-home.js +4 -2
  4. package/dist/boot-host-script.js +1 -1
  5. package/dist/browser/cdp-client.d.ts +1 -1
  6. package/dist/browser/cdp-client.js +73 -37
  7. package/dist/browser/errors.d.ts +2 -0
  8. package/dist/browser/lease-registry.d.ts +5 -1
  9. package/dist/browser/lease-registry.js +2 -6
  10. package/dist/build/candidate-cli.mjs +267 -246
  11. package/dist/build/definition-emission.js +17 -3
  12. package/dist/build/local-build.d.ts +6 -0
  13. package/dist/build/local-build.js +104 -91
  14. package/dist/build/process-group.d.ts +6 -0
  15. package/dist/build/process-group.js +92 -0
  16. package/dist/build.d.ts +1 -1
  17. package/dist/build.js +1 -1
  18. package/dist/embed-metafiles.js +2 -2
  19. package/dist/embed-scripts.js +1 -1
  20. package/dist/git-journal.js +12 -9
  21. package/dist/hello-app-script.js +1 -1
  22. package/dist/host-page-assets.js +1 -1
  23. package/dist/host-page.d.ts +6 -1
  24. package/dist/host-page.js +40 -0
  25. package/dist/host.js +24 -9
  26. package/dist/installation-operations.js +1 -1
  27. package/dist/machine-link/host.js +18 -13
  28. package/dist/pack.d.ts +3 -1
  29. package/dist/pack.js +28 -7
  30. package/dist/page/app-permissions.js +3 -13
  31. package/dist/page-script.js +2 -2
  32. package/dist/standalone/agent-mail.d.ts +38 -11
  33. package/dist/standalone/agent-mail.js +8 -22
  34. package/dist/standalone/agents.d.ts +1 -0
  35. package/dist/standalone/agents.js +30 -5
  36. package/dist/standalone/hello-app.d.ts +4 -1
  37. package/dist/standalone/hello-app.js +67 -22
  38. package/dist/standalone/hello-lesson.d.ts +2 -0
  39. package/dist/standalone/hello-lesson.js +36 -0
  40. package/dist/standalone/local-desktop.d.ts +6 -4
  41. package/dist/standalone/local-desktop.js +39 -20
  42. package/dist/standalone/sign-in-link.d.ts +2 -1
  43. package/dist/standalone/sign-in-link.js +58 -17
  44. package/dist/standalone/try-cli.d.ts +12 -9
  45. package/dist/standalone/try-cli.js +490 -138
  46. package/docs/api/browser.md +24 -7
  47. package/docs/api/pack.md +3 -2
  48. package/docs/api/workers-git.md +2 -2
  49. package/docs/api/workers.md +2 -2
  50. package/docs/site/agent-quickstart.mdx +109 -354
  51. package/examples/standalone/wrangler.jsonc +1 -1
  52. package/package.json +24 -24
@@ -1,9 +1,10 @@
1
1
  import { Cli } from "@fungi.computer/lantern";
2
+ import { type DesktopReadiness } from "./local-desktop.js";
2
3
  import { type SignInLink } from "./sign-in-link.js";
3
4
  export declare const tryUsage = "Usage: oyster try [directory] [--port 8787] [--no-open] [--verbose] [--package <npm spec>]";
4
5
  /**
5
- * Streaming logs and a redrawing spinner cannot share a terminal, so
6
- * --verbose prints plain lines instead of spinners.
6
+ * Streaming logs and interactive progress cannot share a terminal, so
7
+ * --verbose prints plain lines.
7
8
  */
8
9
  export declare function createTryCli(args: readonly string[]): Cli;
9
10
  /** Show a failed `oyster try` as an error with its next step. */
@@ -11,12 +12,13 @@ export declare function reportTryFailure(cause: unknown, ui: Cli): void;
11
12
  /** The injectable effects of `oyster try`; tests replace them. */
12
13
  export type TryEffects = Readonly<{
13
14
  /** Install the scaffolded project's dependencies. */
14
- installDependencies: (directory: string, manager: Manager, verbose: boolean) => Promise<void>;
15
+ installDependencies: (directory: string, manager: Manager, verbose: boolean, signal: AbortSignal) => Promise<void>;
15
16
  /** Start Oyster and resolve once it answers; `stop` ends it. */
16
17
  startServer: (input: {
17
18
  directory: string;
18
19
  port: number;
19
20
  key: string;
21
+ signal: AbortSignal;
20
22
  verbose: boolean;
21
23
  }) => Promise<{
22
24
  stop: () => Promise<void>;
@@ -27,26 +29,27 @@ export type TryEffects = Readonly<{
27
29
  directory: string;
28
30
  url: string;
29
31
  key: string;
32
+ signal: AbortSignal;
30
33
  }) => Promise<number>;
31
- /** Build and install the Tourtois desktop unless it is already there. */
34
+ /** Prepare Tourtois without changing an existing installation or its approval. */
32
35
  installDesktop: (input: {
33
36
  directory: string;
34
37
  url: string;
35
38
  key: string;
36
- }) => Promise<void>;
39
+ signal: AbortSignal;
40
+ }) => Promise<DesktopReadiness>;
37
41
  /** A one-time page that signs the owner in without the key in a URL. */
38
42
  signInLink: (input: {
39
43
  oysterUrl: string;
40
44
  key: string;
45
+ signal: AbortSignal;
41
46
  }) => Promise<SignInLink>;
42
47
  /** Open the browser. */
43
- open: (url: string) => void;
44
- /** Resolve when the user asks to stop. */
45
- interrupted: () => Promise<void>;
48
+ open: (url: string, failed: () => void) => void;
46
49
  /** Check that the port is free. */
47
50
  portFree: (port: number) => Promise<boolean>;
48
51
  }>;
49
52
  export type Manager = "npm" | "pnpm";
50
53
  /** pnpm when it ran this command (`pnpm dlx`), otherwise npm. */
51
54
  export declare function detectManager(userAgent: string | undefined): "pnpm" | "npm";
52
- export declare function tryOyster(args: readonly string[], effects?: TryEffects, ui?: Cli): Promise<void>;
55
+ export declare function tryOyster(args: readonly string[], effects?: TryEffects, ui?: Cli, callerSignal?: AbortSignal): Promise<void>;