@syengup/friday-channel-next 0.0.35 → 0.0.38

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 (97) hide show
  1. package/dist/index.d.ts +4 -0
  2. package/dist/index.js +182 -0
  3. package/dist/src/agent/abort-run.d.ts +1 -0
  4. package/dist/src/agent/abort-run.js +11 -0
  5. package/dist/src/agent/active-runs.d.ts +9 -0
  6. package/dist/src/agent/active-runs.js +20 -0
  7. package/dist/src/agent/dispatch-bridge.d.ts +5 -0
  8. package/dist/src/agent/dispatch-bridge.js +12 -0
  9. package/dist/src/agent/media-bridge.d.ts +4 -0
  10. package/dist/src/agent/media-bridge.js +21 -0
  11. package/dist/src/agent/subagent-registry.d.ts +68 -0
  12. package/dist/src/agent/subagent-registry.js +142 -0
  13. package/dist/src/agent-forward-runtime.d.ts +17 -0
  14. package/dist/src/agent-forward-runtime.js +16 -0
  15. package/dist/src/agent-run-context-bridge.d.ts +13 -0
  16. package/dist/src/agent-run-context-bridge.js +23 -0
  17. package/dist/src/channel-actions.d.ts +13 -0
  18. package/dist/src/channel-actions.js +101 -0
  19. package/dist/src/channel.d.ts +6 -0
  20. package/dist/src/channel.js +248 -0
  21. package/dist/src/collect-message-media-paths.d.ts +11 -0
  22. package/dist/src/collect-message-media-paths.js +143 -0
  23. package/dist/src/config.d.ts +15 -0
  24. package/dist/src/config.js +39 -0
  25. package/dist/src/friday-inbound-stats.d.ts +2 -0
  26. package/dist/src/friday-inbound-stats.js +8 -0
  27. package/dist/src/friday-session.d.ts +40 -0
  28. package/dist/src/friday-session.js +395 -0
  29. package/dist/src/host-config.d.ts +1 -0
  30. package/dist/src/host-config.js +15 -0
  31. package/dist/src/http/handlers/cancel.d.ts +2 -0
  32. package/dist/src/http/handlers/cancel.js +33 -0
  33. package/dist/src/http/handlers/device-approve.d.ts +2 -0
  34. package/dist/src/http/handlers/device-approve.js +125 -0
  35. package/dist/src/http/handlers/files-download.d.ts +10 -0
  36. package/dist/src/http/handlers/files-download.js +210 -0
  37. package/dist/src/http/handlers/files-upload.d.ts +8 -0
  38. package/dist/src/http/handlers/files-upload.js +136 -0
  39. package/dist/src/http/handlers/files.d.ts +75 -0
  40. package/dist/src/http/handlers/files.js +305 -0
  41. package/dist/src/http/handlers/messages.d.ts +34 -0
  42. package/dist/src/http/handlers/messages.js +476 -0
  43. package/dist/src/http/handlers/models-list.d.ts +10 -0
  44. package/dist/src/http/handlers/models-list.js +113 -0
  45. package/dist/src/http/handlers/nodes-approve.d.ts +2 -0
  46. package/dist/src/http/handlers/nodes-approve.js +146 -0
  47. package/dist/src/http/handlers/sessions-delete.d.ts +2 -0
  48. package/dist/src/http/handlers/sessions-delete.js +49 -0
  49. package/dist/src/http/handlers/sessions-settings.d.ts +2 -0
  50. package/dist/src/http/handlers/sessions-settings.js +71 -0
  51. package/dist/src/http/handlers/sse.d.ts +2 -0
  52. package/dist/src/http/handlers/sse.js +70 -0
  53. package/dist/src/http/handlers/status.d.ts +2 -0
  54. package/dist/src/http/handlers/status.js +29 -0
  55. package/dist/src/http/middleware/auth.d.ts +13 -0
  56. package/dist/src/http/middleware/auth.js +29 -0
  57. package/dist/src/http/middleware/body.d.ts +2 -0
  58. package/dist/src/http/middleware/body.js +24 -0
  59. package/dist/src/http/middleware/cors.d.ts +2 -0
  60. package/dist/src/http/middleware/cors.js +11 -0
  61. package/dist/src/http/server.d.ts +19 -0
  62. package/dist/src/http/server.js +87 -0
  63. package/dist/src/logging.d.ts +7 -0
  64. package/dist/src/logging.js +28 -0
  65. package/dist/src/run-metadata.d.ts +25 -0
  66. package/dist/src/run-metadata.js +139 -0
  67. package/dist/src/runtime.d.ts +13 -0
  68. package/dist/src/runtime.js +5 -0
  69. package/dist/src/session/session-manager.d.ts +22 -0
  70. package/dist/src/session/session-manager.js +190 -0
  71. package/dist/src/session-usage-snapshot.d.ts +23 -0
  72. package/dist/src/session-usage-snapshot.js +65 -0
  73. package/dist/src/sse/emitter.d.ts +59 -0
  74. package/dist/src/sse/emitter.js +219 -0
  75. package/dist/src/sse/offline-queue.d.ts +26 -0
  76. package/dist/src/sse/offline-queue.js +134 -0
  77. package/dist/src/vendor/runtime-store.d.ts +26 -0
  78. package/dist/src/vendor/runtime-store.js +60 -0
  79. package/index.ts +10 -4
  80. package/package.json +11 -10
  81. package/src/agent/subagent-registry.ts +195 -0
  82. package/src/channel.ts +6 -4
  83. package/src/e2e/subagent-smoke.e2e.test.ts +223 -0
  84. package/src/e2e/subagent.e2e.test.ts +502 -0
  85. package/src/friday-session.ts +140 -1
  86. package/src/http/handlers/device-approve.test.ts +0 -1
  87. package/src/http/handlers/device-approve.ts +0 -2
  88. package/src/http/handlers/files-download.ts +4 -1
  89. package/src/http/handlers/files.ts +7 -4
  90. package/src/http/handlers/messages.ts +54 -4
  91. package/src/http/handlers/models-list.ts +24 -2
  92. package/src/http/handlers/nodes-approve.test.ts +288 -0
  93. package/src/http/handlers/nodes-approve.ts +189 -0
  94. package/src/http/server.ts +5 -0
  95. package/src/openclaw.d.ts +5 -0
  96. package/src/sse/emitter.ts +1 -1
  97. package/src/test-support/mock-runtime.ts +2 -0
@@ -12,6 +12,7 @@ import { handleFilesUpload } from "./handlers/files-upload.js";
12
12
  import { handleFilesDownload } from "./handlers/files-download.js";
13
13
  import { handleCancel } from "./handlers/cancel.js";
14
14
  import { handleDeviceApprove } from "./handlers/device-approve.js";
15
+ import { handleNodesApprove } from "./handlers/nodes-approve.js";
15
16
  import { handleSessionsDelete } from "./handlers/sessions-delete.js";
16
17
  import { handleSessionsSettings } from "./handlers/sessions-settings.js";
17
18
  import { handleModelsList } from "./handlers/models-list.js";
@@ -64,6 +65,10 @@ async function handleFridayNextRoute(
64
65
  return await handleDeviceApprove(req, res);
65
66
  }
66
67
 
68
+ if (req.method === "POST" && pathname === "/friday-next/nodes-approve") {
69
+ return await handleNodesApprove(req, res);
70
+ }
71
+
67
72
  if (req.method === "DELETE" && pathname === "/friday-next/sessions") {
68
73
  return await handleSessionsDelete(req, res);
69
74
  }
package/src/openclaw.d.ts CHANGED
@@ -21,6 +21,11 @@ declare module "openclaw/plugin-sdk/plugins/types" {
21
21
  export type PluginHookBeforeToolCallEvent = any;
22
22
  export type PluginHookAfterToolCallEvent = any;
23
23
  export type PluginHookToolContext = any;
24
+ export type PluginHookSubagentSpawningEvent = any;
25
+ export type PluginHookSubagentSpawnedEvent = any;
26
+ export type PluginHookSubagentEndedEvent = any;
27
+ export type PluginHookSubagentDeliveryTargetEvent = any;
28
+ export type PluginHookSubagentContext = any;
24
29
  }
25
30
 
26
31
  declare module "openclaw/plugin-sdk/reply-dispatch-runtime" {
@@ -4,7 +4,7 @@ import { fridaySseOfflineQueue } from "./offline-queue.js";
4
4
 
5
5
  const logger = createFridayNextLogger("sse", "info");
6
6
 
7
- export type SseEventType = "connected" | "agent" | "deliver" | "tool-hook" | "outbound" | "ping";
7
+ export type SseEventType = "connected" | "agent" | "deliver" | "tool-hook" | "outbound" | "ping" | "subagent";
8
8
 
9
9
  export interface SseEvent {
10
10
  type: SseEventType;
@@ -6,6 +6,7 @@ import { setOfflineQueueBaseDirForTest } from "../sse/offline-queue.js";
6
6
  import { sseEmitter } from "../sse/emitter.js";
7
7
  import { resetActiveRunsForTest } from "../agent/active-runs.js";
8
8
  import { resetRunMetadataForTest } from "../run-metadata.js";
9
+ import { resetForTest as resetSubagentRegistryForTest } from "../agent/subagent-registry.js";
9
10
 
10
11
  export type MockRuntimeOptions = {
11
12
  authToken?: string;
@@ -32,6 +33,7 @@ export function setMockRuntime(opts: MockRuntimeOptions = {}): void {
32
33
  sseEmitter.resetForTest();
33
34
  resetActiveRunsForTest();
34
35
  resetRunMetadataForTest();
36
+ resetSubagentRegistryForTest();
35
37
  const historyDir = opts.historyDir ?? createTempHistoryDir();
36
38
  setOfflineQueueBaseDirForTest(path.join(historyDir, "events-queue"));
37
39
  const cfg = {