@dexto/server 1.6.20 → 1.6.22

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.
Files changed (133) hide show
  1. package/dist/a2a/jsonrpc/methods.cjs +1 -1
  2. package/dist/a2a/jsonrpc/methods.d.ts +14 -4
  3. package/dist/a2a/jsonrpc/methods.d.ts.map +1 -1
  4. package/dist/a2a/jsonrpc/methods.js +1 -1
  5. package/dist/approval/wire-approval-events.cjs +44 -0
  6. package/dist/approval/wire-approval-events.d.ts +4 -0
  7. package/dist/approval/wire-approval-events.d.ts.map +1 -0
  8. package/dist/approval/wire-approval-events.js +20 -0
  9. package/dist/events/session-sse-subscriber.cjs +167 -0
  10. package/dist/events/session-sse-subscriber.d.ts +13 -0
  11. package/dist/events/session-sse-subscriber.d.ts.map +1 -0
  12. package/dist/events/session-sse-subscriber.js +143 -0
  13. package/dist/hono/__tests__/test-fixtures.cjs +8 -0
  14. package/dist/hono/__tests__/test-fixtures.d.ts +1 -0
  15. package/dist/hono/__tests__/test-fixtures.d.ts.map +1 -1
  16. package/dist/hono/__tests__/test-fixtures.js +8 -0
  17. package/dist/hono/index.cjs +40 -8
  18. package/dist/hono/index.d.ts +45 -4531
  19. package/dist/hono/index.d.ts.map +1 -1
  20. package/dist/hono/index.js +43 -9
  21. package/dist/hono/node/index.cjs +51 -6
  22. package/dist/hono/node/index.d.ts.map +1 -1
  23. package/dist/hono/node/index.js +51 -6
  24. package/dist/hono/routes/a2a-jsonrpc.d.ts.map +1 -1
  25. package/dist/hono/routes/a2a-tasks.cjs +158 -32
  26. package/dist/hono/routes/a2a-tasks.d.ts +1 -502
  27. package/dist/hono/routes/a2a-tasks.d.ts.map +1 -1
  28. package/dist/hono/routes/a2a-tasks.js +162 -32
  29. package/dist/hono/routes/a2a.d.ts.map +1 -1
  30. package/dist/hono/routes/agents.cjs +410 -329
  31. package/dist/hono/routes/agents.d.ts +16043 -68
  32. package/dist/hono/routes/agents.d.ts.map +1 -1
  33. package/dist/hono/routes/agents.js +418 -330
  34. package/dist/hono/routes/approvals.cjs +102 -88
  35. package/dist/hono/routes/approvals.d.ts +2089 -142
  36. package/dist/hono/routes/approvals.d.ts.map +1 -1
  37. package/dist/hono/routes/approvals.js +108 -89
  38. package/dist/hono/routes/dexto-auth.cjs +40 -33
  39. package/dist/hono/routes/dexto-auth.d.ts +401 -2
  40. package/dist/hono/routes/dexto-auth.d.ts.map +1 -1
  41. package/dist/hono/routes/dexto-auth.js +40 -33
  42. package/dist/hono/routes/discovery.cjs +16 -14
  43. package/dist/hono/routes/discovery.d.ts +586 -1
  44. package/dist/hono/routes/discovery.d.ts.map +1 -1
  45. package/dist/hono/routes/discovery.js +16 -14
  46. package/dist/hono/routes/greeting.cjs +26 -22
  47. package/dist/hono/routes/greeting.d.ts +787 -3
  48. package/dist/hono/routes/greeting.d.ts.map +1 -1
  49. package/dist/hono/routes/greeting.js +26 -22
  50. package/dist/hono/routes/health.d.ts +1 -1
  51. package/dist/hono/routes/key.cjs +60 -52
  52. package/dist/hono/routes/key.d.ts +1597 -1
  53. package/dist/hono/routes/key.d.ts.map +1 -1
  54. package/dist/hono/routes/key.js +60 -52
  55. package/dist/hono/routes/llm.cjs +382 -349
  56. package/dist/hono/routes/llm.d.ts +12148 -98
  57. package/dist/hono/routes/llm.d.ts.map +1 -1
  58. package/dist/hono/routes/llm.js +386 -349
  59. package/dist/hono/routes/mcp.cjs +257 -226
  60. package/dist/hono/routes/mcp.d.ts +6605 -309
  61. package/dist/hono/routes/mcp.d.ts.map +1 -1
  62. package/dist/hono/routes/mcp.js +263 -225
  63. package/dist/hono/routes/memory.cjs +102 -89
  64. package/dist/hono/routes/memory.d.ts +5368 -4
  65. package/dist/hono/routes/memory.d.ts.map +1 -1
  66. package/dist/hono/routes/memory.js +108 -90
  67. package/dist/hono/routes/messages.cjs +189 -191
  68. package/dist/hono/routes/messages.d.ts +3900 -12
  69. package/dist/hono/routes/messages.d.ts.map +1 -1
  70. package/dist/hono/routes/messages.js +192 -191
  71. package/dist/hono/routes/models.cjs +106 -64
  72. package/dist/hono/routes/models.d.ts +2875 -2
  73. package/dist/hono/routes/models.d.ts.map +1 -1
  74. package/dist/hono/routes/models.js +108 -64
  75. package/dist/hono/routes/openrouter.cjs +79 -65
  76. package/dist/hono/routes/openrouter.d.ts +854 -1
  77. package/dist/hono/routes/openrouter.d.ts.map +1 -1
  78. package/dist/hono/routes/openrouter.js +79 -65
  79. package/dist/hono/routes/prompts.cjs +136 -109
  80. package/dist/hono/routes/prompts.d.ts +2818 -10
  81. package/dist/hono/routes/prompts.d.ts.map +1 -1
  82. package/dist/hono/routes/prompts.js +138 -109
  83. package/dist/hono/routes/queue.cjs +133 -120
  84. package/dist/hono/routes/queue.d.ts +5240 -11
  85. package/dist/hono/routes/queue.d.ts.map +1 -1
  86. package/dist/hono/routes/queue.js +136 -120
  87. package/dist/hono/routes/resources.cjs +65 -46
  88. package/dist/hono/routes/resources.d.ts +1983 -5
  89. package/dist/hono/routes/resources.d.ts.map +1 -1
  90. package/dist/hono/routes/resources.js +72 -47
  91. package/dist/hono/routes/schedules.cjs +233 -226
  92. package/dist/hono/routes/schedules.d.ts +4198 -22
  93. package/dist/hono/routes/schedules.d.ts.map +1 -1
  94. package/dist/hono/routes/schedules.js +233 -226
  95. package/dist/hono/routes/search.cjs +34 -30
  96. package/dist/hono/routes/search.d.ts +3094 -17
  97. package/dist/hono/routes/search.d.ts.map +1 -1
  98. package/dist/hono/routes/search.js +40 -31
  99. package/dist/hono/routes/sessions.cjs +491 -393
  100. package/dist/hono/routes/sessions.d.ts +18263 -65
  101. package/dist/hono/routes/sessions.d.ts.map +1 -1
  102. package/dist/hono/routes/sessions.js +497 -395
  103. package/dist/hono/routes/static.d.ts.map +1 -1
  104. package/dist/hono/routes/system-prompt.cjs +57 -61
  105. package/dist/hono/routes/system-prompt.d.ts +1228 -2
  106. package/dist/hono/routes/system-prompt.d.ts.map +1 -1
  107. package/dist/hono/routes/system-prompt.js +58 -62
  108. package/dist/hono/routes/tools.cjs +29 -34
  109. package/dist/hono/routes/tools.d.ts +1755 -6
  110. package/dist/hono/routes/tools.d.ts.map +1 -1
  111. package/dist/hono/routes/tools.js +33 -33
  112. package/dist/hono/routes/webhooks.cjs +115 -123
  113. package/dist/hono/routes/webhooks.d.ts +2501 -11
  114. package/dist/hono/routes/webhooks.d.ts.map +1 -1
  115. package/dist/hono/routes/webhooks.js +120 -124
  116. package/dist/hono/routes/workspaces.cjs +84 -79
  117. package/dist/hono/routes/workspaces.d.ts +2093 -2
  118. package/dist/hono/routes/workspaces.d.ts.map +1 -1
  119. package/dist/hono/routes/workspaces.js +89 -80
  120. package/dist/hono/schemas/responses.cjs +463 -260
  121. package/dist/hono/schemas/responses.d.ts +1893 -209
  122. package/dist/hono/schemas/responses.d.ts.map +1 -1
  123. package/dist/hono/schemas/responses.js +203 -14
  124. package/dist/hono/start-server.cjs +9 -0
  125. package/dist/hono/start-server.d.ts.map +1 -1
  126. package/dist/hono/start-server.js +9 -0
  127. package/dist/hono/types.d.ts +11 -0
  128. package/dist/hono/types.d.ts.map +1 -1
  129. package/dist/index.cjs +5 -1
  130. package/dist/index.d.ts +2 -0
  131. package/dist/index.d.ts.map +1 -1
  132. package/dist/index.js +2 -0
  133. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/workspaces.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAU9C,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA0H1D"}
1
+ {"version":3,"file":"workspaces.d.ts","sourceRoot":"","sources":["../../../src/hono/routes/workspaces.ts"],"names":[],"m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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAuBpB,CAAC;AAEH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QA6B1D;AAED,KAAK,eAAe,GAAG,kBAAkB,CAAC,OAAO,SAAS,EAAE,EAAE,CAAC,CAAC;AAChE,KAAK,oBAAoB,GAAG,kBAAkB,CAAC,OAAO,cAAc,EAAE,EAAE,CAAC,CAAC;AAC1E,KAAK,oBAAoB,GAAG,kBAAkB,CAC1C,OAAO,cAAc,EACrB;IAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;CAAE,CAC/C,CAAC;AACF,KAAK,sBAAsB,GAAG,kBAAkB,CAAC,OAAO,gBAAgB,EAAE,EAAE,CAAC,CAAC;AAE9E,MAAM,MAAM,sBAAsB,GAC5B,eAAe,GACf,oBAAoB,GACpB,oBAAoB,GACpB,sBAAsB,CAAC"}
@@ -1,110 +1,119 @@
1
1
  import { OpenAPIHono, createRoute, z } from "@hono/zod-openapi";
2
- import { WorkspaceSchema } from "../schemas/responses.js";
2
+ import {
3
+ BadRequestErrorResponse,
4
+ InternalErrorResponse,
5
+ WorkspaceSchema
6
+ } from "../schemas/responses.js";
3
7
  const SetWorkspaceSchema = z.object({
4
8
  path: z.string().min(1).describe("Absolute workspace root path"),
5
9
  name: z.string().optional().describe("Optional workspace display name")
6
10
  }).strict().describe("Request body for setting the active workspace");
7
- function createWorkspacesRouter(getAgent) {
8
- const app = new OpenAPIHono();
9
- const listRoute = createRoute({
10
- method: "get",
11
- path: "/workspaces",
12
- summary: "List Workspaces",
13
- description: "Retrieves all known workspaces",
14
- tags: ["workspaces"],
15
- responses: {
16
- 200: {
17
- description: "List of workspaces",
18
- content: {
19
- "application/json": {
20
- schema: z.object({
21
- workspaces: z.array(WorkspaceSchema).describe("Workspace list")
22
- }).strict()
23
- }
11
+ const listRoute = createRoute({
12
+ method: "get",
13
+ path: "/workspaces",
14
+ summary: "List Workspaces",
15
+ description: "Retrieves all known workspaces",
16
+ tags: ["workspaces"],
17
+ responses: {
18
+ 200: {
19
+ description: "List of workspaces",
20
+ content: {
21
+ "application/json": {
22
+ schema: z.object({
23
+ workspaces: z.array(WorkspaceSchema).describe("Workspace list")
24
+ }).strict()
24
25
  }
25
26
  }
26
- }
27
- });
28
- const getActiveRoute = createRoute({
29
- method: "get",
30
- path: "/workspaces/active",
31
- summary: "Get Active Workspace",
32
- description: "Returns the active workspace, if any",
33
- tags: ["workspaces"],
34
- responses: {
35
- 200: {
36
- description: "Active workspace",
37
- content: {
38
- "application/json": {
39
- schema: z.object({
40
- workspace: WorkspaceSchema.nullable().describe(
41
- "Active workspace or null if none is set"
42
- )
43
- }).strict()
44
- }
27
+ },
28
+ 500: InternalErrorResponse
29
+ }
30
+ });
31
+ const getActiveRoute = createRoute({
32
+ method: "get",
33
+ path: "/workspaces/active",
34
+ summary: "Get Active Workspace",
35
+ description: "Returns the active workspace, if any",
36
+ tags: ["workspaces"],
37
+ responses: {
38
+ 200: {
39
+ description: "Active workspace",
40
+ content: {
41
+ "application/json": {
42
+ schema: z.object({
43
+ workspace: WorkspaceSchema.nullable().describe(
44
+ "Active workspace or null if none is set"
45
+ )
46
+ }).strict()
45
47
  }
46
48
  }
47
- }
48
- });
49
- const setActiveRoute = createRoute({
50
- method: "post",
51
- path: "/workspaces/active",
52
- summary: "Set Active Workspace",
53
- description: "Sets the active workspace for this runtime",
54
- tags: ["workspaces"],
55
- request: { body: { content: { "application/json": { schema: SetWorkspaceSchema } } } },
56
- responses: {
57
- 200: {
58
- description: "Active workspace updated",
59
- content: {
60
- "application/json": {
61
- schema: z.object({
62
- workspace: WorkspaceSchema.describe("Updated active workspace")
63
- }).strict()
64
- }
49
+ },
50
+ 500: InternalErrorResponse
51
+ }
52
+ });
53
+ const setActiveRoute = createRoute({
54
+ method: "post",
55
+ path: "/workspaces/active",
56
+ summary: "Set Active Workspace",
57
+ description: "Sets the active workspace for this runtime",
58
+ tags: ["workspaces"],
59
+ request: { body: { content: { "application/json": { schema: SetWorkspaceSchema } } } },
60
+ responses: {
61
+ 200: {
62
+ description: "Active workspace updated",
63
+ content: {
64
+ "application/json": {
65
+ schema: z.object({
66
+ workspace: WorkspaceSchema.describe("Updated active workspace")
67
+ }).strict()
65
68
  }
66
69
  }
67
- }
68
- });
69
- const clearActiveRoute = createRoute({
70
- method: "delete",
71
- path: "/workspaces/active",
72
- summary: "Clear Active Workspace",
73
- description: "Clears the active workspace for this runtime",
74
- tags: ["workspaces"],
75
- responses: {
76
- 200: {
77
- description: "Active workspace cleared",
78
- content: {
79
- "application/json": {
80
- schema: z.object({
81
- workspace: WorkspaceSchema.nullable().describe(
82
- "Active workspace or null if none is set"
83
- )
84
- }).strict()
85
- }
70
+ },
71
+ 400: BadRequestErrorResponse,
72
+ 500: InternalErrorResponse
73
+ }
74
+ });
75
+ const clearActiveRoute = createRoute({
76
+ method: "delete",
77
+ path: "/workspaces/active",
78
+ summary: "Clear Active Workspace",
79
+ description: "Clears the active workspace for this runtime",
80
+ tags: ["workspaces"],
81
+ responses: {
82
+ 200: {
83
+ description: "Active workspace cleared",
84
+ content: {
85
+ "application/json": {
86
+ schema: z.object({
87
+ workspace: WorkspaceSchema.nullable().describe(
88
+ "Active workspace or null if none is set"
89
+ )
90
+ }).strict()
86
91
  }
87
92
  }
88
- }
89
- });
93
+ },
94
+ 500: InternalErrorResponse
95
+ }
96
+ });
97
+ function createWorkspacesRouter(getAgent) {
98
+ const app = new OpenAPIHono();
90
99
  return app.openapi(listRoute, async (ctx) => {
91
100
  const agent = await getAgent(ctx);
92
101
  const workspaces = await agent.listWorkspaces();
93
- return ctx.json({ workspaces });
102
+ return ctx.json({ workspaces }, 200);
94
103
  }).openapi(getActiveRoute, async (ctx) => {
95
104
  const agent = await getAgent(ctx);
96
105
  const workspace = await agent.getWorkspace();
97
- return ctx.json({ workspace: workspace ?? null });
106
+ return ctx.json({ workspace: workspace ?? null }, 200);
98
107
  }).openapi(setActiveRoute, async (ctx) => {
99
108
  const agent = await getAgent(ctx);
100
109
  const input = ctx.req.valid("json");
101
110
  const workspaceInput = input.name === void 0 ? { path: input.path } : { path: input.path, name: input.name };
102
111
  const workspace = await agent.setWorkspace(workspaceInput);
103
- return ctx.json({ workspace });
112
+ return ctx.json({ workspace }, 200);
104
113
  }).openapi(clearActiveRoute, async (ctx) => {
105
114
  const agent = await getAgent(ctx);
106
115
  await agent.clearWorkspace();
107
- return ctx.json({ workspace: null });
116
+ return ctx.json({ workspace: null }, 200);
108
117
  });
109
118
  }
110
119
  export {