@looopy-ai/aws 2.1.0 → 2.1.1
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.
|
@@ -3,7 +3,7 @@ import { Hono } from 'hono';
|
|
|
3
3
|
import type pino from 'pino';
|
|
4
4
|
export type ServeConfig<AuthContext> = {
|
|
5
5
|
agent: (contextId: string) => Promise<Agent<AuthContext>>;
|
|
6
|
-
decodeAuthorization?: (authorization: string) => Promise<AuthContext |
|
|
6
|
+
decodeAuthorization?: (authorization: string) => Promise<AuthContext | undefined>;
|
|
7
7
|
shutdown?: ShutdownManager;
|
|
8
8
|
logger?: pino.Logger;
|
|
9
9
|
port?: number;
|
|
@@ -77,7 +77,7 @@ export const hono = (config) => {
|
|
|
77
77
|
}
|
|
78
78
|
const { prompt } = promptValidation.data;
|
|
79
79
|
const sseServer = new SSEServer();
|
|
80
|
-
const turn = await agent.startTurn(prompt);
|
|
80
|
+
const turn = await agent.startTurn(prompt, { authContext });
|
|
81
81
|
turn.subscribe({
|
|
82
82
|
next: (evt) => {
|
|
83
83
|
sseServer.emit(contextId, evt);
|
|
@@ -119,7 +119,7 @@ export const hono = (config) => {
|
|
|
119
119
|
};
|
|
120
120
|
const getAuthContext = async (authorization, decoder) => {
|
|
121
121
|
if (!authorization || !decoder) {
|
|
122
|
-
return
|
|
122
|
+
return undefined;
|
|
123
123
|
}
|
|
124
124
|
return await decoder(authorization);
|
|
125
125
|
};
|