@grackle-ai/server 0.74.1 → 0.75.1
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/event-processor.d.ts.map +1 -1
- package/dist/event-processor.js +6 -5
- package/dist/event-processor.js.map +1 -1
- package/dist/grpc-service.d.ts.map +1 -1
- package/dist/grpc-service.js +277 -10
- package/dist/grpc-service.js.map +1 -1
- package/dist/index.js +9 -507
- package/dist/index.js.map +1 -1
- package/dist/ws-bridge.d.ts +15 -17
- package/dist/ws-bridge.d.ts.map +1 -1
- package/dist/ws-bridge.js +15 -1538
- package/dist/ws-bridge.js.map +1 -1
- package/package.json +15 -14
package/dist/ws-bridge.d.ts
CHANGED
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
import { WebSocketServer, WebSocket } from "ws";
|
|
2
2
|
import type { Server as HttpServer } from "node:http";
|
|
3
3
|
import { taskStore } from "@grackle-ai/database";
|
|
4
|
-
/** Options for {@link createWsBridge}. */
|
|
5
|
-
export interface WsBridgeOptions {
|
|
6
|
-
/** Verify a Bearer-token API key. */
|
|
7
|
-
verifyApiKey: (token: string) => boolean;
|
|
8
|
-
/** Verify a session cookie. */
|
|
9
|
-
validateCookie?: (cookieHeader: string) => boolean;
|
|
10
|
-
/** The port the web/WS server is listening on (used for origin validation). */
|
|
11
|
-
webPort: number;
|
|
12
|
-
/** Whether the server is bound to a wildcard address (`--allow-network`). */
|
|
13
|
-
allowNetwork: boolean;
|
|
14
|
-
}
|
|
15
4
|
/**
|
|
16
|
-
* Check whether a WebSocket
|
|
5
|
+
* Check whether a WebSocket Origin header is allowed.
|
|
17
6
|
*
|
|
18
|
-
*
|
|
19
|
-
* -
|
|
20
|
-
* -
|
|
21
|
-
* - In
|
|
7
|
+
* Rules:
|
|
8
|
+
* - Missing origin (non-browser clients, extensions) → always allowed
|
|
9
|
+
* - Origin port must match the web server port
|
|
10
|
+
* - In local mode (`allowNetwork === false`), hostname must be loopback
|
|
11
|
+
* - In network mode (`allowNetwork === true`), any hostname on the right port is allowed
|
|
22
12
|
*/
|
|
23
13
|
export declare function isAllowedOrigin(origin: string | undefined, webPort: number, allowNetwork: boolean): boolean;
|
|
24
|
-
/**
|
|
14
|
+
/** Options for creating the WebSocket bridge. */
|
|
15
|
+
interface WsBridgeOptions {
|
|
16
|
+
verifyApiKey: (token: string) => boolean;
|
|
17
|
+
validateCookie?: (cookieHeader: string) => boolean;
|
|
18
|
+
webPort?: number;
|
|
19
|
+
allowNetwork?: boolean;
|
|
20
|
+
}
|
|
21
|
+
/** Create a WebSocket server on top of an HTTP server for real-time event streaming. */
|
|
25
22
|
export declare function createWsBridge(httpServer: HttpServer, options: WsBridgeOptions): WebSocketServer;
|
|
26
23
|
/** Start a new agent session for a task. Returns an error message string on failure, undefined on success. */
|
|
27
24
|
export declare function startTaskSession(ws: WebSocket | undefined, task: taskStore.TaskRow, options?: {
|
|
@@ -29,4 +26,5 @@ export declare function startTaskSession(ws: WebSocket | undefined, task: taskSt
|
|
|
29
26
|
environmentId?: string;
|
|
30
27
|
notes?: string;
|
|
31
28
|
}): Promise<string | undefined>;
|
|
29
|
+
export {};
|
|
32
30
|
//# sourceMappingURL=ws-bridge.d.ts.map
|
package/dist/ws-bridge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ws-bridge.d.ts","sourceRoot":"","sources":["../src/ws-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,WAAW,CAAC;AAItD,OAAO,
|
|
1
|
+
{"version":3,"file":"ws-bridge.d.ts","sourceRoot":"","sources":["../src/ws-bridge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAChD,OAAO,KAAK,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,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