onlymcp 0.17.0 → 0.19.0

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 (126) hide show
  1. package/LICENSE +33 -17
  2. package/README.md +1 -1
  3. package/dist/bin/cli.js +46 -583
  4. package/dist/bin/mcp.js +45 -73
  5. package/package.json +6 -10
  6. package/dist/apiBaseUrl.d.ts +0 -12
  7. package/dist/apiBaseUrl.js +0 -28
  8. package/dist/apiBaseUrl.js.map +0 -1
  9. package/dist/apiClient.d.ts +0 -296
  10. package/dist/apiClient.js +0 -224
  11. package/dist/apiClient.js.map +0 -1
  12. package/dist/auth/deviceLogin.d.ts +0 -5
  13. package/dist/auth/deviceLogin.js +0 -40
  14. package/dist/auth/deviceLogin.js.map +0 -1
  15. package/dist/auth/keyring.d.ts +0 -16
  16. package/dist/auth/keyring.js +0 -33
  17. package/dist/auth/keyring.js.map +0 -1
  18. package/dist/bin/cli.d.ts +0 -2
  19. package/dist/bin/cli.js.map +0 -1
  20. package/dist/bin/mcp.d.ts +0 -2
  21. package/dist/bin/mcp.js.map +0 -1
  22. package/dist/cache.d.ts +0 -7
  23. package/dist/cache.js +0 -32
  24. package/dist/cache.js.map +0 -1
  25. package/dist/deviceId.d.ts +0 -2
  26. package/dist/deviceId.js +0 -97
  27. package/dist/deviceId.js.map +0 -1
  28. package/dist/export/unpack.d.ts +0 -33
  29. package/dist/export/unpack.js +0 -54
  30. package/dist/export/unpack.js.map +0 -1
  31. package/dist/identity.d.ts +0 -29
  32. package/dist/identity.js +0 -116
  33. package/dist/identity.js.map +0 -1
  34. package/dist/import/collect.d.ts +0 -25
  35. package/dist/import/collect.js +0 -101
  36. package/dist/import/collect.js.map +0 -1
  37. package/dist/import/frontmatter.d.ts +0 -44
  38. package/dist/import/frontmatter.js +0 -93
  39. package/dist/import/frontmatter.js.map +0 -1
  40. package/dist/import/plan.d.ts +0 -74
  41. package/dist/import/plan.js +0 -190
  42. package/dist/import/plan.js.map +0 -1
  43. package/dist/import/prune.d.ts +0 -46
  44. package/dist/import/prune.js +0 -61
  45. package/dist/import/prune.js.map +0 -1
  46. package/dist/import/secrets.d.ts +0 -7
  47. package/dist/import/secrets.js +0 -77
  48. package/dist/import/secrets.js.map +0 -1
  49. package/dist/import/upload.d.ts +0 -21
  50. package/dist/import/upload.js +0 -99
  51. package/dist/import/upload.js.map +0 -1
  52. package/dist/install.d.ts +0 -81
  53. package/dist/install.js +0 -168
  54. package/dist/install.js.map +0 -1
  55. package/dist/instructions.d.ts +0 -4
  56. package/dist/instructions.js +0 -67
  57. package/dist/instructions.js.map +0 -1
  58. package/dist/memoryPath.d.ts +0 -1
  59. package/dist/memoryPath.js +0 -13
  60. package/dist/memoryPath.js.map +0 -1
  61. package/dist/memorySync.d.ts +0 -28
  62. package/dist/memorySync.js +0 -56
  63. package/dist/memorySync.js.map +0 -1
  64. package/dist/paths.d.ts +0 -18
  65. package/dist/paths.js +0 -62
  66. package/dist/paths.js.map +0 -1
  67. package/dist/registry/caveats.d.ts +0 -17
  68. package/dist/registry/caveats.js +0 -74
  69. package/dist/registry/caveats.js.map +0 -1
  70. package/dist/registry/clients.d.ts +0 -17
  71. package/dist/registry/clients.js +0 -402
  72. package/dist/registry/clients.js.map +0 -1
  73. package/dist/registry/index.d.ts +0 -6
  74. package/dist/registry/index.js +0 -7
  75. package/dist/registry/index.js.map +0 -1
  76. package/dist/registry/serverInfo.d.ts +0 -25
  77. package/dist/registry/serverInfo.js +0 -33
  78. package/dist/registry/serverInfo.js.map +0 -1
  79. package/dist/registry/servers.d.ts +0 -58
  80. package/dist/registry/servers.js +0 -259
  81. package/dist/registry/servers.js.map +0 -1
  82. package/dist/registry/toolHints.d.ts +0 -29
  83. package/dist/registry/toolHints.js +0 -41
  84. package/dist/registry/toolHints.js.map +0 -1
  85. package/dist/registry/types.d.ts +0 -71
  86. package/dist/registry/types.js +0 -6
  87. package/dist/registry/types.js.map +0 -1
  88. package/dist/skillFilePath.d.ts +0 -1
  89. package/dist/skillFilePath.js +0 -29
  90. package/dist/skillFilePath.js.map +0 -1
  91. package/dist/stubIgnore.d.ts +0 -22
  92. package/dist/stubIgnore.js +0 -29
  93. package/dist/stubIgnore.js.map +0 -1
  94. package/dist/stubs.d.ts +0 -12
  95. package/dist/stubs.js +0 -188
  96. package/dist/stubs.js.map +0 -1
  97. package/dist/tools/connections.d.ts +0 -154
  98. package/dist/tools/connections.js +0 -164
  99. package/dist/tools/connections.js.map +0 -1
  100. package/dist/tools/getAgentDefinition.d.ts +0 -26
  101. package/dist/tools/getAgentDefinition.js +0 -29
  102. package/dist/tools/getAgentDefinition.js.map +0 -1
  103. package/dist/tools/getSkill.d.ts +0 -26
  104. package/dist/tools/getSkill.js +0 -26
  105. package/dist/tools/getSkill.js.map +0 -1
  106. package/dist/tools/getSkillFile.d.ts +0 -27
  107. package/dist/tools/getSkillFile.js +0 -39
  108. package/dist/tools/getSkillFile.js.map +0 -1
  109. package/dist/tools/index.d.ts +0 -263
  110. package/dist/tools/index.js +0 -69
  111. package/dist/tools/index.js.map +0 -1
  112. package/dist/tools/lists.d.ts +0 -38
  113. package/dist/tools/lists.js +0 -39
  114. package/dist/tools/lists.js.map +0 -1
  115. package/dist/tools/memoryGraph.d.ts +0 -69
  116. package/dist/tools/memoryGraph.js +0 -128
  117. package/dist/tools/memoryGraph.js.map +0 -1
  118. package/dist/tools/memoryRead.d.ts +0 -25
  119. package/dist/tools/memoryRead.js +0 -33
  120. package/dist/tools/memoryRead.js.map +0 -1
  121. package/dist/tools/memoryWrite.d.ts +0 -27
  122. package/dist/tools/memoryWrite.js +0 -34
  123. package/dist/tools/memoryWrite.js.map +0 -1
  124. package/dist/tools/write.d.ts +0 -166
  125. package/dist/tools/write.js +0 -193
  126. package/dist/tools/write.js.map +0 -1
@@ -1,27 +0,0 @@
1
- import { z } from 'zod';
2
- import type { ApiClient } from '../apiClient.js';
3
- export declare const GetSkillFileInput: z.ZodObject<{
4
- name: z.ZodString;
5
- path: z.ZodString;
6
- }, z.core.$strip>;
7
- export declare function createGetSkillFileTool(api: ApiClient): {
8
- name: string;
9
- description: string;
10
- inputSchema: z.ZodObject<{
11
- name: z.ZodString;
12
- path: z.ZodString;
13
- }, z.core.$strip>;
14
- handler(args: z.infer<typeof GetSkillFileInput>): Promise<{
15
- content: {
16
- type: "text";
17
- text: string;
18
- }[];
19
- isError: boolean;
20
- } | {
21
- content: {
22
- type: "text";
23
- text: string;
24
- }[];
25
- isError?: undefined;
26
- }>;
27
- };
@@ -1,39 +0,0 @@
1
- import { z } from 'zod';
2
- import { ApiError } from '../apiClient.js';
3
- export const GetSkillFileInput = z.object({
4
- name: z.string().min(1).max(64),
5
- path: z.string().min(1).max(200),
6
- });
7
- export function createGetSkillFileTool(api) {
8
- return {
9
- name: 'get_skill_file',
10
- description: "Delivers a single companion file of a skill from the OnlyMCP cloud, e.g. references/palette.md. " +
11
- 'Usually not needed: `npx onlymcp sync` places these files next to the SKILL.md.',
12
- inputSchema: GetSkillFileInput,
13
- async handler(args) {
14
- try {
15
- const file = await api.getSkillFile(args.name, args.path);
16
- // Eine Binaerdatei ist als Text nie brauchbar. Das zu sagen hilft mehr,
17
- // als 200 KB base64 zurueckzugeben, mit denen das Modell nichts
18
- // anfangen kann ausser sie durch seinen Kontext zu schieben.
19
- if (file.encoding === 'base64') {
20
- return {
21
- content: [
22
- {
23
- type: 'text',
24
- text: `errors.BINARY_FILE ${file.path} (${file.size} bytes) - fetch it to disk with \`npx onlymcp sync\`.`,
25
- },
26
- ],
27
- isError: true,
28
- };
29
- }
30
- return { content: [{ type: 'text', text: file.content }] };
31
- }
32
- catch (e) {
33
- const code = e instanceof ApiError ? e.code : 'errors.UNKNOWN';
34
- return { content: [{ type: 'text', text: code }], isError: true };
35
- }
36
- },
37
- };
38
- }
39
- //# sourceMappingURL=getSkillFile.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getSkillFile.js","sourceRoot":"","sources":["../../src/tools/getSkillFile.ts"],"names":[],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AAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAC/D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,263 +0,0 @@
1
- import { z } from 'zod';
2
- import type { ApiClient } from '../apiClient.js';
3
- import type { TtlCache } from '../cache.js';
4
- /**
5
- * Every tool the stdio server serves.
6
- *
7
- * Reihenfolge ist die, in der ein Client sie zu sehen bekommt: erst das
8
- * Gedaechtnis (am haeufigsten gebraucht), dann Skills, Agenten, und zuletzt
9
- * die Verwaltung der angebundenen Server.
10
- */
11
- export declare function buildTools(api: ApiClient, cache: TtlCache): ({
12
- name: string;
13
- description: string;
14
- inputSchema: z.ZodObject<{
15
- query: z.ZodString;
16
- types: z.ZodOptional<z.ZodString>;
17
- limit: z.ZodOptional<z.ZodNumber>;
18
- }, z.core.$strip>;
19
- handler(args: z.infer<typeof import("./memoryGraph.js").MemorySearchInput>): Promise<{
20
- content: {
21
- type: "text";
22
- text: string;
23
- }[];
24
- isError?: boolean;
25
- }>;
26
- } | {
27
- name: string;
28
- description: string;
29
- inputSchema: z.ZodObject<{
30
- scope: z.ZodOptional<z.ZodString>;
31
- }, z.core.$strip>;
32
- handler(args: z.infer<typeof import("./memoryGraph.js").MemoryTreeInput>): Promise<{
33
- content: {
34
- type: "text";
35
- text: string;
36
- }[];
37
- isError?: boolean;
38
- }>;
39
- } | {
40
- name: string;
41
- description: string;
42
- inputSchema: z.ZodObject<{
43
- from: z.ZodString;
44
- to: z.ZodString;
45
- updateLinks: z.ZodOptional<z.ZodBoolean>;
46
- }, z.core.$strip>;
47
- handler(args: z.infer<typeof import("./memoryGraph.js").MemoryMoveInput>): Promise<{
48
- content: {
49
- type: "text";
50
- text: string;
51
- }[];
52
- isError?: boolean;
53
- }>;
54
- } | {
55
- name: string;
56
- description: string;
57
- inputSchema: z.ZodObject<{}, z.core.$strip>;
58
- handler: () => Promise<{
59
- content: {
60
- type: "text";
61
- text: string;
62
- }[];
63
- }>;
64
- } | {
65
- name: string;
66
- description: string;
67
- inputSchema: z.ZodObject<{
68
- name: z.ZodString;
69
- slug: z.ZodString;
70
- url: z.ZodString;
71
- transport: z.ZodDefault<z.ZodEnum<{
72
- http: "http";
73
- sse: "sse";
74
- }>>;
75
- authType: z.ZodDefault<z.ZodEnum<{
76
- none: "none";
77
- bearer: "bearer";
78
- header: "header";
79
- }>>;
80
- authHeaderName: z.ZodOptional<z.ZodString>;
81
- secret: z.ZodOptional<z.ZodString>;
82
- teamId: z.ZodOptional<z.ZodString>;
83
- }, z.core.$strip>;
84
- handler: (args: z.infer<typeof import("./connections.js").ConnectionCreateInput>) => Promise<{
85
- content: {
86
- type: "text";
87
- text: string;
88
- }[];
89
- }>;
90
- } | {
91
- name: string;
92
- description: string;
93
- inputSchema: z.ZodObject<{
94
- slug: z.ZodString;
95
- name: z.ZodOptional<z.ZodString>;
96
- url: z.ZodOptional<z.ZodString>;
97
- transport: z.ZodOptional<z.ZodEnum<{
98
- http: "http";
99
- sse: "sse";
100
- }>>;
101
- authType: z.ZodOptional<z.ZodEnum<{
102
- none: "none";
103
- bearer: "bearer";
104
- header: "header";
105
- }>>;
106
- authHeaderName: z.ZodOptional<z.ZodString>;
107
- secret: z.ZodOptional<z.ZodString>;
108
- enabled: z.ZodOptional<z.ZodBoolean>;
109
- }, z.core.$strip>;
110
- handler: (args: z.infer<typeof import("./connections.js").ConnectionUpdateInput>) => Promise<{
111
- content: {
112
- type: "text";
113
- text: string;
114
- }[];
115
- }>;
116
- } | {
117
- name: string;
118
- description: string;
119
- inputSchema: z.ZodObject<{
120
- slug: z.ZodString;
121
- }, z.core.$strip>;
122
- handler: (args: z.infer<typeof import("./connections.js").ConnectionDeleteInput>) => Promise<{
123
- content: {
124
- type: "text";
125
- text: string;
126
- }[];
127
- }>;
128
- } | {
129
- name: string;
130
- description: string;
131
- inputSchema: z.ZodObject<{
132
- slug: z.ZodString;
133
- tool: z.ZodString;
134
- enabled: z.ZodBoolean;
135
- }, z.core.$strip>;
136
- handler: (args: z.infer<typeof import("./connections.js").ConnectionToolToggleInput>) => Promise<{
137
- content: {
138
- type: "text";
139
- text: string;
140
- }[];
141
- }>;
142
- } | {
143
- name: string;
144
- description: string;
145
- inputSchema: z.ZodObject<{
146
- name: z.ZodString;
147
- body: z.ZodString;
148
- }, z.core.$strip>;
149
- handler: (args: z.infer<typeof import("./write.js").SkillWriteInput>) => Promise<{
150
- content: {
151
- type: "text";
152
- text: string;
153
- }[];
154
- }>;
155
- } | {
156
- name: string;
157
- description: string;
158
- inputSchema: z.ZodObject<{
159
- name: z.ZodString;
160
- }, z.core.$strip>;
161
- handler: (args: z.infer<typeof import("./write.js").SkillDeleteInput>) => Promise<{
162
- content: {
163
- type: "text";
164
- text: string;
165
- }[];
166
- }>;
167
- } | {
168
- name: string;
169
- description: string;
170
- inputSchema: z.ZodObject<{
171
- skill: z.ZodString;
172
- }, z.core.$strip>;
173
- handler: (args: z.infer<typeof import("./write.js").ListSkillFilesInput>) => Promise<{
174
- content: {
175
- type: "text";
176
- text: string;
177
- }[];
178
- }>;
179
- } | {
180
- name: string;
181
- description: string;
182
- inputSchema: z.ZodObject<{
183
- skill: z.ZodString;
184
- path: z.ZodString;
185
- content: z.ZodString;
186
- encoding: z.ZodDefault<z.ZodEnum<{
187
- utf8: "utf8";
188
- base64: "base64";
189
- }>>;
190
- }, z.core.$strip>;
191
- handler: (args: z.infer<typeof import("./write.js").SkillFileWriteInput>) => Promise<{
192
- content: {
193
- type: "text";
194
- text: string;
195
- }[];
196
- }>;
197
- } | {
198
- name: string;
199
- description: string;
200
- inputSchema: z.ZodObject<{
201
- skill: z.ZodString;
202
- path: z.ZodString;
203
- }, z.core.$strip>;
204
- handler: (args: z.infer<typeof import("./write.js").SkillFileDeleteInput>) => Promise<{
205
- content: {
206
- type: "text";
207
- text: string;
208
- }[];
209
- }>;
210
- } | {
211
- name: string;
212
- description: string;
213
- inputSchema: z.ZodObject<{
214
- name: z.ZodString;
215
- description: z.ZodString;
216
- body: z.ZodString;
217
- model: z.ZodOptional<z.ZodString>;
218
- tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
219
- }, z.core.$strip>;
220
- handler: (args: z.infer<typeof import("./write.js").AgentWriteInput>) => Promise<{
221
- content: {
222
- type: "text";
223
- text: string;
224
- }[];
225
- }>;
226
- } | {
227
- name: string;
228
- description: string;
229
- inputSchema: z.ZodObject<{
230
- path: z.ZodString;
231
- }, z.core.$strip>;
232
- handler: (args: z.infer<typeof import("./write.js").MemoryDeleteInput>) => Promise<{
233
- content: {
234
- type: "text";
235
- text: string;
236
- }[];
237
- }>;
238
- })[];
239
- /**
240
- * What tools/list answers: name, description and input schema as before, and since the owner-notes round the title and
241
- * annotations of each tool (MCP `Tool.title`, `ToolAnnotations`) from the registry table that the hosted endpoint is
242
- * pinned to as well. A tool the table does not know is a defect of the build, and the listing says so instead of
243
- * offering a tool a client would treat as a destructive writer by default.
244
- */
245
- export declare function listedTools(tools: ReadonlyArray<{
246
- name: string;
247
- description: string;
248
- inputSchema: z.ZodType;
249
- }>): {
250
- name: string;
251
- title: string;
252
- description: string;
253
- inputSchema: {
254
- type: "object";
255
- [key: string]: unknown;
256
- };
257
- annotations: {
258
- readOnlyHint: boolean;
259
- destructiveHint?: boolean;
260
- idempotentHint?: boolean;
261
- openWorldHint: boolean;
262
- };
263
- }[];
@@ -1,69 +0,0 @@
1
- import { z } from 'zod';
2
- import { TOOL_HINTS } from '../registry/index.js';
3
- import { createGetAgentDefinitionTool } from './getAgentDefinition.js';
4
- import { createGetSkillFileTool } from './getSkillFile.js';
5
- import { createGetSkillTool } from './getSkill.js';
6
- import { createListAgentsTool, createListSkillsTool } from './lists.js';
7
- import { createMemoryReadTool } from './memoryRead.js';
8
- import { createMemoryWriteTool } from './memoryWrite.js';
9
- import { createMemoryLinksTool, createMemoryMoveTool, createMemorySearchTool, createMemoryTreeTool, } from './memoryGraph.js';
10
- import { createConnectionCreateTool, createConnectionDeleteTool, createConnectionToolToggleTool, createConnectionToolsTool, createConnectionUpdateTool, createListConnectionsTool, } from './connections.js';
11
- import { createAgentDeleteTool, createAgentWriteTool, createListMemoryTool, createListSkillFilesTool, createMemoryDeleteTool, createSkillDeleteTool, createSkillFileDeleteTool, createSkillFileWriteTool, createSkillWriteTool, } from './write.js';
12
- /**
13
- * Every tool the stdio server serves.
14
- *
15
- * Reihenfolge ist die, in der ein Client sie zu sehen bekommt: erst das
16
- * Gedaechtnis (am haeufigsten gebraucht), dann Skills, Agenten, und zuletzt
17
- * die Verwaltung der angebundenen Server.
18
- */
19
- export function buildTools(api, cache) {
20
- return [
21
- createMemoryReadTool(api),
22
- createMemoryWriteTool(api),
23
- createListMemoryTool(api),
24
- createMemoryDeleteTool(api),
25
- createMemorySearchTool(api),
26
- createMemoryTreeTool(api),
27
- createMemoryMoveTool(api),
28
- createMemoryLinksTool(api),
29
- createListSkillsTool(api),
30
- createGetSkillTool(api, cache),
31
- createSkillWriteTool(api),
32
- createSkillDeleteTool(api),
33
- createListSkillFilesTool(api),
34
- createGetSkillFileTool(api),
35
- createSkillFileWriteTool(api),
36
- createSkillFileDeleteTool(api),
37
- createListAgentsTool(api),
38
- createGetAgentDefinitionTool(api, cache),
39
- createAgentWriteTool(api),
40
- createAgentDeleteTool(api),
41
- createListConnectionsTool(api),
42
- createConnectionCreateTool(api),
43
- createConnectionUpdateTool(api),
44
- createConnectionDeleteTool(api),
45
- createConnectionToolsTool(api),
46
- createConnectionToolToggleTool(api),
47
- ];
48
- }
49
- /**
50
- * What tools/list answers: name, description and input schema as before, and since the owner-notes round the title and
51
- * annotations of each tool (MCP `Tool.title`, `ToolAnnotations`) from the registry table that the hosted endpoint is
52
- * pinned to as well. A tool the table does not know is a defect of the build, and the listing says so instead of
53
- * offering a tool a client would treat as a destructive writer by default.
54
- */
55
- export function listedTools(tools) {
56
- return tools.map((t) => {
57
- const hint = TOOL_HINTS[t.name];
58
- if (!hint)
59
- throw new Error(`No title and annotations in the registry table for the tool ${t.name}`);
60
- return {
61
- name: t.name,
62
- title: hint.title,
63
- description: t.description,
64
- inputSchema: z.toJSONSchema(t.inputSchema),
65
- annotations: hint.annotations,
66
- };
67
- });
68
- }
69
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,0BAA0B,EAC1B,0BAA0B,EAC1B,8BAA8B,EAC9B,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,yBAAyB,EACzB,wBAAwB,EACxB,oBAAoB,GACrB,MAAM,YAAY,CAAC;AAEpB;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CAAC,GAAc,EAAE,K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E,CAAC,CAAC,IAAI;YACZ,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,WAAW,EAAE,CAAC,CAAC,WAAW;YAC1B,WAAW,EAAE,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,CAA+C;YACxF,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -1,38 +0,0 @@
1
- import { z } from 'zod';
2
- import type { ApiClient } from '../apiClient.js';
3
- export declare function createListSkillsTool(api: ApiClient): {
4
- name: string;
5
- description: string;
6
- inputSchema: z.ZodObject<{}, z.core.$strip>;
7
- handler(): Promise<{
8
- content: {
9
- type: "text";
10
- text: string;
11
- }[];
12
- isError?: undefined;
13
- } | {
14
- content: {
15
- type: "text";
16
- text: string;
17
- }[];
18
- isError: boolean;
19
- }>;
20
- };
21
- export declare function createListAgentsTool(api: ApiClient): {
22
- name: string;
23
- description: string;
24
- inputSchema: z.ZodObject<{}, z.core.$strip>;
25
- handler(): Promise<{
26
- content: {
27
- type: "text";
28
- text: string;
29
- }[];
30
- isError?: undefined;
31
- } | {
32
- content: {
33
- type: "text";
34
- text: string;
35
- }[];
36
- isError: boolean;
37
- }>;
38
- };
@@ -1,39 +0,0 @@
1
- import { z } from 'zod';
2
- import { ApiError } from '../apiClient.js';
3
- const empty = z.object({});
4
- export function createListSkillsTool(api) {
5
- return {
6
- name: 'list_skills',
7
- description: 'List every skill name available to this user. Use when a skill you need is not named in the server instructions.',
8
- inputSchema: empty,
9
- async handler() {
10
- try {
11
- const { skills } = await api.listSkills();
12
- return { content: [{ type: 'text', text: skills.map((s) => s.name).join('\n') }] };
13
- }
14
- catch (e) {
15
- const code = e instanceof ApiError ? e.code : 'errors.UNKNOWN';
16
- return { content: [{ type: 'text', text: code }], isError: true };
17
- }
18
- },
19
- };
20
- }
21
- export function createListAgentsTool(api) {
22
- return {
23
- name: 'list_agents',
24
- description: 'List every agent available to this user, with its description. Use when this client has no agent files of its own.',
25
- inputSchema: empty,
26
- async handler() {
27
- try {
28
- const { agents } = await api.listAgents();
29
- const text = agents.map((a) => `${a.name}: ${a.description}`).join('\n');
30
- return { content: [{ type: 'text', text }] };
31
- }
32
- catch (e) {
33
- const code = e instanceof ApiError ? e.code : 'errors.UNKNOWN';
34
- return { content: [{ type: 'text', text: code }], isError: true };
35
- }
36
- },
37
- };
38
- }
39
- //# sourceMappingURL=lists.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lists.js","sourceRoot":"","sources":["../../src/tools/lists.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3C,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AAE3B,MAAM,UAAU,oBAAoB,CAAC,GAAc;IACjD,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,kHAAkH;QACpH,WAAW,EAAE,KAAK;QAClB,KAAK,CAAC,OAAO;YACX,IAAI,CAAC;gBACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;gBAC1C,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9F,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,CAAC,YAAY,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAC/D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,GAAc;IACjD,OAAO;QACL,IAAI,EAAE,aAAa;QACnB,WAAW,EACT,oHAAoH;QACtH,WAAW,EAAE,KAAK;QAClB,KAAK,CAAC,OAAO;YACX,IAAI,CAAC;gBACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,GAAG,CAAC,UAAU,EAAE,CAAC;gBAC1C,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACzE,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;YACxD,CAAC;YAAC,OAAO,CAAC,EAAE,CAAC;gBACX,MAAM,IAAI,GAAG,CAAC,YAAY,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,gBAAgB,CAAC;gBAC/D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAe,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAC7E,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC"}
@@ -1,69 +0,0 @@
1
- import { z } from 'zod';
2
- import type { ApiClient } from '../apiClient.js';
3
- /**
4
- * Die vier Werkzeuge aus Paket 03 Aufgabe 14: suchen, Baum, verschieben,
5
- * Links. Dieselben vier wie auf der gehosteten Oberflaeche (Spec 7), hier
6
- * ueber die REST-API statt ueber die Datenbank - damit eine Rangfolge, ein
7
- * Baum und eine Umbenennung nicht davon abhaengen, welcher Server gefragt
8
- * wurde.
9
- */
10
- type Result = {
11
- content: {
12
- type: 'text';
13
- text: string;
14
- }[];
15
- isError?: boolean;
16
- };
17
- export declare const MemorySearchInput: z.ZodObject<{
18
- query: z.ZodString;
19
- types: z.ZodOptional<z.ZodString>;
20
- limit: z.ZodOptional<z.ZodNumber>;
21
- }, z.core.$strip>;
22
- export declare function createMemorySearchTool(api: ApiClient): {
23
- name: string;
24
- description: string;
25
- inputSchema: z.ZodObject<{
26
- query: z.ZodString;
27
- types: z.ZodOptional<z.ZodString>;
28
- limit: z.ZodOptional<z.ZodNumber>;
29
- }, z.core.$strip>;
30
- handler(args: z.infer<typeof MemorySearchInput>): Promise<Result>;
31
- };
32
- export declare const MemoryTreeInput: z.ZodObject<{
33
- scope: z.ZodOptional<z.ZodString>;
34
- }, z.core.$strip>;
35
- export declare function createMemoryTreeTool(api: ApiClient): {
36
- name: string;
37
- description: string;
38
- inputSchema: z.ZodObject<{
39
- scope: z.ZodOptional<z.ZodString>;
40
- }, z.core.$strip>;
41
- handler(args: z.infer<typeof MemoryTreeInput>): Promise<Result>;
42
- };
43
- export declare const MemoryMoveInput: z.ZodObject<{
44
- from: z.ZodString;
45
- to: z.ZodString;
46
- updateLinks: z.ZodOptional<z.ZodBoolean>;
47
- }, z.core.$strip>;
48
- export declare function createMemoryMoveTool(api: ApiClient): {
49
- name: string;
50
- description: string;
51
- inputSchema: z.ZodObject<{
52
- from: z.ZodString;
53
- to: z.ZodString;
54
- updateLinks: z.ZodOptional<z.ZodBoolean>;
55
- }, z.core.$strip>;
56
- handler(args: z.infer<typeof MemoryMoveInput>): Promise<Result>;
57
- };
58
- export declare const MemoryLinksInput: z.ZodObject<{
59
- path: z.ZodString;
60
- }, z.core.$strip>;
61
- export declare function createMemoryLinksTool(api: ApiClient): {
62
- name: string;
63
- description: string;
64
- inputSchema: z.ZodObject<{
65
- path: z.ZodString;
66
- }, z.core.$strip>;
67
- handler(args: z.infer<typeof MemoryLinksInput>): Promise<Result>;
68
- };
69
- export {};