@oharness/server 0.1.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.
- package/dist/analytics.d.ts +47 -0
- package/dist/analytics.js +323 -0
- package/dist/analytics.js.map +1 -0
- package/dist/artifacts.d.ts +53 -0
- package/dist/artifacts.js +129 -0
- package/dist/artifacts.js.map +1 -0
- package/dist/canvas.d.ts +28 -0
- package/dist/canvas.js +646 -0
- package/dist/canvas.js.map +1 -0
- package/dist/changes.d.ts +54 -0
- package/dist/changes.js +154 -0
- package/dist/changes.js.map +1 -0
- package/dist/files.d.ts +48 -0
- package/dist/files.js +168 -0
- package/dist/files.js.map +1 -0
- package/dist/i18n.d.ts +15 -0
- package/dist/i18n.js +625 -0
- package/dist/i18n.js.map +1 -0
- package/dist/icons.d.ts +9 -0
- package/dist/icons.js +197 -0
- package/dist/icons.js.map +1 -0
- package/dist/main.d.ts +2 -0
- package/dist/main.js +148 -0
- package/dist/main.js.map +1 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.js +253 -0
- package/dist/markdown.js.map +1 -0
- package/dist/page.d.ts +1 -0
- package/dist/page.js +8591 -0
- package/dist/page.js.map +1 -0
- package/dist/pick.d.ts +62 -0
- package/dist/pick.js +215 -0
- package/dist/pick.js.map +1 -0
- package/dist/prefs.d.ts +59 -0
- package/dist/prefs.js +66 -0
- package/dist/prefs.js.map +1 -0
- package/dist/projects.d.ts +34 -0
- package/dist/projects.js +129 -0
- package/dist/projects.js.map +1 -0
- package/dist/server.d.ts +50 -0
- package/dist/server.js +2789 -0
- package/dist/server.js.map +1 -0
- package/package.json +36 -0
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Agent } from "@oharness/engine/agent/agent.ts";
|
|
2
|
+
import type { Session } from "@oharness/engine/agent/session.ts";
|
|
3
|
+
import { Harness } from "@oharness/engine/harness.ts";
|
|
4
|
+
import type { PermissionRequest } from "@oharness/engine/agent/permissions.ts";
|
|
5
|
+
import type { SettingsScope } from "@oharness/engine/agent/settings.ts";
|
|
6
|
+
/**
|
|
7
|
+
* A browser frontend for the same agent the terminal drives.
|
|
8
|
+
*
|
|
9
|
+
* **Reaching this port is equivalent to a shell on this machine.** The agent
|
|
10
|
+
* behind it writes files and runs commands, so the server binds to loopback by
|
|
11
|
+
* default and requires a token that is generated per run and never persisted.
|
|
12
|
+
* Both matter: loopback alone still exposes the agent to every other user and
|
|
13
|
+
* every other process on a shared machine, and a token alone would not stop a
|
|
14
|
+
* network neighbour from finding the port.
|
|
15
|
+
*/
|
|
16
|
+
export interface WebServerOptions {
|
|
17
|
+
harness: Harness;
|
|
18
|
+
session: Session;
|
|
19
|
+
agent: Agent;
|
|
20
|
+
port?: number;
|
|
21
|
+
/** Defaults to loopback. Changing it publishes agent control to the network. */
|
|
22
|
+
host?: string;
|
|
23
|
+
/**
|
|
24
|
+
* How the harness for another project is built.
|
|
25
|
+
*
|
|
26
|
+
* A session names the tree it runs in and the page can start one anywhere,
|
|
27
|
+
* so this is reached whenever a directory is asked for that has no harness
|
|
28
|
+
* yet. The default is the real thing; it is an option because building one
|
|
29
|
+
* reads the disk, discovers plugins and connects every MCP server the
|
|
30
|
+
* project declares, which a test asking where a session landed should not
|
|
31
|
+
* have to pay for.
|
|
32
|
+
*/
|
|
33
|
+
openProject?: (cwd: string) => Promise<Harness>;
|
|
34
|
+
}
|
|
35
|
+
export interface WebServer {
|
|
36
|
+
readonly url: string;
|
|
37
|
+
readonly token: string;
|
|
38
|
+
close(): Promise<void>;
|
|
39
|
+
/** Answers the prompt the engine is waiting on, used by the HTTP layer. */
|
|
40
|
+
readonly permissionPrompt: (request: PermissionRequest) => Promise<{
|
|
41
|
+
allow: boolean;
|
|
42
|
+
remember?: boolean | "session" | SettingsScope;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
export declare function startWebServer(opts: WebServerOptions): Promise<WebServer>;
|
|
46
|
+
/** One thing the composer's + menu attached to a message. */
|
|
47
|
+
export interface Reference {
|
|
48
|
+
kind: "file" | "folder" | "connector" | "plugin";
|
|
49
|
+
value: string;
|
|
50
|
+
}
|