@typelets/mcp 0.3.0 → 0.4.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.
package/README.md CHANGED
@@ -120,6 +120,19 @@ Tools marked `destructive` carry the MCP `destructiveHint: true` annotation so h
120
120
 
121
121
  Each tool returns a structured timeline (per-file content checkpoints sampled across the session + chronological Run-button events) so the host LLM can write the prose summary, score, or follow-up questions itself. `score_against_rubric` also attaches the workspace's inline rubric + criteria; calls against a workspace with no applied problem return a friendly error pointing the user to `apply_problem_to_workspace`. `suggest_followup_questions` operates on the workspace's currently-active recording (last 5 minutes), and surfaces a clear error if no recording is in progress.
122
122
 
123
+ ### Completeness: file/folder + lifecycle (6 tools)
124
+
125
+ | Tool | Writes | Profile | `destructive` |
126
+ | --- | --- | --- | --- |
127
+ | `move_path` | `POST /workspaces/:id/move` | both | |
128
+ | `create_folder` | `POST /workspaces/:id/folders` | both | |
129
+ | `delete_folder` | `DELETE /workspaces/:id/folders/:folderId` | both | ✓ |
130
+ | `append_to_file` | `PATCH /workspaces/:id/files/:fileId/append` | both | |
131
+ | `delete_workspace` | `DELETE /workspaces/:id` | interviewer only | ✓ |
132
+ | `whoami` | `GET /auth/me` | both | |
133
+
134
+ `move_path` renames or moves any node (file or folder) to a full destination path, creating intermediate folders as needed; it rejects moving a folder into its own subtree. `create_folder` makes an empty folder (idempotent). `delete_folder` removes a folder and everything under it. `append_to_file` adds to the end of a file without re-sending its content. `delete_workspace` is interviewer-only and owner-gated by the API. `whoami` reports the identity + profile the server is running as.
135
+
123
136
  ## Layout
124
137
 
125
138
  ```
package/dist/index.js CHANGED
@@ -36,6 +36,12 @@ import { registerDeleteProblem } from './tools/delete_problem.js';
36
36
  import { registerSummarizeRecording } from './tools/summarize_recording.js';
37
37
  import { registerScoreAgainstRubric } from './tools/score_against_rubric.js';
38
38
  import { registerSuggestFollowupQuestions } from './tools/suggest_followup_questions.js';
39
+ import { registerMovePath } from './tools/move_path.js';
40
+ import { registerCreateFolder } from './tools/create_folder.js';
41
+ import { registerDeleteFolder } from './tools/delete_folder.js';
42
+ import { registerAppendToFile } from './tools/append_to_file.js';
43
+ import { registerDeleteWorkspace } from './tools/delete_workspace.js';
44
+ import { registerWhoami } from './tools/whoami.js';
39
45
  async function main() {
40
46
  const env = readEnv();
41
47
  const client = createClient(env);
@@ -71,6 +77,13 @@ async function main() {
71
77
  registerSummarizeRecording(server, client, env);
72
78
  registerScoreAgainstRubric(server, client, env);
73
79
  registerSuggestFollowupQuestions(server, client, env);
80
+ // Phase 2.2 completeness tools (delete_workspace is interviewer-only).
81
+ registerMovePath(server, client, env);
82
+ registerCreateFolder(server, client, env);
83
+ registerDeleteFolder(server, client, env);
84
+ registerAppendToFile(server, client, env);
85
+ registerDeleteWorkspace(server, client, env);
86
+ registerWhoami(server, client, env);
74
87
  const transport = new StdioServerTransport();
75
88
  await server.connect(transport);
76
89
  // Log to stderr (stdout is the MCP transport). Surfaces in the client's
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,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AAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC1C,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAC7C,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;IAEpC,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAEhC,wEAAwE;IACxE,kEAAkE;IAClE,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,iCAAiC,GAAG,CAAC,OAAO,QAAQ,GAAG,CAAC,MAAM,IAAI,CACnE,CAAC;AACJ,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;IAC5B,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,iCAAiC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CACtF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
package/dist/profile.js CHANGED
@@ -17,6 +17,7 @@ export const INTERVIEWER_ONLY_TOOLS = new Set([
17
17
  'summarize_recording',
18
18
  'score_against_rubric',
19
19
  'suggest_followup_questions',
20
+ 'delete_workspace',
20
21
  ]);
21
22
  export function toolAllowedForProfile(toolName, profile) {
22
23
  if (profile === 'interviewer')
@@ -1 +1 @@
1
- {"version":3,"file":"profile.js","sourceRoot":"","sources":["../src/profile.ts"],"names":[],"mappings":"AAgCA;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAwB,IAAI,GAAG,CAAC;IACjE,kBAAkB;IAClB,4BAA4B;IAC5B,yBAAyB;IACzB,cAAc;IACd,gBAAgB;IAChB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Q,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,OAAU,EACV,GAAQ;IAER,IAAI,GAAG,CAAC,OAAO,KAAK,aAAa;QAAE,OAAO,OAAO,CAAC;IAClD,MAAM,IAAI,GAAG,EAAE,GAAG,OAAO,EAAE,CAAC;IAC5B,OAAO,IAAI,CAAC,MAAM,CAAC;IACnB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACrB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACrB,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC9B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC;IAC5D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * append_to_file: append text to the end of a file without re-sending the
3
+ * whole content. Both profiles.
4
+ */
5
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import type { TypeletsClient } from '../client.js';
7
+ import type { Env } from '../env.js';
8
+ export declare function registerAppendToFile(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,26 @@
1
+ import { z } from 'zod';
2
+ import { toolAllowedForProfile } from '../profile.js';
3
+ import { ok, fail } from './_shared.js';
4
+ export function registerAppendToFile(server, client, env) {
5
+ if (!toolAllowedForProfile('append_to_file', env.profile))
6
+ return;
7
+ server.registerTool('append_to_file', {
8
+ title: 'Append to a file',
9
+ description: 'Append text to the end of an existing file without re-sending its full content. Get fileId from list_workspace_files. The file must already exist (use create_file otherwise).',
10
+ inputSchema: {
11
+ workspaceId: z.string().min(1).describe('The workspace id.'),
12
+ fileId: z.string().min(1).describe('The file id from list_workspace_files.'),
13
+ text: z.string().min(1).describe('Text to append at the end of the file.'),
14
+ },
15
+ annotations: { destructiveHint: false },
16
+ }, async ({ workspaceId, fileId, text }) => {
17
+ try {
18
+ const out = await client.patch(`/workspaces/${encodeURIComponent(workspaceId)}/files/${encodeURIComponent(fileId)}/append`, { text });
19
+ return ok(`Appended to file (${out.bytes} bytes total).`, out);
20
+ }
21
+ catch (err) {
22
+ return fail(err);
23
+ }
24
+ });
25
+ }
26
+ //# sourceMappingURL=append_to_file.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"append_to_file.js","sourceRoot":"","sources":["../../src/tools/append_to_file.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAOxC,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAsB,EAAE,GAAQ;IACtF,IAAI,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAElE,MAAM,CAAC,YAAY,CACjB,gBAAgB,EAChB;QACE,KAAK,EAAE,kBAAkB;QACzB,WAAW,EACT,gLAAgL;QAClL,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC5D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;YAC5E,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;SAC3E;QACD,WAAW,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;KACxC,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,EAAE;QACtC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,KAAK,CAC5B,eAAe,kBAAkB,CAAC,WAAW,CAAC,UAAU,kBAAkB,CAAC,MAAM,CAAC,SAAS,EAC3F,EAAE,IAAI,EAAE,CACT,CAAC;YACF,OAAO,EAAE,CAAC,qBAAqB,GAAG,CAAC,KAAK,gBAAgB,EAAE,GAAG,CAAC,CAAC;QACjE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * create_folder: create an empty folder (with intermediate folders) at a path.
3
+ * Idempotent if the folder already exists. Both profiles.
4
+ */
5
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import type { TypeletsClient } from '../client.js';
7
+ import type { Env } from '../env.js';
8
+ export declare function registerCreateFolder(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,25 @@
1
+ import { z } from 'zod';
2
+ import { toolAllowedForProfile } from '../profile.js';
3
+ import { ok, fail } from './_shared.js';
4
+ export function registerCreateFolder(server, client, env) {
5
+ if (!toolAllowedForProfile('create_folder', env.profile))
6
+ return;
7
+ server.registerTool('create_folder', {
8
+ title: 'Create a folder',
9
+ description: 'Create an empty folder at a slash-separated path; intermediate folders are created as needed. Idempotent if the folder already exists. Errors if a file occupies the path.',
10
+ inputSchema: {
11
+ workspaceId: z.string().min(1).describe('The workspace id.'),
12
+ path: z.string().min(1).describe('Folder path, e.g. "src/lib".'),
13
+ },
14
+ annotations: { destructiveHint: false },
15
+ }, async ({ workspaceId, path }) => {
16
+ try {
17
+ const out = await client.post(`/workspaces/${encodeURIComponent(workspaceId)}/folders`, { path });
18
+ return ok(`Created folder ${out.path}.`, out);
19
+ }
20
+ catch (err) {
21
+ return fail(err);
22
+ }
23
+ });
24
+ }
25
+ //# sourceMappingURL=create_folder.js.map
@@ -0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ursively delete a folder and everything under it.
3
+ * Destructive. Both profiles (editors manage their own tree).
4
+ */
5
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
6
+ import type { TypeletsClient } from '../client.js';
7
+ import type { Env } from '../env.js';
8
+ export declare function registerDeleteFolder(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,28 @@
1
+ import { z } from 'zod';
2
+ import { toolAllowedForProfile } from '../profile.js';
3
+ import { ok, fail } from './_shared.js';
4
+ export function registerDeleteFolder(server, client, env) {
5
+ if (!toolAllowedForProfile('delete_folder', env.profile))
6
+ return;
7
+ server.registerTool('delete_folder', {
8
+ title: 'Delete a folder (recursive)',
9
+ description: 'Permanently delete a folder and ALL files and subfolders inside it. Get folderId from list_workspace_files with includeFolders=true. This cannot be undone.',
10
+ inputSchema: {
11
+ workspaceId: z.string().min(1).describe('The workspace id.'),
12
+ folderId: z
13
+ .string()
14
+ .min(1)
15
+ .describe('The folder id from list_workspace_files (includeFolders=true).'),
16
+ },
17
+ annotations: { destructiveHint: true },
18
+ }, async ({ workspaceId, folderId }) => {
19
+ try {
20
+ const out = await client.delete(`/workspaces/${encodeURIComponent(workspaceId)}/folders/${encodeURIComponent(folderId)}`);
21
+ return ok(`Deleted folder and ${out.deleted} item(s).`, out);
22
+ }
23
+ catch (err) {
24
+ return fail(err);
25
+ }
26
+ });
27
+ }
28
+ //# sourceMappingURL=delete_folder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_folder.js","sourceRoot":"","sources":["../../src/tools/delete_folder.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAMxC,MAAM,UAAU,oBAAoB,CAAC,MAAiB,EAAE,MAAsB,EAAE,GAAQ;IACtF,IAAI,CAAC,qBAAqB,CAAC,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAEjE,MAAM,CAAC,YAAY,CACjB,eAAe,EACf;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,6JAA6J;QAC/J,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC5D,QAAQ,EAAE,CAAC;iBACR,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,gEAAgE,CAAC;SAC9E;QACD,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;KACvC,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,EAAE,EAAE;QAClC,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,MAAM,CAC7B,eAAe,kBAAkB,CAAC,WAAW,CAAC,YAAY,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CACzF,CAAC;YACF,OAAO,EAAE,CAAC,sBAAsB,GAAG,CAAC,OAAO,WAAW,EAAE,GAAG,CAAC,CAAC;QAC/D,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * delete_workspace: permanently delete a workspace. Interviewer-only and
3
+ * destructive. Wraps the existing owner-gated DELETE /workspaces/:id (the api
4
+ * returns 403 if the caller is not the owner).
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import type { TypeletsClient } from '../client.js';
8
+ import type { Env } from '../env.js';
9
+ export declare function registerDeleteWorkspace(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ import { toolAllowedForProfile } from '../profile.js';
3
+ import { ok, fail } from './_shared.js';
4
+ export function registerDeleteWorkspace(server, client, env) {
5
+ if (!toolAllowedForProfile('delete_workspace', env.profile))
6
+ return;
7
+ server.registerTool('delete_workspace', {
8
+ title: 'Delete a workspace',
9
+ description: 'Permanently delete a workspace and all its files, recordings, and members. Only the workspace owner can do this. This cannot be undone.',
10
+ inputSchema: {
11
+ workspaceId: z.string().min(1).describe('The workspace id to permanently delete.'),
12
+ },
13
+ annotations: { destructiveHint: true },
14
+ }, async ({ workspaceId }) => {
15
+ try {
16
+ await client.delete(`/workspaces/${encodeURIComponent(workspaceId)}`);
17
+ return ok('Workspace deleted.', { workspaceId, deleted: true });
18
+ }
19
+ catch (err) {
20
+ return fail(err);
21
+ }
22
+ });
23
+ }
24
+ //# sourceMappingURL=delete_workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"delete_workspace.js","sourceRoot":"","sources":["../../src/tools/delete_workspace.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAExC,MAAM,UAAU,uBAAuB,CACrC,MAAiB,EACjB,MAAsB,EACtB,GAAQ;IAER,IAAI,CAAC,qBAAqB,CAAC,kBAAkB,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAEpE,MAAM,CAAC,YAAY,CACjB,kBAAkB,EAClB;QACE,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,yIAAyI;QAC3I,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yCAAyC,CAAC;SACnF;QACD,WAAW,EAAE,EAAE,eAAe,EAAE,IAAI,EAAE;KACvC,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE;QACxB,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,MAAM,CAAO,eAAe,kBAAkB,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;YAC5E,OAAO,EAAE,CAAC,oBAAoB,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QAClE,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * move_path: rename or move a file/folder to a new path. The destination's
3
+ * parent folders are created as needed. Works on files and folders alike.
4
+ * Available to both profiles (editors manage their own tree).
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import type { TypeletsClient } from '../client.js';
8
+ import type { Env } from '../env.js';
9
+ export declare function registerMovePath(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ import { toolAllowedForProfile } from '../profile.js';
3
+ import { ok, fail } from './_shared.js';
4
+ export function registerMovePath(server, client, env) {
5
+ if (!toolAllowedForProfile('move_path', env.profile))
6
+ return;
7
+ server.registerTool('move_path', {
8
+ title: 'Move or rename a file or folder',
9
+ description: 'Move or rename a node (file OR folder) to a new full path. Parent folders are created as needed. Get nodeId from list_workspace_files (use includeFolders for folders). Moving a folder into its own subtree is rejected.',
10
+ inputSchema: {
11
+ workspaceId: z.string().min(1).describe('The workspace id.'),
12
+ nodeId: z.string().min(1).describe('The file or folder id from list_workspace_files.'),
13
+ destinationPath: z
14
+ .string()
15
+ .min(1)
16
+ .describe('Full destination path, e.g. "src/lib/auth.ts".'),
17
+ },
18
+ annotations: { destructiveHint: false },
19
+ }, async ({ workspaceId, nodeId, destinationPath }) => {
20
+ try {
21
+ const out = await client.post(`/workspaces/${encodeURIComponent(workspaceId)}/files/move`, { nodeId, destinationPath });
22
+ return ok(`Moved to ${out.path}.`, out);
23
+ }
24
+ catch (err) {
25
+ return fail(err);
26
+ }
27
+ });
28
+ }
29
+ //# sourceMappingURL=move_path.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"move_path.js","sourceRoot":"","sources":["../../src/tools/move_path.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASxC,MAAM,UAAU,gBAAgB,CAAC,MAAiB,EAAE,MAAsB,EAAE,GAAQ;IAClF,IAAI,CAAC,qBAAqB,CAAC,WAAW,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAE7D,MAAM,CAAC,YAAY,CACjB,WAAW,EACX;QACE,KAAK,EAAE,iCAAiC;QACxC,WAAW,EACT,2NAA2N;QAC7N,WAAW,EAAE;YACX,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mBAAmB,CAAC;YAC5D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;YACtF,eAAe,EAAE,CAAC;iBACf,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,gDAAgD,CAAC;SAC9D;QACD,WAAW,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;KACxC,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,EAAE,EAAE;QACjD,IAAI,CAAC;YACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,IAAI,CAC3B,eAAe,kBAAkB,CAAC,WAAW,CAAC,aAAa,EAC3D,EAAE,MAAM,EAAE,eAAe,EAAE,CAC5B,CAAC;YACF,OAAO,EAAE,CAAC,YAAY,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,CAAC,CAAC;QAC1C,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,9 @@
1
+ /**
2
+ * whoami: return the authenticated caller's identity. Wraps GET /auth/me so
3
+ * the host LLM can confirm which account + profile it's operating as. Both
4
+ * profiles.
5
+ */
6
+ import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
7
+ import type { TypeletsClient } from '../client.js';
8
+ import type { Env } from '../env.js';
9
+ export declare function registerWhoami(server: McpServer, client: TypeletsClient, env: Env): void;
@@ -0,0 +1,25 @@
1
+ import { toolAllowedForProfile } from '../profile.js';
2
+ import { ok, fail } from './_shared.js';
3
+ export function registerWhoami(server, client, env) {
4
+ if (!toolAllowedForProfile('whoami', env.profile))
5
+ return;
6
+ server.registerTool('whoami', {
7
+ title: 'Who am I',
8
+ description: 'Return the authenticated caller identity (id, email, display name) for the PAT this server is using, plus the active profile. Use to confirm which account you are operating as.',
9
+ inputSchema: {},
10
+ annotations: { destructiveHint: false },
11
+ }, async () => {
12
+ try {
13
+ const me = await client.get('/auth/me');
14
+ const who = me.displayName ?? me.email ?? me.id;
15
+ return ok(`Authenticated as ${who} (profile: ${env.profile}).`, {
16
+ ...me,
17
+ profile: env.profile,
18
+ });
19
+ }
20
+ catch (err) {
21
+ return fail(err);
22
+ }
23
+ });
24
+ }
25
+ //# sourceMappingURL=whoami.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"whoami.js","sourceRoot":"","sources":["../../src/tools/whoami.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AASxC,MAAM,UAAU,cAAc,CAAC,MAAiB,EAAE,MAAsB,EAAE,GAAQ;IAChF,IAAI,CAAC,qBAAqB,CAAC,QAAQ,EAAE,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO;IAE1D,MAAM,CAAC,YAAY,CACjB,QAAQ,EACR;QACE,KAAK,EAAE,UAAU;QACjB,WAAW,EACT,kLAAkL;QACpL,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE;KACxC,EACD,KAAK,IAAI,EAAE;QACT,IAAI,CAAC;YACH,MAAM,EAAE,GAAG,MAAM,MAAM,CAAC,GAAG,CAAa,UAAU,CAAC,CAAC;YACpD,MAAM,GAAG,GAAG,EAAE,CAAC,WAAW,IAAI,EAAE,CAAC,KAAK,IAAI,EAAE,CAAC,EAAE,CAAC;YAChD,OAAO,EAAE,CAAC,oBAAoB,GAAG,cAAc,GAAG,CAAC,OAAO,IAAI,EAAE;gBAC9D,GAAG,EAAE;gBACL,OAAO,EAAE,GAAG,CAAC,OAAO;aACrB,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC;QACnB,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@typelets/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Model Context Protocol server for Typelets. Wraps the Typelets API as tools an MCP-capable LLM client can call.",
5
5
  "type": "module",
6
6
  "bin": {