@oharness/server 0.9.3 → 0.11.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 (93) hide show
  1. package/dist/analytics.d.ts +32 -29
  2. package/dist/analytics.js +225 -278
  3. package/dist/analytics.js.map +1 -1
  4. package/dist/i18n.js +500 -64
  5. package/dist/i18n.js.map +1 -1
  6. package/dist/icons.js +1 -0
  7. package/dist/icons.js.map +1 -1
  8. package/dist/main.js +4 -0
  9. package/dist/main.js.map +1 -1
  10. package/dist/model-order.js +1 -0
  11. package/dist/model-order.js.map +1 -1
  12. package/dist/page/client/account.js +570 -27
  13. package/dist/page/client/account.js.map +1 -1
  14. package/dist/page/client/base.js +55 -12
  15. package/dist/page/client/base.js.map +1 -1
  16. package/dist/page/client/browser.js +1 -1
  17. package/dist/page/client/composer.js +802 -59
  18. package/dist/page/client/composer.js.map +1 -1
  19. package/dist/page/client/computer.d.ts +27 -0
  20. package/dist/page/client/computer.js +358 -0
  21. package/dist/page/client/computer.js.map +1 -0
  22. package/dist/page/client/dialogs.js +168 -6
  23. package/dist/page/client/dialogs.js.map +1 -1
  24. package/dist/page/client/events.js +119 -9
  25. package/dist/page/client/events.js.map +1 -1
  26. package/dist/page/client/files.js +86 -1
  27. package/dist/page/client/files.js.map +1 -1
  28. package/dist/page/client/index.js +8 -0
  29. package/dist/page/client/index.js.map +1 -1
  30. package/dist/page/client/panels.js +14 -10
  31. package/dist/page/client/panels.js.map +1 -1
  32. package/dist/page/client/ripple.d.ts +13 -0
  33. package/dist/page/client/ripple.js +247 -0
  34. package/dist/page/client/ripple.js.map +1 -0
  35. package/dist/page/client/routines.js +432 -45
  36. package/dist/page/client/routines.js.map +1 -1
  37. package/dist/page/client/shell.js +386 -104
  38. package/dist/page/client/shell.js.map +1 -1
  39. package/dist/page/client/state.js +278 -19
  40. package/dist/page/client/state.js.map +1 -1
  41. package/dist/page/client/tasks.d.ts +8 -0
  42. package/dist/page/client/tasks.js +293 -0
  43. package/dist/page/client/tasks.js.map +1 -0
  44. package/dist/page/client/terminal.js +34 -7
  45. package/dist/page/client/terminal.js.map +1 -1
  46. package/dist/page/client/theme.d.ts +17 -0
  47. package/dist/page/client/theme.js +365 -0
  48. package/dist/page/client/theme.js.map +1 -0
  49. package/dist/page/client/transcript.js +196 -8
  50. package/dist/page/client/transcript.js.map +1 -1
  51. package/dist/page/client/usage.js +1 -11
  52. package/dist/page/client/usage.js.map +1 -1
  53. package/dist/page/style.js +745 -76
  54. package/dist/page/style.js.map +1 -1
  55. package/dist/page.js +94 -16
  56. package/dist/page.js.map +1 -1
  57. package/dist/prefs.d.ts +31 -0
  58. package/dist/prefs.js +13 -1
  59. package/dist/prefs.js.map +1 -1
  60. package/dist/remote-crypto.d.ts +78 -0
  61. package/dist/remote-crypto.js +216 -0
  62. package/dist/remote-crypto.js.map +1 -0
  63. package/dist/remote.d.ts +103 -0
  64. package/dist/remote.js +498 -0
  65. package/dist/remote.js.map +1 -0
  66. package/dist/server.d.ts +70 -0
  67. package/dist/server.js +1738 -73
  68. package/dist/server.js.map +1 -1
  69. package/dist/starters.d.ts +92 -0
  70. package/dist/starters.js +213 -0
  71. package/dist/starters.js.map +1 -0
  72. package/dist/suggest.d.ts +42 -0
  73. package/dist/suggest.js +215 -0
  74. package/dist/suggest.js.map +1 -0
  75. package/dist/terminal.d.ts +28 -2
  76. package/dist/terminal.js +45 -3
  77. package/dist/terminal.js.map +1 -1
  78. package/dist/theme-assets.d.ts +39 -0
  79. package/dist/theme-assets.js +109 -0
  80. package/dist/theme-assets.js.map +1 -0
  81. package/dist/theme-store.d.ts +50 -0
  82. package/dist/theme-store.js +124 -0
  83. package/dist/theme-store.js.map +1 -0
  84. package/dist/theme-tools.d.ts +25 -0
  85. package/dist/theme-tools.js +243 -0
  86. package/dist/theme-tools.js.map +1 -0
  87. package/dist/turn-shots.d.ts +43 -0
  88. package/dist/turn-shots.js +80 -0
  89. package/dist/turn-shots.js.map +1 -0
  90. package/dist/user-theme.d.ts +143 -0
  91. package/dist/user-theme.js +510 -0
  92. package/dist/user-theme.js.map +1 -0
  93. package/package.json +2 -2
package/dist/server.d.ts CHANGED
@@ -3,7 +3,9 @@ import type { Session } from "@oharness/engine/agent/session.ts";
3
3
  import { Harness } from "@oharness/engine/harness.ts";
4
4
  import type { PermissionRequest } from "@oharness/engine/agent/permissions.ts";
5
5
  import type { QuestionRequest, QuestionResult } from "@oharness/engine/tools/questions.ts";
6
+ import type { Message } from "@oharness/engine/core/types.ts";
6
7
  import type { SettingsScope } from "@oharness/engine/agent/settings.ts";
8
+ import type { ComputerUsePlugin } from "@oharness/engine/computer/plugin.ts";
7
9
  import type { ScheduleRun } from "@oharness/engine/schedule/scheduler.ts";
8
10
  import type { BrowserTargetFactory, BrowserUsePlugin } from "@oharness/engine";
9
11
  /**
@@ -23,6 +25,29 @@ export interface WebServerOptions {
23
25
  port?: number;
24
26
  /** Defaults to loopback. Changing it publishes agent control to the network. */
25
27
  host?: string;
28
+ /**
29
+ * Remote control through a relay (remote.ts). The Mac dials out; a phone on
30
+ * the same account that this page has allowed can then drive it.
31
+ *
32
+ * Given, it makes remote control something this page offers: a switch in
33
+ * Settings, saved in prefs and off until somebody turns it on. Left out,
34
+ * there is no switch and nothing dials anywhere.
35
+ */
36
+ remote?: {
37
+ /** `wss://…/v1/connect` — `remoteRelay()` says which. */
38
+ relay: string;
39
+ /**
40
+ * On for this run whatever the setting says: a relay named in the
41
+ * environment, as remote control was switched on before it had a setting.
42
+ */
43
+ always?: boolean;
44
+ /**
45
+ * The account token presented to the relay, asked again on every
46
+ * reconnect. Defaults to OHARNESS_REMOTE_TOKEN, else the signed-in
47
+ * OHarness account.
48
+ */
49
+ token?: () => Promise<string | undefined>;
50
+ };
26
51
  /**
27
52
  * How the harness for another project is built.
28
53
  *
@@ -43,6 +68,24 @@ export interface WebServerOptions {
43
68
  */
44
69
  browserTarget?: BrowserTargetFactory;
45
70
  browserUsePlugin?: BrowserUsePlugin;
71
+ /**
72
+ * Computer Use, for the harnesses this server builds. Only the desktop app
73
+ * has one: it ships the native helper and holds the OS grants. Routines are
74
+ * never given it — a run nobody is watching does not get the screen.
75
+ */
76
+ computerUsePlugin?: ComputerUsePlugin;
77
+ /**
78
+ * Restart the app. macOS applies a Screen Recording grant only to a process
79
+ * started after it, so the permission card offers this once it is granted.
80
+ */
81
+ onRelaunch?: () => void;
82
+ /**
83
+ * The app macOS holds the grants for — the one the person has to switch on
84
+ * in System Settings. "OHarness" when packaged; a development run is
85
+ * Electron.app, and a card naming OHarness there sent people to a switch
86
+ * that was already on.
87
+ */
88
+ computerGrantee?: string;
46
89
  /**
47
90
  * Told when a turn starts waiting on a person — once, not again on a replay.
48
91
  * The desktop shell uses it to notify while its window is in the background;
@@ -103,10 +146,37 @@ export interface WebServer {
103
146
  }>;
104
147
  /** Answers `ask_user` from the page, the same way. */
105
148
  readonly questionPrompt: (request: QuestionRequest, signal: AbortSignal) => Promise<QuestionResult>;
149
+ /** Stop a conversation's running turn, as the page's stop button does. */
150
+ interrupt(sessionId: string): void;
106
151
  }
107
152
  export declare function startWebServer(opts: WebServerOptions): Promise<WebServer>;
153
+ /** An upload waiting for the prompt that will carry it. */
154
+ export interface Staged {
155
+ name: string;
156
+ mediaType: string;
157
+ data: Buffer;
158
+ /** When it arrived, for the sweep. */
159
+ at: number;
160
+ }
108
161
  /** One thing the composer's + menu attached to a message. */
109
162
  export interface Reference {
110
163
  kind: "file" | "folder" | "connector" | "plugin" | "skill";
111
164
  value: string;
112
165
  }
166
+ /**
167
+ * The user's message, with what they attached.
168
+ *
169
+ * An image goes to the model as an image. A PDF goes whole, as a document the
170
+ * model reads page by page, when the model reads them (`documents`). A text
171
+ * file is pasted in. Anything else — and every PDF too — is saved in the
172
+ * project, under .oharness/attachments/<session>/, and its path given, so the
173
+ * agent can open it with its own tools: a spreadsheet with Python, a model
174
+ * that takes no PDFs with a PDF tool. Binary files used to be skipped, and
175
+ * the person was left believing the agent had read what it never received.
176
+ */
177
+ /** A user message's text without the attachment lines buildMessage adds to it. */
178
+ export declare function withoutAttachmentNotes(text: string): string;
179
+ export declare function buildMessage(prompt: string, staged: Staged[], opts: {
180
+ documents: boolean;
181
+ saveDir: string;
182
+ }): Promise<Message[]>;