@grackle-ai/powerline 0.169.0 → 0.171.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/ahp-handlers.d.ts +7 -44
- package/dist/ahp-handlers.d.ts.map +1 -1
- package/dist/ahp-handlers.js +21 -1024
- package/dist/ahp-handlers.js.map +1 -1
- package/dist/ahp-types.d.ts +92 -0
- package/dist/ahp-types.d.ts.map +1 -0
- package/dist/ahp-types.js +19 -0
- package/dist/ahp-types.js.map +1 -0
- package/dist/channel-codec.d.ts +31 -0
- package/dist/channel-codec.d.ts.map +1 -0
- package/dist/channel-codec.js +38 -0
- package/dist/channel-codec.js.map +1 -0
- package/dist/forwarder.d.ts +26 -0
- package/dist/forwarder.d.ts.map +1 -0
- package/dist/forwarder.js +223 -0
- package/dist/forwarder.js.map +1 -0
- package/dist/handlers/action-handlers.d.ts +12 -0
- package/dist/handlers/action-handlers.d.ts.map +1 -0
- package/dist/handlers/action-handlers.js +49 -0
- package/dist/handlers/action-handlers.js.map +1 -0
- package/dist/handlers/session-handlers.d.ts +16 -0
- package/dist/handlers/session-handlers.d.ts.map +1 -0
- package/dist/handlers/session-handlers.js +262 -0
- package/dist/handlers/session-handlers.js.map +1 -0
- package/dist/handlers/subscribe-handlers.d.ts +10 -0
- package/dist/handlers/subscribe-handlers.d.ts.map +1 -0
- package/dist/handlers/subscribe-handlers.js +82 -0
- package/dist/handlers/subscribe-handlers.js.map +1 -0
- package/dist/index.js +11 -25
- package/dist/index.js.map +1 -1
- package/dist/resource-watch.d.ts +30 -0
- package/dist/resource-watch.d.ts.map +1 -0
- package/dist/resource-watch.js +169 -0
- package/dist/resource-watch.js.map +1 -0
- package/dist/runtime-loader.d.ts +9 -0
- package/dist/runtime-loader.d.ts.map +1 -0
- package/dist/runtime-loader.js +69 -0
- package/dist/runtime-loader.js.map +1 -0
- package/package.json +10 -10
package/dist/ahp-handlers.d.ts
CHANGED
|
@@ -2,53 +2,16 @@
|
|
|
2
2
|
* PowerLine AHP handlers (AHP HR8d / #1336).
|
|
3
3
|
*
|
|
4
4
|
* Mounts an {@link AhpServerSocket} on an existing HTTP/HTTP2 server and
|
|
5
|
-
* routes incoming AHP JSON-RPC requests + notifications to the
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
* Wire-protocol summary (per #1336, Option E):
|
|
10
|
-
*
|
|
11
|
-
* - `initialize` — handshake, return canned `InitializeResult` (no host
|
|
12
|
-
* state; PowerLine session channels are declared stateless).
|
|
13
|
-
* - `createSession` — interpret `params.config` as Grackle's spawn shape.
|
|
14
|
-
* If `config.resumeFromRuntimeSessionId` is present, call `runtime.resume`;
|
|
15
|
-
* else call `runtime.spawn`. Store the resulting `AgentSession` in the
|
|
16
|
-
* existing in-memory registry.
|
|
17
|
-
* - `subscribe` — set up the per-(session, client) forwarder: drain any
|
|
18
|
-
* parked events for the session as `action` notifications first, then
|
|
19
|
-
* forward each live `AgentEvent` from `session.stream()` through the
|
|
20
|
-
* forward mapper as `action` notifications. Return
|
|
21
|
-
* `SubscribeResult { snapshot: undefined }` — session channels are
|
|
22
|
-
* stateless from AHP's POV; state is conveyed via the action stream.
|
|
23
|
-
* - `dispatchAction` notification — if the action is
|
|
24
|
-
* `SessionTurnStartedAction`, route the `message.text` to
|
|
25
|
-
* `session.sendInput`. Other client-dispatchable actions are no-ops
|
|
26
|
-
* for now (none used by Grackle today).
|
|
27
|
-
* - `disposeSession` — `session.kill()` + remove from registry.
|
|
28
|
-
* - `listSessions` — map the in-memory registry to `ListSessionsResult`.
|
|
29
|
-
* - `authenticate` — interpret `params.resource` as
|
|
30
|
-
* `grackle://provider/{provider}/{name}`; parse `params.token` as a
|
|
31
|
-
* JSON-encoded `{ type, envVar?, filePath?, value }`. Dispatch to the
|
|
32
|
-
* existing HR6 credential delivery.
|
|
33
|
-
* - `ping` — return `null`.
|
|
34
|
-
*
|
|
35
|
-
* On disconnect (heartbeat timeout or client close), enumerate this
|
|
36
|
-
* client's active sessions, kill each agent, drain its buffered queue, and
|
|
37
|
-
* park the events in the existing in-memory map for replay on next
|
|
38
|
-
* `subscribe`.
|
|
5
|
+
* routes incoming AHP JSON-RPC requests + notifications to the handler
|
|
6
|
+
* modules. This file is the glue layer — individual handler logic lives in
|
|
7
|
+
* the `handlers/` directory and domain modules (`forwarder.ts`,
|
|
8
|
+
* `resource-watch.ts`).
|
|
39
9
|
*
|
|
40
10
|
* @module ahp-handlers
|
|
41
11
|
*/
|
|
42
|
-
import { AhpServerSocket
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
/** The HTTP/HTTP2 server to attach the AHP WebSocket upgrade to. */
|
|
46
|
-
readonly server: AhpServerSocketOptions["server"];
|
|
47
|
-
/** Bearer token validated on the HTTP upgrade. */
|
|
48
|
-
readonly powerlineToken: string;
|
|
49
|
-
/** Path component of the WS URL. Defaults to `/ahp`. */
|
|
50
|
-
readonly path?: string;
|
|
51
|
-
}
|
|
12
|
+
import { AhpServerSocket } from "@grackle-ai/ahp-transport";
|
|
13
|
+
export type { MountAhpServerOptions } from "./ahp-types.js";
|
|
14
|
+
import type { MountAhpServerOptions } from "./ahp-types.js";
|
|
52
15
|
/**
|
|
53
16
|
* Mount the AHP server on the given HTTP server, wiring all the PowerLine
|
|
54
17
|
* handlers. Returns the {@link AhpServerSocket} so the caller can close it.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ahp-handlers.d.ts","sourceRoot":"","sources":["../src/ahp-handlers.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"ahp-handlers.d.ts","sourceRoot":"","sources":["../src/ahp-handlers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAkBH,OAAO,EAAE,eAAe,EAA4B,MAAM,2BAA2B,CAAC;AAItF,YAAY,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC5D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAoB5D;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,eAAe,CA6K3E"}
|