@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.
Files changed (39) hide show
  1. package/dist/ahp-handlers.d.ts +7 -44
  2. package/dist/ahp-handlers.d.ts.map +1 -1
  3. package/dist/ahp-handlers.js +21 -1024
  4. package/dist/ahp-handlers.js.map +1 -1
  5. package/dist/ahp-types.d.ts +92 -0
  6. package/dist/ahp-types.d.ts.map +1 -0
  7. package/dist/ahp-types.js +19 -0
  8. package/dist/ahp-types.js.map +1 -0
  9. package/dist/channel-codec.d.ts +31 -0
  10. package/dist/channel-codec.d.ts.map +1 -0
  11. package/dist/channel-codec.js +38 -0
  12. package/dist/channel-codec.js.map +1 -0
  13. package/dist/forwarder.d.ts +26 -0
  14. package/dist/forwarder.d.ts.map +1 -0
  15. package/dist/forwarder.js +223 -0
  16. package/dist/forwarder.js.map +1 -0
  17. package/dist/handlers/action-handlers.d.ts +12 -0
  18. package/dist/handlers/action-handlers.d.ts.map +1 -0
  19. package/dist/handlers/action-handlers.js +49 -0
  20. package/dist/handlers/action-handlers.js.map +1 -0
  21. package/dist/handlers/session-handlers.d.ts +16 -0
  22. package/dist/handlers/session-handlers.d.ts.map +1 -0
  23. package/dist/handlers/session-handlers.js +262 -0
  24. package/dist/handlers/session-handlers.js.map +1 -0
  25. package/dist/handlers/subscribe-handlers.d.ts +10 -0
  26. package/dist/handlers/subscribe-handlers.d.ts.map +1 -0
  27. package/dist/handlers/subscribe-handlers.js +82 -0
  28. package/dist/handlers/subscribe-handlers.js.map +1 -0
  29. package/dist/index.js +11 -25
  30. package/dist/index.js.map +1 -1
  31. package/dist/resource-watch.d.ts +30 -0
  32. package/dist/resource-watch.d.ts.map +1 -0
  33. package/dist/resource-watch.js +169 -0
  34. package/dist/resource-watch.js.map +1 -0
  35. package/dist/runtime-loader.d.ts +9 -0
  36. package/dist/runtime-loader.d.ts.map +1 -0
  37. package/dist/runtime-loader.js +69 -0
  38. package/dist/runtime-loader.js.map +1 -0
  39. package/package.json +10 -10
@@ -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 existing
6
- * PowerLine session machinery (runtime registry, session-mgr,
7
- * token-writer).
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, type AhpServerSocketOptions } from "@grackle-ai/ahp-transport";
43
- /** Options for {@link mountAhpServer}. */
44
- export interface MountAhpServerOptions {
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAuCH,OAAO,EACL,eAAe,EAEf,KAAK,sBAAsB,EAC5B,MAAM,2BAA2B,CAAC;AAyMnC,0CAA0C;AAC1C,MAAM,WAAW,qBAAqB;IACpC,oEAAoE;IACpE,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAClD,kDAAkD;IAClD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,wDAAwD;IACxD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,qBAAqB,GAAG,eAAe,CAgnC3E"}
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"}