@looopy-ai/aws 2.0.15 → 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.
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type Agent, type
|
|
1
|
+
import { type Agent, type ShutdownManager } from '@looopy-ai/core';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
import type pino from 'pino';
|
|
4
|
-
export type ServeConfig = {
|
|
5
|
-
agent: (contextId: string) => Promise<Agent
|
|
6
|
-
decodeAuthorization?: (authorization: string) => Promise<AuthContext |
|
|
4
|
+
export type ServeConfig<AuthContext> = {
|
|
5
|
+
agent: (contextId: string) => Promise<Agent<AuthContext>>;
|
|
6
|
+
decodeAuthorization?: (authorization: string) => Promise<AuthContext | undefined>;
|
|
7
7
|
shutdown?: ShutdownManager;
|
|
8
8
|
logger?: pino.Logger;
|
|
9
9
|
port?: number;
|
|
@@ -11,6 +11,6 @@ export type ServeConfig = {
|
|
|
11
11
|
export type HonoVariables = {
|
|
12
12
|
logger: pino.Logger;
|
|
13
13
|
};
|
|
14
|
-
export declare const hono: (config: ServeConfig) => Hono<{
|
|
14
|
+
export declare const hono: <AuthContext>(config: ServeConfig<AuthContext>) => Hono<{
|
|
15
15
|
Variables: HonoVariables;
|
|
16
16
|
}>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getLogger, SSEServer
|
|
1
|
+
import { getLogger, SSEServer } from '@looopy-ai/core';
|
|
2
2
|
import { Hono } from 'hono';
|
|
3
3
|
import { requestId } from 'hono/request-id';
|
|
4
4
|
import { z } from 'zod';
|
|
@@ -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
|
};
|
package/dist/nodejs.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { type ServeConfig } from './agentcore-runtime-server';
|
|
2
|
-
export declare const serve: (config: ServeConfig) => void;
|
|
2
|
+
export declare const serve: <AuthContext>(config: ServeConfig<AuthContext>) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looopy-ai/aws",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "AWS storage and providers for Looopy AI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@smithy/types": "^4.9.0",
|
|
53
53
|
"hono": "^4.10.5",
|
|
54
54
|
"pino-http": "^11.0.0",
|
|
55
|
-
"@looopy-ai/core": "2.0
|
|
55
|
+
"@looopy-ai/core": "2.1.0"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|