@looopy-ai/aws 1.0.4 → 1.0.6
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,4 +1,6 @@
|
|
|
1
|
+
import { type HttpBindings } from '@hono/node-server';
|
|
1
2
|
import { type Agent, type AuthContext } from '@looopy-ai/core';
|
|
3
|
+
import { Hono } from 'hono';
|
|
2
4
|
import type pino from 'pino';
|
|
3
5
|
type ServeConfig = {
|
|
4
6
|
agent: (contextId: string) => Promise<Agent>;
|
|
@@ -10,5 +12,8 @@ declare module 'hono' {
|
|
|
10
12
|
logger: pino.Logger;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
15
|
+
export declare const hono: (config: ServeConfig) => Hono<{
|
|
16
|
+
Bindings: HttpBindings;
|
|
17
|
+
}>;
|
|
13
18
|
export declare const serve: (config: ServeConfig) => void;
|
|
14
19
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { serve as serveNodeJs } from '@hono/node-server';
|
|
2
|
-
import { getLogger } from '@looopy-ai/core';
|
|
3
|
-
import { SSEServer } from '@looopy-ai/core/ts';
|
|
2
|
+
import { getLogger, SSEServer } from '@looopy-ai/core';
|
|
4
3
|
import { Hono } from 'hono';
|
|
5
4
|
import { requestId } from 'hono/request-id';
|
|
6
5
|
import { pinoHttp } from 'pino-http';
|
|
@@ -8,7 +7,7 @@ import { z } from 'zod';
|
|
|
8
7
|
const promptValidator = z.object({
|
|
9
8
|
prompt: z.string().min(1),
|
|
10
9
|
});
|
|
11
|
-
export const
|
|
10
|
+
export const hono = (config) => {
|
|
12
11
|
const app = new Hono();
|
|
13
12
|
app.use(requestId());
|
|
14
13
|
app.use(async (c, next) => {
|
|
@@ -100,6 +99,10 @@ export const serve = (config) => {
|
|
|
100
99
|
});
|
|
101
100
|
return new Response(stream, res);
|
|
102
101
|
});
|
|
102
|
+
return app;
|
|
103
|
+
};
|
|
104
|
+
export const serve = (config) => {
|
|
105
|
+
const app = hono(config);
|
|
103
106
|
serveNodeJs({
|
|
104
107
|
fetch: app.fetch,
|
|
105
108
|
port: config.port || 8080,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@looopy-ai/aws",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
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": "1.0.
|
|
55
|
+
"@looopy-ai/core": "1.0.3"
|
|
56
56
|
},
|
|
57
57
|
"publishConfig": {
|
|
58
58
|
"access": "public"
|