@opentabs-dev/opentabs-plugin-hack2hire 0.0.109
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 +64 -0
- package/dist/adapter.iife.js +15864 -0
- package/dist/adapter.iife.js.map +7 -0
- package/dist/hack2hire-api.d.ts +18 -0
- package/dist/hack2hire-api.d.ts.map +1 -0
- package/dist/hack2hire-api.js +72 -0
- package/dist/hack2hire-api.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +54 -0
- package/dist/index.js.map +1 -0
- package/dist/tools/get-comment.d.ts +31 -0
- package/dist/tools/get-comment.d.ts.map +1 -0
- package/dist/tools/get-comment.js +21 -0
- package/dist/tools/get-comment.js.map +1 -0
- package/dist/tools/get-company-question-stats.d.ts +16 -0
- package/dist/tools/get-company-question-stats.d.ts.map +1 -0
- package/dist/tools/get-company-question-stats.js +34 -0
- package/dist/tools/get-company-question-stats.js.map +1 -0
- package/dist/tools/get-completed-question-count.d.ts +14 -0
- package/dist/tools/get-completed-question-count.d.ts.map +1 -0
- package/dist/tools/get-completed-question-count.js +35 -0
- package/dist/tools/get-completed-question-count.js.map +1 -0
- package/dist/tools/get-current-user.d.ts +15 -0
- package/dist/tools/get-current-user.d.ts.map +1 -0
- package/dist/tools/get-current-user.js +19 -0
- package/dist/tools/get-current-user.js.map +1 -0
- package/dist/tools/get-question-neighbors.d.ts +55 -0
- package/dist/tools/get-question-neighbors.d.ts.map +1 -0
- package/dist/tools/get-question-neighbors.js +42 -0
- package/dist/tools/get-question-neighbors.js.map +1 -0
- package/dist/tools/get-question.d.ts +27 -0
- package/dist/tools/get-question.d.ts.map +1 -0
- package/dist/tools/get-question.js +21 -0
- package/dist/tools/get-question.js.map +1 -0
- package/dist/tools/get-subscription.d.ts +14 -0
- package/dist/tools/get-subscription.d.ts.map +1 -0
- package/dist/tools/get-subscription.js +19 -0
- package/dist/tools/get-subscription.js.map +1 -0
- package/dist/tools/list-comment-replies.d.ts +32 -0
- package/dist/tools/list-comment-replies.d.ts.map +1 -0
- package/dist/tools/list-comment-replies.js +33 -0
- package/dist/tools/list-comment-replies.js.map +1 -0
- package/dist/tools/list-companies.d.ts +11 -0
- package/dist/tools/list-companies.d.ts.map +1 -0
- package/dist/tools/list-companies.js +21 -0
- package/dist/tools/list-companies.js.map +1 -0
- package/dist/tools/list-my-bookmarks.d.ts +24 -0
- package/dist/tools/list-my-bookmarks.d.ts.map +1 -0
- package/dist/tools/list-my-bookmarks.js +40 -0
- package/dist/tools/list-my-bookmarks.js.map +1 -0
- package/dist/tools/list-my-visits.d.ts +26 -0
- package/dist/tools/list-my-visits.d.ts.map +1 -0
- package/dist/tools/list-my-visits.js +40 -0
- package/dist/tools/list-my-visits.js.map +1 -0
- package/dist/tools/list-question-coding-problems.d.ts +10 -0
- package/dist/tools/list-question-coding-problems.d.ts.map +1 -0
- package/dist/tools/list-question-coding-problems.js +25 -0
- package/dist/tools/list-question-coding-problems.js.map +1 -0
- package/dist/tools/list-question-comments.d.ts +33 -0
- package/dist/tools/list-question-comments.d.ts.map +1 -0
- package/dist/tools/list-question-comments.js +45 -0
- package/dist/tools/list-question-comments.js.map +1 -0
- package/dist/tools/list-questions.d.ts +50 -0
- package/dist/tools/list-questions.d.ts.map +1 -0
- package/dist/tools/list-questions.js +71 -0
- package/dist/tools/list-questions.js.map +1 -0
- package/dist/tools/schemas.d.ts +438 -0
- package/dist/tools/schemas.d.ts.map +1 -0
- package/dist/tools/schemas.js +282 -0
- package/dist/tools/schemas.js.map +1 -0
- package/dist/tools.json +1823 -0
- package/package.json +68 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listCommentReplies: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
commentId: z.ZodString;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
replies: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
type: z.ZodString;
|
|
10
|
+
title: z.ZodString;
|
|
11
|
+
language: z.ZodString;
|
|
12
|
+
upvoteCount: z.ZodNumber;
|
|
13
|
+
downvoteCount: z.ZodNumber;
|
|
14
|
+
voteScore: z.ZodNumber;
|
|
15
|
+
viewCount: z.ZodNumber;
|
|
16
|
+
replyCount: z.ZodNumber;
|
|
17
|
+
isAnonymous: z.ZodBoolean;
|
|
18
|
+
postId: z.ZodString;
|
|
19
|
+
codingQuestionId: z.ZodString;
|
|
20
|
+
user: z.ZodObject<{
|
|
21
|
+
alias: z.ZodString;
|
|
22
|
+
avatar: z.ZodString;
|
|
23
|
+
}, z.core.$strip>;
|
|
24
|
+
displayName: z.ZodString;
|
|
25
|
+
hasUserUpvoted: z.ZodBoolean;
|
|
26
|
+
hasUserDownvoted: z.ZodBoolean;
|
|
27
|
+
createdDate: z.ZodString;
|
|
28
|
+
updatedDate: z.ZodString;
|
|
29
|
+
}, z.core.$strip>>;
|
|
30
|
+
total: z.ZodNumber;
|
|
31
|
+
}, z.core.$strip>>;
|
|
32
|
+
//# sourceMappingURL=list-comment-replies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-comment-replies.d.ts","sourceRoot":"","sources":["../../src/tools/list-comment-replies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4B7B,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { commentSchema, mapComment } from './schemas.js';
|
|
5
|
+
export const listCommentReplies = defineTool({
|
|
6
|
+
name: 'list_comment_replies',
|
|
7
|
+
displayName: 'List Comment Replies',
|
|
8
|
+
description: 'List replies to a Hack2Hire comment. Each reply has the same shape as a top-level comment (body, vote scores, author, etc.).',
|
|
9
|
+
summary: 'List replies to a comment',
|
|
10
|
+
icon: 'corner-down-right',
|
|
11
|
+
group: 'Comments',
|
|
12
|
+
input: z.object({
|
|
13
|
+
commentId: z.string().describe('Parent comment ID — get this from list_question_comments.'),
|
|
14
|
+
page: z.number().int().min(1).optional().describe('Page number (default 1).'),
|
|
15
|
+
perPage: z.number().int().min(1).max(50).optional().describe('Results per page (default 10, max 50).'),
|
|
16
|
+
}),
|
|
17
|
+
output: z.object({
|
|
18
|
+
replies: z.array(commentSchema),
|
|
19
|
+
total: z.number().int().describe('Total replies across all pages.'),
|
|
20
|
+
}),
|
|
21
|
+
handle: async (params) => {
|
|
22
|
+
const data = await api('/comment/reply/filter', {
|
|
23
|
+
commentId: params.commentId,
|
|
24
|
+
page: params.page ?? 1,
|
|
25
|
+
perPage: params.perPage ?? 10,
|
|
26
|
+
});
|
|
27
|
+
return {
|
|
28
|
+
replies: (data.data ?? []).map(mapComment),
|
|
29
|
+
total: data.total ?? 0,
|
|
30
|
+
};
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=list-comment-replies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-comment-replies.js","sourceRoot":"","sources":["../../src/tools/list-comment-replies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAmB,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;I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AC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listCompanies: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
3
|
+
companies: z.ZodArray<z.ZodObject<{
|
|
4
|
+
key: z.ZodString;
|
|
5
|
+
displayName: z.ZodString;
|
|
6
|
+
aliases: z.ZodArray<z.ZodString>;
|
|
7
|
+
priority: z.ZodNumber;
|
|
8
|
+
country: z.ZodString;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
}, z.core.$strip>>;
|
|
11
|
+
//# sourceMappingURL=list-companies.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-companies.d.ts","sourceRoot":"","sources":["../../src/tools/list-companies.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAQxB,eAAO,MAAM,aAAa;;;;;;;;kBAgBxB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { companyDirectoryEntrySchema, mapCompanyDirectoryEntry } from './schemas.js';
|
|
5
|
+
export const listCompanies = defineTool({
|
|
6
|
+
name: 'list_companies',
|
|
7
|
+
displayName: 'List Companies',
|
|
8
|
+
description: 'List every company that Hack2Hire tracks interview questions for, with the canonical URL key (e.g. "amazon", "pinterest"), display name, country, and a priority value used to rank companies in the UI. Use the `key` field to look up questions in `list_questions` (uppercased) or `get_company_question_stats`.',
|
|
9
|
+
summary: 'List all tracked companies',
|
|
10
|
+
icon: 'building-2',
|
|
11
|
+
group: 'Companies',
|
|
12
|
+
input: z.object({}),
|
|
13
|
+
output: z.object({
|
|
14
|
+
companies: z.array(companyDirectoryEntrySchema),
|
|
15
|
+
}),
|
|
16
|
+
handle: async () => {
|
|
17
|
+
const data = await api('/company-directory');
|
|
18
|
+
return { companies: (data.companies ?? []).map(mapCompanyDirectoryEntry) };
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=list-companies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-companies.js","sourceRoot":"","sources":["../../src/tools/list-companies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAAiC,2BAA2B,EAAE,wBAAwB,EAAE,MAAM,cAAc,CAAC;AAMpH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,qTAAqT;IACvT,OAAO,EAAE,4BAA4B;IACrC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,SAAS,EAAE,CAAC,CAAC,KAAK,CAAC,2BAA2B,CAAC;KAChD,CAAC;IACF,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAW,oBAAoB,CAAC,CAAC;QACvD,OAAO,EAAE,SAAS,EAAE,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,wBAAwB,CAAC,EAAE,CAAC;IAC7E,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listMyBookmarks: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
postId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
bookmarks: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
postId: z.ZodString;
|
|
10
|
+
userId: z.ZodString;
|
|
11
|
+
createdDate: z.ZodString;
|
|
12
|
+
updatedDate: z.ZodString;
|
|
13
|
+
post: z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
type: z.ZodString;
|
|
16
|
+
title: z.ZodString;
|
|
17
|
+
isLocked: z.ZodBoolean;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
}, z.core.$strip>>;
|
|
20
|
+
total: z.ZodNumber;
|
|
21
|
+
page: z.ZodNumber;
|
|
22
|
+
perPage: z.ZodNumber;
|
|
23
|
+
}, z.core.$strip>>;
|
|
24
|
+
//# sourceMappingURL=list-my-bookmarks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-my-bookmarks.d.ts","sourceRoot":"","sources":["../../src/tools/list-my-bookmarks.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;kBAmC1B,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { bookmarkRecordSchema, mapBookmarkRecord } from './schemas.js';
|
|
5
|
+
export const listMyBookmarks = defineTool({
|
|
6
|
+
name: 'list_my_bookmarks',
|
|
7
|
+
displayName: 'List My Bookmarks',
|
|
8
|
+
description: "List the authenticated user's bookmarked interview questions. Each record includes the bookmark ID, the bookmarked post ID, when it was bookmarked, and a snapshot of the post (id, type, title, locked status). Optionally filter to a specific postId to check whether the user has bookmarked it.",
|
|
9
|
+
summary: 'List my bookmarked questions',
|
|
10
|
+
icon: 'bookmark',
|
|
11
|
+
group: 'Account',
|
|
12
|
+
input: z.object({
|
|
13
|
+
postId: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('If provided, only return the bookmark record for this specific post ID (or empty if not bookmarked).'),
|
|
17
|
+
page: z.number().int().min(1).optional().describe('Page number (default 1).'),
|
|
18
|
+
perPage: z.number().int().min(1).max(999).optional().describe('Results per page (default 25, max 999).'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
bookmarks: z.array(bookmarkRecordSchema),
|
|
22
|
+
total: z.number().int().describe('Total bookmarks matching the filters across all pages.'),
|
|
23
|
+
page: z.number().int(),
|
|
24
|
+
perPage: z.number().int(),
|
|
25
|
+
}),
|
|
26
|
+
handle: async (params) => {
|
|
27
|
+
const data = await api('/user/filter-bookmark-post-records', {
|
|
28
|
+
page: params.page ?? 1,
|
|
29
|
+
perPage: params.perPage ?? 25,
|
|
30
|
+
postId: params.postId,
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
bookmarks: (data.data ?? []).map(mapBookmarkRecord),
|
|
34
|
+
total: data.total ?? 0,
|
|
35
|
+
page: data.page ?? 1,
|
|
36
|
+
perPage: data.perPage ?? 25,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=list-my-bookmarks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-my-bookmarks.js","sourceRoot":"","sources":["../../src/tools/list-my-bookmarks.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,GAAG,EAAE,MAAM,qBAAqB,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E,MAAM,CAAC,OAAO,IAAI,EAAE;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,OAAO;YACL,SAAS,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,iBAAiB,CAAC;YACnD,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;YACpB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listMyVisits: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
postId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
5
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
7
|
+
visits: z.ZodArray<z.ZodObject<{
|
|
8
|
+
id: z.ZodString;
|
|
9
|
+
postId: z.ZodString;
|
|
10
|
+
userId: z.ZodString;
|
|
11
|
+
readingStatus: z.ZodString;
|
|
12
|
+
isManualSet: z.ZodBoolean;
|
|
13
|
+
createdDate: z.ZodString;
|
|
14
|
+
updatedDate: z.ZodString;
|
|
15
|
+
post: z.ZodObject<{
|
|
16
|
+
id: z.ZodString;
|
|
17
|
+
type: z.ZodString;
|
|
18
|
+
title: z.ZodString;
|
|
19
|
+
isLocked: z.ZodBoolean;
|
|
20
|
+
}, z.core.$strip>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
total: z.ZodNumber;
|
|
23
|
+
page: z.ZodNumber;
|
|
24
|
+
perPage: z.ZodNumber;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
//# sourceMappingURL=list-my-visits.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-my-visits.d.ts","sourceRoot":"","sources":["../../src/tools/list-my-visits.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;kBAmCvB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { mapVisitRecord, visitRecordSchema } from './schemas.js';
|
|
5
|
+
export const listMyVisits = defineTool({
|
|
6
|
+
name: 'list_my_visits',
|
|
7
|
+
displayName: 'List My Visits',
|
|
8
|
+
description: "List the authenticated user's recently visited interview questions, with the per-question reading status (NEW, READING, COMPLETED) and a snapshot of each linked post. Use this to find what the user has been working on or to filter by reading progress. Optionally filter to a specific postId to check the user's status on it.",
|
|
9
|
+
summary: 'List my recently visited questions',
|
|
10
|
+
icon: 'history',
|
|
11
|
+
group: 'Account',
|
|
12
|
+
input: z.object({
|
|
13
|
+
postId: z
|
|
14
|
+
.string()
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('If provided, only return the visit record for this specific post ID (or empty if not visited).'),
|
|
17
|
+
page: z.number().int().min(1).optional().describe('Page number (default 1).'),
|
|
18
|
+
perPage: z.number().int().min(1).max(999).optional().describe('Results per page (default 25, max 999).'),
|
|
19
|
+
}),
|
|
20
|
+
output: z.object({
|
|
21
|
+
visits: z.array(visitRecordSchema),
|
|
22
|
+
total: z.number().int().describe('Total visit records matching the filters across all pages.'),
|
|
23
|
+
page: z.number().int(),
|
|
24
|
+
perPage: z.number().int(),
|
|
25
|
+
}),
|
|
26
|
+
handle: async (params) => {
|
|
27
|
+
const data = await api('/user/filter-visit-post-records', {
|
|
28
|
+
page: params.page ?? 1,
|
|
29
|
+
perPage: params.perPage ?? 25,
|
|
30
|
+
postId: params.postId,
|
|
31
|
+
});
|
|
32
|
+
return {
|
|
33
|
+
visits: (data.data ?? []).map(mapVisitRecord),
|
|
34
|
+
total: data.total ?? 0,
|
|
35
|
+
page: data.page ?? 1,
|
|
36
|
+
perPage: data.perPage ?? 25,
|
|
37
|
+
};
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=list-my-visits.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-my-visits.js","sourceRoot":"","sources":["../../src/tools/list-my-visits.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAuB,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEtF,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,sUAAsU;IACxU,OAAO,EAAE,oCAAoC;IAC7C,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC;aACN,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CAAC,gGAAgG,CAAC;QAC7G,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAC7E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,yCAAyC,CAAC;KACzG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC;QAClC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,4DAA4D,CAAC;QAC9F,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;QACtB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;KAC1B,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAgC,iCAAiC,EAAE;YACvF,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC;YACtB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,OAAO;YACL,MAAM,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,cAAc,CAAC;YAC7C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;YACtB,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC;YACpB,OAAO,EAAE,IAAI,CAAC,OAAO,IAAI,EAAE;SAC5B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listQuestionCodingProblems: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
postId: z.ZodString;
|
|
4
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
5
|
+
codingProblems: z.ZodArray<z.ZodObject<{
|
|
6
|
+
id: z.ZodString;
|
|
7
|
+
type: z.ZodString;
|
|
8
|
+
}, z.core.$strip>>;
|
|
9
|
+
}, z.core.$strip>>;
|
|
10
|
+
//# sourceMappingURL=list-question-coding-problems.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-question-coding-problems.d.ts","sourceRoot":"","sources":["../../src/tools/list-question-coding-problems.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,0BAA0B;;;;;;;kBAoBrC,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { codingQuestionRefSchema, mapCodingQuestionRef } from './schemas.js';
|
|
5
|
+
export const listQuestionCodingProblems = defineTool({
|
|
6
|
+
name: 'list_question_coding_problems',
|
|
7
|
+
displayName: 'List Question Coding Problems',
|
|
8
|
+
description: 'List the coding problems associated with a post. Each post can have one or more coding problems — for example a multi-part interview question. Returns each coding problem ID and its type (SINGLE_STEP or MULTI_STEP). Use the returned IDs with `list_question_comments` to read comments anchored to the coding problem itself.',
|
|
9
|
+
summary: 'List coding problems for a post',
|
|
10
|
+
icon: 'code',
|
|
11
|
+
group: 'Questions',
|
|
12
|
+
input: z.object({
|
|
13
|
+
postId: z.string().describe('Post ID — get this from list_questions or get_question.'),
|
|
14
|
+
}),
|
|
15
|
+
output: z.object({
|
|
16
|
+
codingProblems: z.array(codingQuestionRefSchema),
|
|
17
|
+
}),
|
|
18
|
+
handle: async (params) => {
|
|
19
|
+
const data = await api('/coding/filter', {
|
|
20
|
+
postId: params.postId,
|
|
21
|
+
});
|
|
22
|
+
return { codingProblems: (data ?? []).map(mapCodingQuestionRef) };
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
//# sourceMappingURL=list-question-coding-problems.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-question-coding-problems.js","sourceRoot":"","sources":["../../src/tools/list-question-coding-problems.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC1C,OAAO,EAA6B,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAExG,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,+BAA+B;IACrC,WAAW,EAAE,+BAA+B;IAC5C,WAAW,EACT,oUAAoU;IACtU,OAAO,EAAE,iCAAiC;IAC1C,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,WAAW;IAClB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,yDAAyD,CAAC;KACvF,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,cAAc,EAAE,CAAC,CAAC,KAAK,CAAC,uBAAuB,CAAC;KACjD,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,IAAI,GAAG,MAAM,GAAG,CAAyB,gBAAgB,EAAE;YAC/D,MAAM,EAAE,MAAM,CAAC,MAAM;SACtB,CAAC,CAAC;QACH,OAAO,EAAE,cAAc,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE,CAAC;IACpE,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listQuestionComments: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
postId: z.ZodOptional<z.ZodString>;
|
|
4
|
+
codingQuestionId: z.ZodOptional<z.ZodString>;
|
|
5
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
6
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
7
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
8
|
+
comments: z.ZodArray<z.ZodObject<{
|
|
9
|
+
id: z.ZodString;
|
|
10
|
+
type: z.ZodString;
|
|
11
|
+
title: z.ZodString;
|
|
12
|
+
language: z.ZodString;
|
|
13
|
+
upvoteCount: z.ZodNumber;
|
|
14
|
+
downvoteCount: z.ZodNumber;
|
|
15
|
+
voteScore: z.ZodNumber;
|
|
16
|
+
viewCount: z.ZodNumber;
|
|
17
|
+
replyCount: z.ZodNumber;
|
|
18
|
+
isAnonymous: z.ZodBoolean;
|
|
19
|
+
postId: z.ZodString;
|
|
20
|
+
codingQuestionId: z.ZodString;
|
|
21
|
+
user: z.ZodObject<{
|
|
22
|
+
alias: z.ZodString;
|
|
23
|
+
avatar: z.ZodString;
|
|
24
|
+
}, z.core.$strip>;
|
|
25
|
+
displayName: z.ZodString;
|
|
26
|
+
hasUserUpvoted: z.ZodBoolean;
|
|
27
|
+
hasUserDownvoted: z.ZodBoolean;
|
|
28
|
+
createdDate: z.ZodString;
|
|
29
|
+
updatedDate: z.ZodString;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
total: z.ZodNumber;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
//# sourceMappingURL=list-question-comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-question-comments.d.ts","sourceRoot":"","sources":["../../src/tools/list-question-comments.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA0C/B,CAAC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ToolError, defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { commentSchema, mapComment } from './schemas.js';
|
|
5
|
+
export const listQuestionComments = defineTool({
|
|
6
|
+
name: 'list_question_comments',
|
|
7
|
+
displayName: 'List Question Comments',
|
|
8
|
+
description: "List comments on a Hack2Hire interview question or coding question. Provide either `postId` (top-level discussion on the post) or `codingQuestionId` (comments anchored to a specific coding question — get this ID from `get_question`'s `codingQuestionIds` field). Each comment includes the body, language label for code snippets, vote scores, view count, reply count, and author identity.",
|
|
9
|
+
summary: 'List comments on a question',
|
|
10
|
+
icon: 'message-circle',
|
|
11
|
+
group: 'Comments',
|
|
12
|
+
input: z
|
|
13
|
+
.object({
|
|
14
|
+
postId: z.string().optional().describe('Post ID — list discussion comments on the post itself.'),
|
|
15
|
+
codingQuestionId: z
|
|
16
|
+
.string()
|
|
17
|
+
.optional()
|
|
18
|
+
.describe("Coding question ID — list comments anchored to a specific coding question. Get this from get_question's codingQuestionIds field."),
|
|
19
|
+
page: z.number().int().min(1).optional().describe('Page number (default 1).'),
|
|
20
|
+
perPage: z.number().int().min(1).max(50).optional().describe('Results per page (default 10, max 50).'),
|
|
21
|
+
})
|
|
22
|
+
.refine(p => Boolean(p.postId) || Boolean(p.codingQuestionId), {
|
|
23
|
+
message: 'Provide either postId or codingQuestionId.',
|
|
24
|
+
}),
|
|
25
|
+
output: z.object({
|
|
26
|
+
comments: z.array(commentSchema),
|
|
27
|
+
total: z.number().int().describe('Total comments matching the filter across all pages.'),
|
|
28
|
+
}),
|
|
29
|
+
handle: async (params) => {
|
|
30
|
+
if (!params.postId && !params.codingQuestionId) {
|
|
31
|
+
throw ToolError.validation('Provide either postId or codingQuestionId.');
|
|
32
|
+
}
|
|
33
|
+
const data = await api('/comment/filter', {
|
|
34
|
+
page: params.page ?? 1,
|
|
35
|
+
perPage: params.perPage ?? 10,
|
|
36
|
+
postId: params.postId,
|
|
37
|
+
codingQuestionId: params.codingQuestionId,
|
|
38
|
+
});
|
|
39
|
+
return {
|
|
40
|
+
comments: (data.data ?? []).map(mapComment),
|
|
41
|
+
total: data.total ?? 0,
|
|
42
|
+
};
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=list-question-comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-question-comments.js","sourceRoot":"","sources":["../../src/tools/list-question-comments.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAmB,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC7C,IAAI,EAAE,wBAAwB;IAC9B,WAAW,EAAE,wBAAwB;IACrC,WAAW,EACT,oYAAoY;IACtY,OAAO,EAAE,6BAA6B;IACtC,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wDAAwD,CAAC;QAChG,gBAAgB,EAAE,CAAC;aAChB,MAAM,EAAE;aACR,QAAQ,EAAE;aACV,QAAQ,CACP,kIAAkI,CACnI;QACH,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0BAA0B,CAAC;QAC7E,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;KACvG,CAAC;SACD,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,EAAE;QAC7D,OAAO,EAAE,4CAA4C;KACtD,CAAC;IACJ,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,aAAa,CAAC;QAChC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,sDAAsD,CAAC;KACzF,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,gBAAgB,EAAE,CAAC;YAC/C,MAAM,SAAS,CAAC,UAAU,CAAC,4CAA4C,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,IAAI,GAAG,MAAM,GAAG,CAA4B,iBAAiB,EAAE;YACnE,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC;YACtB,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,EAAE;YAC7B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,gBAAgB,EAAE,MAAM,CAAC,gBAAgB;SAC1C,CAAC,CAAC;QACH,OAAO;YACL,QAAQ,EAAE,CAAC,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC;YAC3C,KAAK,EAAE,IAAI,CAAC,KAAK,IAAI,CAAC;SACvB,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const listQuestions: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
|
|
3
|
+
companyTags: z.ZodOptional<z.ZodString>;
|
|
4
|
+
type: z.ZodOptional<z.ZodEnum<{
|
|
5
|
+
ALGORITHM: "ALGORITHM";
|
|
6
|
+
SD: "SD";
|
|
7
|
+
ML_SD: "ML_SD";
|
|
8
|
+
BLOG: "BLOG";
|
|
9
|
+
}>>;
|
|
10
|
+
algorithmTags: z.ZodOptional<z.ZodString>;
|
|
11
|
+
stages: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
SCREENING: "SCREENING";
|
|
13
|
+
OA: "OA";
|
|
14
|
+
ONSITE: "ONSITE";
|
|
15
|
+
PHONE: "PHONE";
|
|
16
|
+
}>>;
|
|
17
|
+
difficulty: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
selectedCollectionKey: z.ZodOptional<z.ZodString>;
|
|
19
|
+
sortBy: z.ZodOptional<z.ZodEnum<{
|
|
20
|
+
frequency: "frequency";
|
|
21
|
+
difficulty: "difficulty";
|
|
22
|
+
isLocked: "isLocked";
|
|
23
|
+
createdDate: "createdDate";
|
|
24
|
+
}>>;
|
|
25
|
+
page: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
perPage: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
28
|
+
questions: z.ZodArray<z.ZodObject<{
|
|
29
|
+
id: z.ZodString;
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
title: z.ZodString;
|
|
32
|
+
subtitle: z.ZodString;
|
|
33
|
+
company: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
34
|
+
frequency: z.ZodNumber;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
algorithmTags: z.ZodArray<z.ZodString>;
|
|
37
|
+
stages: z.ZodArray<z.ZodString>;
|
|
38
|
+
difficulty: z.ZodNumber;
|
|
39
|
+
frequency: z.ZodNumber;
|
|
40
|
+
isLocked: z.ZodBoolean;
|
|
41
|
+
createdDate: z.ZodString;
|
|
42
|
+
firstPublishedDate: z.ZodString;
|
|
43
|
+
lastReportSeenDate: z.ZodString;
|
|
44
|
+
codingQuestionIds: z.ZodArray<z.ZodString>;
|
|
45
|
+
}, z.core.$strip>>;
|
|
46
|
+
total: z.ZodNumber;
|
|
47
|
+
page: z.ZodNumber;
|
|
48
|
+
perPage: z.ZodNumber;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
//# sourceMappingURL=list-questions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-questions.d.ts","sourceRoot":"","sources":["../../src/tools/list-questions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAuExB,CAAC"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { defineTool } from '@opentabs-dev/plugin-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { api } from '../hack2hire-api.js';
|
|
4
|
+
import { POST_TYPES, STAGES, mapPostSummary, postSummarySchema } from './schemas.js';
|
|
5
|
+
const sortByOptions = ['isLocked', 'frequency', 'difficulty', 'createdDate'];
|
|
6
|
+
export const listQuestions = defineTool({
|
|
7
|
+
name: 'list_questions',
|
|
8
|
+
displayName: 'List Questions',
|
|
9
|
+
description: 'Search and filter Hack2Hire interview questions. Combine filters to narrow results: `companyTags` (uppercase, e.g. "PINTEREST") returns questions reportedly asked at that company; `type` (ALGORITHM, SD, ML_SD, BLOG) selects the question category; `algorithmTags` filters by topic (e.g. ARRAY, GREEDY, HASH_TABLE, HEAP, TRIE); `stages` filters by interview stage (SCREENING, OA, ONSITE, PHONE); `difficulty` is 1 (Easy), 2 (Medium), or 3 (Hard); `selectedCollectionKey` selects a curated list (e.g. "hack2hire-50-picks", "engineering-problem-picks"). Returns a paginated list with summary fields including the company frequency map, tags, difficulty, and locked/free status.',
|
|
10
|
+
summary: 'Search and filter interview questions',
|
|
11
|
+
icon: 'search',
|
|
12
|
+
group: 'Questions',
|
|
13
|
+
input: z.object({
|
|
14
|
+
companyTags: z
|
|
15
|
+
.string()
|
|
16
|
+
.optional()
|
|
17
|
+
.describe('Filter by company key in uppercase (e.g. "PINTEREST", "AMAZON"). Use list_companies to discover keys.'),
|
|
18
|
+
type: z
|
|
19
|
+
.enum(POST_TYPES)
|
|
20
|
+
.optional()
|
|
21
|
+
.describe('Filter by question type — ALGORITHM (coding), SD (system design), ML_SD (ML system design), or BLOG.'),
|
|
22
|
+
algorithmTags: z
|
|
23
|
+
.string()
|
|
24
|
+
.optional()
|
|
25
|
+
.describe('Filter by algorithm/topic tag (e.g. "ARRAY", "GREEDY", "HASH_TABLE", "HEAP", "TRIE", "BACKTRACKING", "BREADTH_FIRST_SEARCH", "UNION_FIND", "SORTING", "CONCURRENCY").'),
|
|
26
|
+
stages: z.enum(STAGES).optional().describe('Filter by interview stage where the question is reported.'),
|
|
27
|
+
difficulty: z
|
|
28
|
+
.number()
|
|
29
|
+
.int()
|
|
30
|
+
.min(1)
|
|
31
|
+
.max(3)
|
|
32
|
+
.optional()
|
|
33
|
+
.describe('Filter by difficulty — 1 (Easy), 2 (Medium), or 3 (Hard).'),
|
|
34
|
+
selectedCollectionKey: z
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Filter by curated collection key (e.g. "hack2hire-50-picks", "engineering-problem-picks", "object-oriented-problem-picks", "system-simulation-problem-picks", "classic-ml-system-design-picks", "new-ml-system-design-picks", "ai-system-design-picks", "classic-system-design-picks", "customer-facing-system-design-picks", "infra-system-design-picks", "new-system-design-topic-picks").'),
|
|
38
|
+
sortBy: z
|
|
39
|
+
.enum(sortByOptions)
|
|
40
|
+
.optional()
|
|
41
|
+
.describe('Sort order. "isLocked" (default) lists free questions first, then locked.'),
|
|
42
|
+
page: z.number().int().min(1).optional().describe('Page number (default 1).'),
|
|
43
|
+
perPage: z.number().int().min(1).max(100).optional().describe('Results per page (default 10, max 100).'),
|
|
44
|
+
}),
|
|
45
|
+
output: z.object({
|
|
46
|
+
questions: z.array(postSummarySchema),
|
|
47
|
+
total: z.number().int().describe('Total number of questions matching the filters across all pages.'),
|
|
48
|
+
page: z.number().int().describe('Current page number.'),
|
|
49
|
+
perPage: z.number().int().describe('Results per page in this response.'),
|
|
50
|
+
}),
|
|
51
|
+
handle: async (params) => {
|
|
52
|
+
const data = await api('/post/filter', {
|
|
53
|
+
page: params.page ?? 1,
|
|
54
|
+
perPage: params.perPage ?? 10,
|
|
55
|
+
companyTags: params.companyTags,
|
|
56
|
+
type: params.type,
|
|
57
|
+
algorithmTags: params.algorithmTags,
|
|
58
|
+
stages: params.stages,
|
|
59
|
+
difficulty: params.difficulty,
|
|
60
|
+
selectedCollectionKey: params.selectedCollectionKey,
|
|
61
|
+
sortBy: params.sortBy,
|
|
62
|
+
});
|
|
63
|
+
return {
|
|
64
|
+
questions: (data.data ?? []).map(mapPostSummary),
|
|
65
|
+
total: data.total ?? 0,
|
|
66
|
+
page: data.page ?? 1,
|
|
67
|
+
perPage: data.perPage ?? 10,
|
|
68
|
+
};
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
//# sourceMappingURL=list-questions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-questions.js","sourceRoot":"","sources":["../../src/tools/list-questions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAsB,GAAG,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,EAAgB,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEnG,MAAM,aAAa,GAAG,CAAC,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,CAAU,CAAC;AAEtF,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAC;IACtC,IAAI,EAAE,gBAAgB;IACtB,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EACT,mqBAAmqB;IACrqB,OAAO,EAAE,uCAAuC;IAChD,IAAI,EAAE,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