@donghanh/hono 0.3.5 → 0.4.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,6 +1,6 @@
1
- import { describe, expect, test } from "bun:test";
2
1
  import type { OperationComponent, OperationConfig } from "@donghanh/core";
3
2
  import { App, Brief, buildRegistry, Message } from "@donghanh/core";
3
+ import { describe, expect, test } from "vitest";
4
4
  import { generateOpenApi } from "./openapi";
5
5
 
6
6
  function makeOp(
package/src/openapi.ts CHANGED
@@ -102,6 +102,8 @@ type PathItem = Partial<Record<"get" | "post", Operation>>;
102
102
  * - `auth: "required"` (default) → path under `${basePath}/query/...` with bearerAuth
103
103
  * - `auth: "optional"` → two entries: the default path with bearerAuth AND `/public/...` with no security
104
104
  * - `auth: "none"` → single entry under `${basePath}/public/...` with no security
105
+ *
106
+ * @deprecated GPT Store support is deprecated. Use mcpRoutes (Apps SDK) for new projects.
105
107
  */
106
108
  export function generateOpenApi(config: GenerateOpenApiConfig): object {
107
109
  const {
@@ -0,0 +1,18 @@
1
+ /** MCP protocol versions this server speaks, newest first. */
2
+ export const SUPPORTED_PROTOCOL_VERSIONS = [
3
+ "2025-11-25",
4
+ "2025-06-18",
5
+ "2025-03-26",
6
+ "2024-11-05",
7
+ ] as const;
8
+
9
+ /** Echo the requested version when supported; otherwise answer with the newest. */
10
+ export function negotiateProtocolVersion(requested: unknown): string {
11
+ if (
12
+ typeof requested === "string" &&
13
+ (SUPPORTED_PROTOCOL_VERSIONS as readonly string[]).includes(requested)
14
+ ) {
15
+ return requested;
16
+ }
17
+ return SUPPORTED_PROTOCOL_VERSIONS[0];
18
+ }