Updated imports / added connection for AI Orchestrator in RPCService - #36
Updated imports / added connection for AI Orchestrator in RPCService#36IsaacBurns7 wants to merge 5 commits into
Conversation
… Added generic bidirectional streaming hook in useRPC. Created new agentstream method in ai orchestrator proto, and accompanying custom hook in useRPCHelpers. Created AgentStreamManager componenet to demo feature. Confident on correctness of everything except custom hook implementation.
FOOincognita
left a comment
There was a problem hiding this comment.
Important
I'll need to re-review the following files after our call:
proto/ai/orchestrator/v1/service.protoproto/ai/orchestrator/v1/messages.protofrontend/src/renderer/src/hooks/data/useRPCHelpers.tsfrontend/src/renderer/src/hooks/data/useRPC.ts
It appears as though there may be a sizable dupe conflict between proto types defined in this PR, & proto types defined in the main branch (recently merged).
| @@ -0,0 +1,101 @@ | |||
| import React, {useState} from "react"; | |||
| import { useManageAgentStream } from "@/hooks/data/useRPCHelpers"; | |||
| import { AgentUpdatesResponseSchema, AgentUpdatesRequestSchema, AgentUpdatesRequest, AgentControlRequestSchema } from "@generated/ai/orchestrator/v1/messages_pb"; | |||
There was a problem hiding this comment.
Imports with Schema suffix unused
|
|
||
| option go_package = "github.com/Firelight-Innovations/FiApply/proto/ai/orchestrator/v1;orchestratorv1"; | ||
|
|
||
| message Timestamp { |
There was a problem hiding this comment.
Remove type; use google.protobuf.Timestamp instead.
| enum AgentStatus { | ||
| AGENT_STATUS_UNKNOWN = 0; | ||
| AGENT_STATUS_INITIALIZING = 1; | ||
| AGENT_STATUS_RUNNING = 2; | ||
| AGENT_STATUS_PAUSED = 3; | ||
| AGENT_STATUS_COMPLETED = 4; | ||
| AGENT_STATUS_FAILED = 5; | ||
| AGENT_STATUS_STOPPED = 6; | ||
| } | ||
|
|
||
| enum AgentCommand { | ||
| AGENT_COMMAND_UNSPECIFIED = 0; | ||
| PAUSE = 1; | ||
| RESUME = 2; | ||
| STOP = 3; | ||
| } No newline at end of file |
There was a problem hiding this comment.
If I'm not mistaken, Kedar and/or Braden already implemented types almost identical to these.
| message StreamConnectResponse{ | ||
|
|
||
| } | ||
| message AgentInfoRequest{ | ||
|
|
||
| // Error details if task failed | ||
| fi.common.v1.Error error = 4; | ||
| } |
There was a problem hiding this comment.
Messages cannot be truly empty. Use google.protobuf.Empty to add an explicit empty data-member.
There was a problem hiding this comment.
If I'm not mistaken, most of what was added in this PR in this file is duplicate of existing proto messages that Kedar/Braden have implemented.
| import { useCallback, useRef } from "react"; | ||
| import { BrowserAVBlob, ClientActionRequest, BrowserAVBlobResponse } from "@generated/ai/orchestrator/v1/messages_pb"; | ||
| import { RPCConfig, useRPCClientStream, UseRPCReturn, useRPCStream } from "./useRPC"; | ||
| import { BrowserAVBlob, ClientActionRequest, BrowserAVBlobResponse, StreamConnectRequestSchema } from "@generated/ai/orchestrator/v1/messages_pb"; |
There was a problem hiding this comment.
Will revisit following meeting.
| import { merge } from '@bufbuild/protobuf'; | ||
| import { abort } from 'process'; | ||
| import { request } from 'http'; | ||
| import { current } from '@reduxjs/toolkit'; |
There was a problem hiding this comment.
Will revisit after call.
…gentstream modified to use this new async iterable, managechatstream working on server, and now verified via dummy client
Added generic bidirectional streaming hook in useRPC. Created new agentstream method in ai orchestrator proto, and accompanying custom hook in useRPCHelpers. Created AgentStreamManager componenet to demo feature. Confident on correctness of everything except custom hook implementation.
FINAL GOAL:
6 streams
Sessions, workflows, agents, chat, audit, approvals.
-> = (create / request creation of)
sessions -> workflows -> agents
agents -> (CHAT or AUDIT or APPROVALS)