Skip to content

Commit 88c2487

Browse files
committed
feat(workflows,hub,web): stream live workflow run events over SSE and render chat progress
1 parent a8184e1 commit 88c2487

9 files changed

Lines changed: 1119 additions & 10 deletions

File tree

‎apps/hub/src/server.ts‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
type SidecarProvisionerChooser,
4646
type WsHandle,
4747
} from "@intx/hub-sessions";
48-
import { withLazyRunCollector } from "@corbits/workflows";
48+
import { createWorkflowRunStreamRoutes, withLazyRunCollector } from "@corbits/workflows";
4949
import { generateKeyPair } from "@intx/crypto";
5050
import { timeWindowEvaluator } from "@intx/authz";
5151
import type { ConditionRegistry } from "@intx/types/authz";
@@ -512,6 +512,19 @@ export async function createHubServer({
512512
});
513513
app.route(TENANT_PREFIX, artifactsApi);
514514
}
515+
{
516+
app.route(
517+
TENANT_PREFIX,
518+
createWorkflowRunStreamRoutes({
519+
db,
520+
sidecarRouter,
521+
requireGrant: createRequireGrant({
522+
grantStore,
523+
conditionRegistry: grantConditionRegistry,
524+
}),
525+
}),
526+
);
527+
}
515528
{
516529
// Minting an agent token is minting a credential, so it is gated by the
517530
// same stock grant the credential routes are, not by tenant membership.

‎apps/web/src/chat-path.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ export const workbenchKeys = {
99
participants: (tenantId: string) => ["workbench", tenantId, "participants"] as const,
1010
/** Client-only: {sentAt} from a send until the worker replies. */
1111
pendingTurn: (tenantId: string) => ["workbench", tenantId, "pendingTurn"] as const,
12+
/** Client-only: live status observed from the worker run's SSE stream. */
13+
runStatus: (tenantId: string) => ["workbench", tenantId, "runStatus"] as const,
1214
timeline: (tenantId: string) => ["workbench", tenantId, "timeline"] as const,
1315
/** The bench's own child tenants (its workbenches), read over the stock
1416
* tenant routes — previously `chatKeys.childTenants`, re-homed here when

0 commit comments

Comments
 (0)