@opentabs-dev/opentabs-plugin-fiverr 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.
Files changed (49) hide show
  1. package/README.md +58 -0
  2. package/dist/adapter.iife.js +15641 -0
  3. package/dist/adapter.iife.js.map +7 -0
  4. package/dist/fiverr-api.d.ts +23 -0
  5. package/dist/fiverr-api.d.ts.map +1 -0
  6. package/dist/fiverr-api.js +106 -0
  7. package/dist/fiverr-api.js.map +1 -0
  8. package/dist/index.d.ts +14 -0
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +38 -0
  11. package/dist/index.js.map +1 -0
  12. package/dist/tools/draft-message.d.ts +12 -0
  13. package/dist/tools/draft-message.d.ts.map +1 -0
  14. package/dist/tools/draft-message.js +37 -0
  15. package/dist/tools/draft-message.js.map +1 -0
  16. package/dist/tools/get-conversation.d.ts +22 -0
  17. package/dist/tools/get-conversation.d.ts.map +1 -0
  18. package/dist/tools/get-conversation.js +28 -0
  19. package/dist/tools/get-conversation.js.map +1 -0
  20. package/dist/tools/get-current-page-context.d.ts +12 -0
  21. package/dist/tools/get-current-page-context.d.ts.map +1 -0
  22. package/dist/tools/get-current-page-context.js +39 -0
  23. package/dist/tools/get-current-page-context.js.map +1 -0
  24. package/dist/tools/get-gig-details.d.ts +41 -0
  25. package/dist/tools/get-gig-details.d.ts.map +1 -0
  26. package/dist/tools/get-gig-details.js +34 -0
  27. package/dist/tools/get-gig-details.js.map +1 -0
  28. package/dist/tools/get-seller-profile.d.ts +20 -0
  29. package/dist/tools/get-seller-profile.d.ts.map +1 -0
  30. package/dist/tools/get-seller-profile.js +27 -0
  31. package/dist/tools/get-seller-profile.js.map +1 -0
  32. package/dist/tools/list-conversations.d.ts +16 -0
  33. package/dist/tools/list-conversations.d.ts.map +1 -0
  34. package/dist/tools/list-conversations.js +24 -0
  35. package/dist/tools/list-conversations.js.map +1 -0
  36. package/dist/tools/schemas.d.ts +355 -0
  37. package/dist/tools/schemas.d.ts.map +1 -0
  38. package/dist/tools/schemas.js +223 -0
  39. package/dist/tools/schemas.js.map +1 -0
  40. package/dist/tools/search-gigs.d.ts +26 -0
  41. package/dist/tools/search-gigs.d.ts.map +1 -0
  42. package/dist/tools/search-gigs.js +42 -0
  43. package/dist/tools/search-gigs.js.map +1 -0
  44. package/dist/tools/send-message.d.ts +9 -0
  45. package/dist/tools/send-message.d.ts.map +1 -0
  46. package/dist/tools/send-message.js +31 -0
  47. package/dist/tools/send-message.js.map +1 -0
  48. package/dist/tools.json +819 -0
  49. package/package.json +67 -0
@@ -0,0 +1,23 @@
1
+ interface FiverrContext {
2
+ userId: number;
3
+ userGuid: string;
4
+ csrfToken: string;
5
+ currency: string;
6
+ countryCode: string;
7
+ locale: string;
8
+ isPro: boolean;
9
+ }
10
+ /** The logged-in user's Fiverr username, sourced from page globals (not in FiverrContext). */
11
+ export declare const getUsername: () => string;
12
+ export declare const isAuthenticated: () => boolean;
13
+ export declare const waitForAuth: () => Promise<boolean>;
14
+ export declare const requireContext: () => FiverrContext;
15
+ export declare const normalizeFiverrUsername: (value: string, fieldName?: string) => string;
16
+ export declare const fetchPerseusProps: (path: string) => Promise<Record<string, unknown>>;
17
+ export declare const fetchInboxJson: <T>(path: string) => Promise<T | null>;
18
+ export interface SendMessageResult {
19
+ messageId: string;
20
+ }
21
+ export declare const sendInboxMessage: (recipientUsername: string, body: string) => Promise<SendMessageResult>;
22
+ export {};
23
+ //# sourceMappingURL=fiverr-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fiverr-api.d.ts","sourceRoot":"","sources":["../src/fiverr-api.ts"],"names":[],"mappings":"AAQA,UAAU,aAAa;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,CAAC;CAChB;AAgBD,8FAA8F;AAC9F,eAAO,MAAM,WAAW,QAAO,MAG3B,CAAC;AAEL,eAAO,MAAM,eAAe,QAAO,OAAgC,CAAC;AAEpE,eAAO,MAAM,WAAW,QAAO,OAAO,CAAC,OAAO,CAI3C,CAAC;AAEJ,eAAO,MAAM,cAAc,QAAO,aAIjC,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,EAAE,kBAAsB,KAAG,MAO/E,CAAC;AAWF,eAAO,MAAM,iBAAiB,GAAU,MAAM,MAAM,KAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAerF,CAAC;AAOF,eAAO,MAAM,cAAc,GAAU,CAAC,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAStE,CAAC;AAcF,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,gBAAgB,GAAU,mBAAmB,MAAM,EAAE,MAAM,MAAM,KAAG,OAAO,CAAC,iBAAiB,CAwBzG,CAAC"}
@@ -0,0 +1,106 @@
1
+ import { ToolError, fetchFromPage, getPageGlobal, httpStatusToToolError, waitUntil } from '@opentabs-dev/plugin-sdk';
2
+ const getContext = () => {
3
+ const userId = getPageGlobal('initialData.FiverrContext.userId');
4
+ if (!userId || userId <= 0)
5
+ return null;
6
+ return {
7
+ userId,
8
+ userGuid: getPageGlobal('initialData.FiverrContext.userGuid') ?? '',
9
+ csrfToken: getPageGlobal('initialData.FiverrContext.csrfToken') ?? '',
10
+ currency: getPageGlobal('initialData.FiverrContext.currency') ?? 'USD',
11
+ countryCode: getPageGlobal('initialData.FiverrContext.countryCode') ?? '',
12
+ locale: getPageGlobal('initialData.FiverrContext.locale') ?? '',
13
+ isPro: getPageGlobal('initialData.FiverrContext.isPro') ?? false,
14
+ };
15
+ };
16
+ /** The logged-in user's Fiverr username, sourced from page globals (not in FiverrContext). */
17
+ export const getUsername = () => getPageGlobal('initialData.UserActivationMessage.username') ??
18
+ getPageGlobal('initialData.FloatingChat.currentUsername') ??
19
+ '';
20
+ export const isAuthenticated = () => getContext() !== null;
21
+ export const waitForAuth = () => waitUntil(() => isAuthenticated(), { interval: 500, timeout: 5000 }).then(() => true, () => false);
22
+ export const requireContext = () => {
23
+ const ctx = getContext();
24
+ if (!ctx)
25
+ throw ToolError.auth('Not authenticated — please log in to Fiverr.');
26
+ return ctx;
27
+ };
28
+ export const normalizeFiverrUsername = (value, fieldName = 'username') => {
29
+ const username = value.trim().replace(/^[@/]+/, '');
30
+ if (!username)
31
+ throw ToolError.validation(`${fieldName} is required.`);
32
+ if (username.includes('/')) {
33
+ throw ToolError.validation(`${fieldName} must be a single Fiverr username with no slashes.`);
34
+ }
35
+ return username;
36
+ };
37
+ // --- SSR data-island extraction ---
38
+ // Fiverr pages (search, gig, seller profile) are server-rendered React apps. The
39
+ // page data is embedded in a `<script id="perseus-initial-props" type="application/json">`
40
+ // island. Attribute order varies in the raw HTML, so the matcher is order-agnostic.
41
+ // This is the only reliable way to read these pages — Fiverr's JSON APIs for them
42
+ // are protected by PerimeterX bot detection and reject adapter-originated fetches.
43
+ const PERSEUS_ISLAND_RE = /<script[^>]*id="perseus-initial-props"[^>]*>([\s\S]*?)<\/script>/;
44
+ export const fetchPerseusProps = async (path) => {
45
+ requireContext();
46
+ const response = await fetchFromPage(path, { headers: { Accept: 'text/html' } });
47
+ if (!response.ok)
48
+ throw httpStatusToToolError(response, `Failed to load ${path}`);
49
+ const html = await response.text();
50
+ const match = html.match(PERSEUS_ISLAND_RE);
51
+ if (!match?.[1])
52
+ throw ToolError.notFound(`No page data found at ${path} — it may not exist or require login.`);
53
+ try {
54
+ return JSON.parse(match[1]);
55
+ }
56
+ catch {
57
+ throw ToolError.internal(`Failed to parse page data at ${path}`);
58
+ }
59
+ };
60
+ // --- Inbox JSON API ---
61
+ // Fiverr's messaging endpoints under `/inbox/*` return JSON and are reachable from
62
+ // adapter fetches (they are not behind the bot-detection layer that guards the
63
+ // gig/seller JSON APIs).
64
+ export const fetchInboxJson = async (path) => {
65
+ requireContext();
66
+ const response = await fetchFromPage(path, {
67
+ headers: { Accept: 'application/json', 'X-Requested-With': 'XMLHttpRequest' },
68
+ });
69
+ if (!response.ok)
70
+ throw httpStatusToToolError(response, `Failed to load ${path}`);
71
+ if (response.status === 204)
72
+ return null;
73
+ return (await response.json());
74
+ };
75
+ // --- Sending messages ---
76
+ // Fiverr's inbox composer posts new messages to /inbox/conversations/messages as
77
+ // JSON. The body wraps the text in a content_blocks array and identifies the thread
78
+ // by the recipient's username. Auth is the session cookie; the page CSRF token is
79
+ // sent as a header for the write.
80
+ const SEND_MESSAGE_PATH = '/inbox/conversations/messages';
81
+ export const sendInboxMessage = async (recipientUsername, body) => {
82
+ const ctx = requireContext();
83
+ const response = await fetchFromPage(SEND_MESSAGE_PATH, {
84
+ method: 'POST',
85
+ headers: {
86
+ Accept: 'application/json',
87
+ 'Content-Type': 'application/json',
88
+ 'X-Requested-With': 'XMLHttpRequest',
89
+ 'X-CSRF-Token': ctx.csrfToken,
90
+ },
91
+ body: JSON.stringify({
92
+ content_blocks: [{ type: 'text', plain_text: body, plain_text_format: null }],
93
+ content_type: 'text',
94
+ participants_usernames: [recipientUsername],
95
+ channel_id: null,
96
+ pending_attachment_ids: [],
97
+ }),
98
+ });
99
+ if (!response.ok)
100
+ throw httpStatusToToolError(response, 'Failed to send message');
101
+ if (response.status === 204)
102
+ return { messageId: '' };
103
+ const data = (await response.json());
104
+ return { messageId: data.id ?? data.message?.id ?? '' };
105
+ };
106
+ //# sourceMappingURL=fiverr-api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fiverr-api.js","sourceRoot":"","sources":["../src/fiverr-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,0BAA0B,C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C9B;QACD,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,cAAc,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAC;YAC7E,YAAY,EAAE,MAAM;YACpB,sBAAsB,EAAE,CAAC,iBAAiB,CAAC;YAC3C,UAAU,EAAE,IAAI;YAChB,sBAAsB,EAAE,EAAE;SAC3B,CAAC;KACH,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,qBAAqB,CAAC,QAAQ,EAAE,wBAAwB,CAAC,CAAC;IAClF,IAAI,QAAQ,CAAC,MAAM,KAAK,GAAG;QAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;IAEtD,MAAM,IAAI,GAAG,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAoB,CAAC;IACxD,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,EAAE,IAAI,EAAE,EAAE,CAAC;AAC1D,CAAC,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { OpenTabsPlugin } from '@opentabs-dev/plugin-sdk';
2
+ import type { ToolDefinition } from '@opentabs-dev/plugin-sdk';
3
+ declare class FiverrPlugin extends OpenTabsPlugin {
4
+ readonly name = "fiverr";
5
+ readonly description = "OpenTabs plugin for Fiverr";
6
+ readonly displayName = "Fiverr";
7
+ readonly urlPatterns: string[];
8
+ readonly homepage = "https://www.fiverr.com";
9
+ readonly tools: ToolDefinition[];
10
+ isReady(): Promise<boolean>;
11
+ }
12
+ declare const _default: FiverrPlugin;
13
+ export default _default;
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAW/D,cAAM,YAAa,SAAQ,cAAc;IACvC,QAAQ,CAAC,IAAI,YAAY;IACzB,QAAQ,CAAC,WAAW,gCAAgC;IACpD,SAAkB,WAAW,YAAY;IACzC,QAAQ,CAAC,WAAW,WAA0B;IAC9C,SAAkB,QAAQ,4BAA4B;IACtD,QAAQ,CAAC,KAAK,EAAE,cAAc,EAAE,CAa9B;IAEI,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;CAIlC;;AAED,wBAAkC"}
package/dist/index.js ADDED
@@ -0,0 +1,38 @@
1
+ import { OpenTabsPlugin } from '@opentabs-dev/plugin-sdk';
2
+ import { isAuthenticated, waitForAuth } from './fiverr-api.js';
3
+ import { draftMessage } from './tools/draft-message.js';
4
+ import { getConversation } from './tools/get-conversation.js';
5
+ import { getCurrentPageContext } from './tools/get-current-page-context.js';
6
+ import { getGigDetails } from './tools/get-gig-details.js';
7
+ import { getSellerProfile } from './tools/get-seller-profile.js';
8
+ import { listConversations } from './tools/list-conversations.js';
9
+ import { searchGigs } from './tools/search-gigs.js';
10
+ import { sendMessage } from './tools/send-message.js';
11
+ class FiverrPlugin extends OpenTabsPlugin {
12
+ name = 'fiverr';
13
+ description = 'OpenTabs plugin for Fiverr';
14
+ displayName = 'Fiverr';
15
+ urlPatterns = ['*://*.fiverr.com/*'];
16
+ homepage = 'https://www.fiverr.com';
17
+ tools = [
18
+ // Account
19
+ getCurrentPageContext,
20
+ // Gigs
21
+ searchGigs,
22
+ getGigDetails,
23
+ // Sellers
24
+ getSellerProfile,
25
+ // Messages
26
+ listConversations,
27
+ getConversation,
28
+ draftMessage,
29
+ sendMessage,
30
+ ];
31
+ async isReady() {
32
+ if (isAuthenticated())
33
+ return true;
34
+ return waitForAuth();
35
+ }
36
+ }
37
+ export default new FiverrPlugin();
38
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,YAAa,SAAQ,cAAc;IAC9B,IAAI,GAAG,QAAQ,CAAC;IAChB,WAAW,GAAG,4BAA4B,CAAC;IAClC,WAAW,GAAG,QAAQ,CAAC;IAChC,WAAW,GAAG,CAAC,oBAAoB,CAAC,CAAC;IAC5B,QAAQ,GAAG,wBAAwB,CAAC;IAC7C,KAAK,GAAqB;QACjC,UAAU;QACV,qBAAqB;QACrB,OAAO;QACP,UAAU;QACV,aAAa;QACb,UAAU;QACV,gBAAgB;QAChB,WAAW;QACX,iBAAiB;QACjB,eAAe;QACf,YAAY;QACZ,WAAW;KACZ,CAAC;IAEF,KAAK,CAAC,OAAO;QACX,IAAI,eAAe,EAAE;YAAE,OAAO,IAAI,CAAC;QACnC,OAAO,WAAW,EAAE,CAAC;IACvB,CAAC;CACF;AAED,eAAe,IAAI,YAAY,EAAE,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const draftMessage: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ recipient_username: z.ZodString;
4
+ body: z.ZodString;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ from: z.ZodString;
7
+ recipient_username: z.ZodString;
8
+ body: z.ZodString;
9
+ char_count: z.ZodNumber;
10
+ ready_to_send: z.ZodBoolean;
11
+ }, z.core.$strip>>;
12
+ //# sourceMappingURL=draft-message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-message.d.ts","sourceRoot":"","sources":["../../src/tools/draft-message.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,YAAY;;;;;;;;;kBAiCvB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { getUsername, normalizeFiverrUsername, requireContext } from '../fiverr-api.js';
4
+ export const draftMessage = defineTool({
5
+ name: 'draft_message',
6
+ displayName: 'Draft Message',
7
+ description: 'Prepare a Fiverr message to a recipient without sending it. Validates the recipient and body and ' +
8
+ 'returns a structured preview (sender, recipient, body, character count). Use this to compose and ' +
9
+ 'confirm a message before calling `send_message`. Makes no network request and sends nothing.',
10
+ summary: 'Compose a message preview without sending',
11
+ icon: 'pencil',
12
+ group: 'Messages',
13
+ input: z.object({
14
+ recipient_username: z.string().min(1).describe('Username of the person the message would be sent to'),
15
+ body: z.string().min(1).describe('Message text to compose'),
16
+ }),
17
+ output: z.object({
18
+ from: z.string().describe('Logged-in user’s username (the sender)'),
19
+ recipient_username: z.string().describe('Recipient username'),
20
+ body: z.string().describe('Composed message text'),
21
+ char_count: z.number().describe('Number of characters in the body'),
22
+ ready_to_send: z.boolean().describe('True when the draft is valid and ready to pass to send_message'),
23
+ }),
24
+ handle: async (params) => {
25
+ requireContext();
26
+ const recipient = normalizeFiverrUsername(params.recipient_username, 'recipient_username');
27
+ const body = params.body.trim();
28
+ return {
29
+ from: getUsername(),
30
+ recipient_username: recipient,
31
+ body,
32
+ char_count: body.length,
33
+ ready_to_send: recipient.length > 0 && body.length > 0,
34
+ };
35
+ },
36
+ });
37
+ //# sourceMappingURL=draft-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"draft-message.js","sourceRoot":"","sources":["../../src/tools/draft-message.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAExF,MAAM,CAAC,MAAM,YAAY,GAAG,UAAU,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,eAAe;IAC5B,WAAW,EACT,mGAAmG;QACnG,mGAAmG;QACnG,8FAA8F;IAChG,OAAO,EAAE,2CAA2C;IACpD,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,qDAAqD,CAAC;QACrG,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,yBAAyB,CAAC;KAC5D,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,wCAAwC,CAAC;QACnE,kBAAkB,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oBAAoB,CAAC;QAC7D,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QAClD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;QACnE,aAAa,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,CAAC,gEAAgE,CAAC;KACtG,CAAC;IACF,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,cAAc,EAAE,CAAC;QACjB,MAAM,SAAS,GAAG,uBAAuB,CAAC,MAAM,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;QAC3F,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,OAAO;YACL,IAAI,EAAE,WAAW,EAAE;YACnB,kBAAkB,EAAE,SAAS;YAC7B,IAAI;YACJ,UAAU,EAAE,IAAI,CAAC,MAAM;YACvB,aAAa,EAAE,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,IAAI,CAAC,MAAM,GAAG,CAAC;SACvD,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ export declare const getConversation: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ username: z.ZodString;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ conversation: z.ZodObject<{
6
+ username: z.ZodString;
7
+ display_name: z.ZodString;
8
+ conversation_id: z.ZodString;
9
+ unread_count: z.ZodNumber;
10
+ last_page: z.ZodBoolean;
11
+ messages: z.ZodArray<z.ZodObject<{
12
+ id: z.ZodString;
13
+ sender: z.ZodString;
14
+ recipient: z.ZodString;
15
+ body: z.ZodString;
16
+ created_at: z.ZodString;
17
+ type: z.ZodString;
18
+ attachment_count: z.ZodNumber;
19
+ }, z.core.$strip>>;
20
+ }, z.core.$strip>;
21
+ }, z.core.$strip>>;
22
+ //# sourceMappingURL=get-conversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-conversation.d.ts","sourceRoot":"","sources":["../../src/tools/get-conversation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;kBAuB1B,CAAC"}
@@ -0,0 +1,28 @@
1
+ import { defineTool, ToolError } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { fetchInboxJson, normalizeFiverrUsername } from '../fiverr-api.js';
4
+ import { conversationSchema, mapConversation } from './schemas.js';
5
+ export const getConversation = defineTool({
6
+ name: 'get_conversation',
7
+ displayName: 'Get Conversation',
8
+ description: 'Read the full message thread of a Fiverr conversation with a specific user. Returns messages ' +
9
+ '(oldest first) with sender, recipient, text, timestamp, and attachment count, plus the unread ' +
10
+ 'count and whether the oldest page has been reached. Pass the other participant’s username, as ' +
11
+ 'returned by `list_conversations`.',
12
+ summary: 'Read a conversation thread',
13
+ icon: 'message-square-text',
14
+ group: 'Messages',
15
+ input: z.object({
16
+ username: z.string().min(1).describe('The other participant’s username (from `list_conversations`)'),
17
+ }),
18
+ output: z.object({ conversation: conversationSchema }),
19
+ handle: async (params) => {
20
+ const username = normalizeFiverrUsername(params.username);
21
+ const raw = await fetchInboxJson(`/inbox/contacts/${encodeURIComponent(username)}`);
22
+ if (!raw?.conversationId) {
23
+ throw ToolError.notFound(`No conversation found with "${username}".`);
24
+ }
25
+ return { conversation: mapConversation(raw) };
26
+ },
27
+ });
28
+ //# sourceMappingURL=get-conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-conversation.js","sourceRoot":"","sources":["../../src/tools/get-conversation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAwB,MAAM,cAAc,CAAC;AAEzF,MAAM,CAAC,MAAM,eAAe,GAAG,UAAU,CAAC;IACxC,IAAI,EAAE,kBAAkB;IACxB,WAAW,EAAE,kBAAkB;IAC/B,WAAW,EACT,+FAA+F;QAC/F,gGAAgG;QAChG,gGAAgG;QAChG,mCAAmC;IACrC,OAAO,EAAE,4BAA4B;IACrC,IAAI,EAAE,qBAAqB;IAC3B,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,8DAA8D,CAAC;KACrG,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;IACtD,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1D,MAAM,GAAG,GAAG,MAAM,cAAc,CAAkB,mBAAmB,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACrG,IAAI,CAAC,GAAG,EAAE,cAAc,EAAE,CAAC;YACzB,MAAM,SAAS,CAAC,QAAQ,CAAC,+BAA+B,QAAQ,IAAI,CAAC,CAAC;QACxE,CAAC;QACD,OAAO,EAAE,YAAY,EAAE,eAAe,CAAC,GAAG,CAAC,EAAE,CAAC;IAChD,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { z } from 'zod';
2
+ export declare const getCurrentPageContext: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
3
+ username: z.ZodString;
4
+ user_id: z.ZodNumber;
5
+ currency: z.ZodString;
6
+ country_code: z.ZodString;
7
+ locale: z.ZodString;
8
+ is_pro: z.ZodBoolean;
9
+ current_url: z.ZodString;
10
+ page_title: z.ZodString;
11
+ }, z.core.$strip>>;
12
+ //# sourceMappingURL=get-current-page-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-current-page-context.d.ts","sourceRoot":"","sources":["../../src/tools/get-current-page-context.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,qBAAqB;;;;;;;;;kBAmChC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { defineTool, getCurrentUrl, getPageTitle } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { getUsername, requireContext } from '../fiverr-api.js';
4
+ export const getCurrentPageContext = defineTool({
5
+ name: 'get_current_page_context',
6
+ displayName: 'Get Current Page Context',
7
+ description: 'Get the logged-in Fiverr account identity and the page currently open in the browser tab. ' +
8
+ 'Returns the username, numeric user ID, account currency/country/locale, Pro status, and the ' +
9
+ 'current page URL and title. Use this to confirm who is logged in and what they are looking at ' +
10
+ 'before taking further actions. Reads page state only — makes no network request.',
11
+ summary: 'Identify the logged-in user and current page',
12
+ icon: 'user',
13
+ group: 'Account',
14
+ input: z.object({}),
15
+ output: z.object({
16
+ username: z.string().describe('Logged-in user’s Fiverr username'),
17
+ user_id: z.number().describe('Logged-in user’s numeric ID'),
18
+ currency: z.string().describe('Account currency (ISO code, e.g., "USD")'),
19
+ country_code: z.string().describe('Account country code (e.g., "US")'),
20
+ locale: z.string().describe('Account locale (e.g., "en-US")'),
21
+ is_pro: z.boolean().describe('Whether the account is a Fiverr Pro account'),
22
+ current_url: z.string().describe('URL of the currently open page'),
23
+ page_title: z.string().describe('Title of the currently open page'),
24
+ }),
25
+ handle: async () => {
26
+ const ctx = requireContext();
27
+ return {
28
+ username: getUsername(),
29
+ user_id: ctx.userId,
30
+ currency: ctx.currency,
31
+ country_code: ctx.countryCode,
32
+ locale: ctx.locale,
33
+ is_pro: ctx.isPro,
34
+ current_url: getCurrentUrl(),
35
+ page_title: getPageTitle(),
36
+ };
37
+ },
38
+ });
39
+ //# sourceMappingURL=get-current-page-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-current-page-context.js","sourceRoot":"","sources":["../../src/tools/get-current-page-context.ts"],"names":[],"mappings":"AAAA,OAAO,E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;YACL,QAAQ,EAAE,WAAW,EAAE;YACvB,OAAO,EAAE,GAAG,CAAC,MAAM;YACnB,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,YAAY,EAAE,GAAG,CAAC,WAAW;YAC7B,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,MAAM,EAAE,GAAG,CAAC,KAAK;YACjB,WAAW,EAAE,aAAa,EAAE;YAC5B,UAAU,EAAE,YAAY,EAAE;SAC3B,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { z } from 'zod';
2
+ export declare const getGigDetails: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ gig_url: z.ZodString;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ gig: z.ZodObject<{
6
+ gig_id: z.ZodNumber;
7
+ title: z.ZodString;
8
+ status: z.ZodString;
9
+ category: z.ZodString;
10
+ subcategory: z.ZodString;
11
+ is_pro: z.ZodBoolean;
12
+ description: z.ZodString;
13
+ rating: z.ZodNumber;
14
+ ratings_count: z.ZodNumber;
15
+ orders_in_queue: z.ZodNumber;
16
+ seller_name: z.ZodString;
17
+ seller_one_liner: z.ZodString;
18
+ seller_country: z.ZodString;
19
+ seller_member_since: z.ZodString;
20
+ seller_response_time: z.ZodString;
21
+ packages: z.ZodArray<z.ZodObject<{
22
+ id: z.ZodNumber;
23
+ title: z.ZodString;
24
+ description: z.ZodString;
25
+ price: z.ZodNumber;
26
+ duration: z.ZodNumber;
27
+ revisions: z.ZodNumber;
28
+ extra_fast: z.ZodBoolean;
29
+ features: z.ZodArray<z.ZodString>;
30
+ }, z.core.$strip>>;
31
+ reviews: z.ZodArray<z.ZodObject<{
32
+ id: z.ZodString;
33
+ reviewer: z.ZodString;
34
+ reviewer_country: z.ZodString;
35
+ rating: z.ZodNumber;
36
+ comment: z.ZodString;
37
+ created_at: z.ZodString;
38
+ }, z.core.$strip>>;
39
+ }, z.core.$strip>;
40
+ }, z.core.$strip>>;
41
+ //# sourceMappingURL=get-gig-details.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-gig-details.d.ts","sourceRoot":"","sources":["../../src/tools/get-gig-details.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6BxB,CAAC"}
@@ -0,0 +1,34 @@
1
+ import { defineTool, ToolError } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { fetchPerseusProps } from '../fiverr-api.js';
4
+ import { gigDetailSchema, mapGigDetail } from './schemas.js';
5
+ export const getGigDetails = defineTool({
6
+ name: 'get_gig_details',
7
+ displayName: 'Get Gig Details',
8
+ description: 'Get full details for a single Fiverr gig: title, description, category, packages (with prices, ' +
9
+ 'delivery times, revisions, and features), rating, orders in queue, seller summary, and recent ' +
10
+ 'reviews. Pass the gig path from a `search_gigs` result (e.g., "/username/gig-slug"). Reads the ' +
11
+ 'gig’s server-rendered page.',
12
+ summary: 'Get full details for a gig',
13
+ icon: 'package',
14
+ group: 'Gigs',
15
+ input: z.object({
16
+ gig_url: z
17
+ .string()
18
+ .min(1)
19
+ .describe('Gig page path or full URL (e.g., "/username/do-something-great" or the absolute URL)'),
20
+ }),
21
+ output: z.object({ gig: gigDetailSchema }),
22
+ handle: async (params) => {
23
+ const path = params.gig_url.replace(/^https?:\/\/[^/]+/, '');
24
+ if (!path.startsWith('/')) {
25
+ throw ToolError.validation('gig_url must be a Fiverr gig path (starting with "/") or a full Fiverr URL.');
26
+ }
27
+ const props = (await fetchPerseusProps(path));
28
+ if (!props.general?.gigId) {
29
+ throw ToolError.notFound(`No gig found at ${path}.`);
30
+ }
31
+ return { gig: mapGigDetail(props) };
32
+ },
33
+ });
34
+ //# sourceMappingURL=get-gig-details.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-gig-details.js","sourceRoot":"","sources":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CAAC;QACD,OAAO,EAAE,GAAG,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;IACtC,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ export declare const getSellerProfile: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{
3
+ username: z.ZodString;
4
+ }, z.core.$strip>, z.ZodObject<{
5
+ seller: z.ZodObject<{
6
+ username: z.ZodString;
7
+ display_name: z.ZodString;
8
+ joined_at: z.ZodString;
9
+ is_pro: z.ZodBoolean;
10
+ is_verified: z.ZodBoolean;
11
+ level: z.ZodString;
12
+ country: z.ZodString;
13
+ one_liner: z.ZodString;
14
+ description: z.ZodString;
15
+ rating: z.ZodNumber;
16
+ ratings_count: z.ZodNumber;
17
+ approved_gigs_count: z.ZodNumber;
18
+ }, z.core.$strip>;
19
+ }, z.core.$strip>>;
20
+ //# sourceMappingURL=get-seller-profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-seller-profile.d.ts","sourceRoot":"","sources":["../../src/tools/get-seller-profile.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;kBAsB3B,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { defineTool, ToolError } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { fetchPerseusProps, normalizeFiverrUsername } from '../fiverr-api.js';
4
+ import { mapSellerProfile, sellerProfileSchema } from './schemas.js';
5
+ export const getSellerProfile = defineTool({
6
+ name: 'get_seller_profile',
7
+ displayName: 'Get Seller Profile',
8
+ description: 'Get a Fiverr seller’s public profile: display name, level, Pro status, country, join date, bio, ' +
9
+ 'overall rating, review count, and the gigs listed on their profile. Pass the seller’s username ' +
10
+ '(the first path segment of a gig URL, or the value of `seller_name` from a search result).',
11
+ summary: 'Get a seller’s public profile',
12
+ icon: 'user-round',
13
+ group: 'Sellers',
14
+ input: z.object({
15
+ username: z.string().min(1).describe('Seller username (e.g., "janedoe")'),
16
+ }),
17
+ output: z.object({ seller: sellerProfileSchema }),
18
+ handle: async (params) => {
19
+ const username = normalizeFiverrUsername(params.username);
20
+ const props = (await fetchPerseusProps(`/${encodeURIComponent(username)}`));
21
+ if (!props.seller?.user?.name) {
22
+ throw ToolError.notFound(`No seller profile found for "${username}".`);
23
+ }
24
+ return { seller: mapSellerProfile(props) };
25
+ },
26
+ });
27
+ //# sourceMappingURL=get-seller-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-seller-profile.js","sourceRoot":"","sources":["../../src/tools/get-seller-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,gBAAgB,EAAyB,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAE5F,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,kGAAkG;QAClG,iGAAiG;QACjG,4FAA4F;IAC9F,OAAO,EAAE,+BAA+B;IACxC,IAAI,EAAE,YAAY;IAClB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC;QACd,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,mCAAmC,CAAC;KAC1E,CAAC;IACF,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,mBAAmB,EAAE,CAAC;IACjD,MAAM,EAAE,KAAK,EAAC,MAAM,EAAC,EAAE;QACrB,MAAM,QAAQ,GAAG,uBAAuB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC1D,MAAM,KAAK,GAAG,CAAC,MAAM,iBAAiB,CAAC,IAAI,kBAAkB,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAqB,CAAC;QAChG,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;YAC9B,MAAM,SAAS,CAAC,QAAQ,CAAC,gCAAgC,QAAQ,IAAI,CAAC,CAAC;QACzE,CAAC;QACD,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7C,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { z } from 'zod';
2
+ export declare const listConversations: import("@opentabs-dev/plugin-sdk").ToolDefinition<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
3
+ conversations: z.ZodArray<z.ZodObject<{
4
+ username: z.ZodString;
5
+ display_name: z.ZodString;
6
+ user_id: z.ZodNumber;
7
+ conversation_id: z.ZodString;
8
+ unread_count: z.ZodNumber;
9
+ excerpt: z.ZodString;
10
+ recent_message_date: z.ZodString;
11
+ online: z.ZodBoolean;
12
+ archived: z.ZodBoolean;
13
+ starred: z.ZodBoolean;
14
+ }, z.core.$strip>>;
15
+ }, z.core.$strip>>;
16
+ //# sourceMappingURL=list-conversations.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-conversations.d.ts","sourceRoot":"","sources":["../../src/tools/list-conversations.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;kBAmB5B,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { defineTool } from '@opentabs-dev/plugin-sdk';
2
+ import { z } from 'zod';
3
+ import { fetchInboxJson } from '../fiverr-api.js';
4
+ import { conversationSummarySchema, mapConversationSummary } from './schemas.js';
5
+ export const listConversations = defineTool({
6
+ name: 'list_conversations',
7
+ displayName: 'List Conversations',
8
+ description: 'List the logged-in user’s Fiverr inbox conversations, most recent first. Each entry includes the ' +
9
+ 'other participant’s username, unread count, a preview of the latest message, and the timestamp. ' +
10
+ 'Pass a username from a result to `get_conversation` to read the full thread.',
11
+ summary: 'List Fiverr inbox conversations',
12
+ icon: 'messages-square',
13
+ group: 'Messages',
14
+ input: z.object({}),
15
+ output: z.object({
16
+ conversations: z.array(conversationSummarySchema).describe('Inbox conversations, most recent first'),
17
+ }),
18
+ handle: async () => {
19
+ const contacts = await fetchInboxJson('/inbox/contacts');
20
+ const contactList = Array.isArray(contacts) ? contacts : [];
21
+ return { conversations: contactList.map(mapConversationSummary) };
22
+ },
23
+ });
24
+ //# sourceMappingURL=list-conversations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"list-conversations.js","sourceRoot":"","sources":["../../src/tools/list-conversations.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,sBAAsB,EAAmB,MAAM,cAAc,CAAC;AAElG,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;IAC1C,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EAAE,oBAAoB;IACjC,WAAW,EACT,mGAAmG;QACnG,kGAAkG;QAClG,8EAA8E;IAChF,OAAO,EAAE,iCAAiC;IAC1C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,UAAU;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC;IACnB,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC,QAAQ,CAAC,wCAAwC,CAAC;KACrG,CAAC;IACF,MAAM,EAAE,KAAK,IAAI,EAAE;QACjB,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAe,iBAAiB,CAAC,CAAC;QACvE,MAAM,WAAW,GAAG,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC;QAC5D,OAAO,EAAE,aAAa,EAAE,WAAW,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,CAAC;IACpE,CAAC;CACF,CAAC,CAAC"}