@lightsage/mcp 0.4.4 → 0.4.5

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 (74) hide show
  1. package/README.md +2 -2
  2. package/bin/mcp-server.js +351 -765
  3. package/bin/mcp-server.js.map +10 -20
  4. package/esm/landing-page.js +1 -1
  5. package/esm/lib/config.d.ts +2 -2
  6. package/esm/lib/config.js +2 -2
  7. package/esm/mcp-server/mcp-server.js +1 -1
  8. package/esm/mcp-server/server.d.ts.map +1 -1
  9. package/esm/mcp-server/server.js +1 -7
  10. package/esm/mcp-server/server.js.map +1 -1
  11. package/esm/tool-names.d.ts.map +1 -1
  12. package/esm/tool-names.js +0 -12
  13. package/esm/tool-names.js.map +1 -1
  14. package/package.json +1 -1
  15. package/src/landing-page.ts +1 -1
  16. package/src/lib/config.ts +2 -2
  17. package/src/mcp-server/mcp-server.ts +1 -1
  18. package/src/mcp-server/server.ts +1 -7
  19. package/src/tool-names.ts +0 -12
  20. package/esm/funcs/contentV2ContentDraftsCreate.d.ts +0 -16
  21. package/esm/funcs/contentV2ContentDraftsCreate.d.ts.map +0 -1
  22. package/esm/funcs/contentV2ContentDraftsCreate.js +0 -83
  23. package/esm/funcs/contentV2ContentDraftsCreate.js.map +0 -1
  24. package/esm/funcs/contentV2ContentFinalize.d.ts +0 -16
  25. package/esm/funcs/contentV2ContentFinalize.d.ts.map +0 -1
  26. package/esm/funcs/contentV2ContentFinalize.js +0 -88
  27. package/esm/funcs/contentV2ContentFinalize.js.map +0 -1
  28. package/esm/funcs/contentV2ContentRetrieve.d.ts +0 -16
  29. package/esm/funcs/contentV2ContentRetrieve.d.ts.map +0 -1
  30. package/esm/funcs/contentV2ContentRetrieve.js +0 -88
  31. package/esm/funcs/contentV2ContentRetrieve.js.map +0 -1
  32. package/esm/mcp-server/tools/contentV2ContentDraftsCreate.d.ts +0 -7
  33. package/esm/mcp-server/tools/contentV2ContentDraftsCreate.d.ts.map +0 -1
  34. package/esm/mcp-server/tools/contentV2ContentDraftsCreate.js +0 -35
  35. package/esm/mcp-server/tools/contentV2ContentDraftsCreate.js.map +0 -1
  36. package/esm/mcp-server/tools/contentV2ContentFinalize.d.ts +0 -7
  37. package/esm/mcp-server/tools/contentV2ContentFinalize.d.ts.map +0 -1
  38. package/esm/mcp-server/tools/contentV2ContentFinalize.js +0 -35
  39. package/esm/mcp-server/tools/contentV2ContentFinalize.js.map +0 -1
  40. package/esm/mcp-server/tools/contentV2ContentRetrieve.d.ts +0 -7
  41. package/esm/mcp-server/tools/contentV2ContentRetrieve.d.ts.map +0 -1
  42. package/esm/mcp-server/tools/contentV2ContentRetrieve.js +0 -35
  43. package/esm/mcp-server/tools/contentV2ContentRetrieve.js.map +0 -1
  44. package/esm/models/generatecontentdraftrequest.d.ts +0 -9
  45. package/esm/models/generatecontentdraftrequest.d.ts.map +0 -1
  46. package/esm/models/generatecontentdraftrequest.js +0 -12
  47. package/esm/models/generatecontentdraftrequest.js.map +0 -1
  48. package/esm/models/publiccontent.d.ts +0 -11
  49. package/esm/models/publiccontent.d.ts.map +0 -1
  50. package/esm/models/publiccontent.js +0 -14
  51. package/esm/models/publiccontent.js.map +0 -1
  52. package/esm/models/v2contentdraftscreateop.d.ts +0 -6
  53. package/esm/models/v2contentdraftscreateop.d.ts.map +0 -1
  54. package/esm/models/v2contentdraftscreateop.js +0 -12
  55. package/esm/models/v2contentdraftscreateop.js.map +0 -1
  56. package/esm/models/v2contentfinalizeop.d.ts +0 -10
  57. package/esm/models/v2contentfinalizeop.d.ts.map +0 -1
  58. package/esm/models/v2contentfinalizeop.js +0 -15
  59. package/esm/models/v2contentfinalizeop.js.map +0 -1
  60. package/esm/models/v2contentretrieveop.d.ts +0 -10
  61. package/esm/models/v2contentretrieveop.d.ts.map +0 -1
  62. package/esm/models/v2contentretrieveop.js +0 -15
  63. package/esm/models/v2contentretrieveop.js.map +0 -1
  64. package/src/funcs/contentV2ContentDraftsCreate.ts +0 -145
  65. package/src/funcs/contentV2ContentFinalize.ts +0 -153
  66. package/src/funcs/contentV2ContentRetrieve.ts +0 -153
  67. package/src/mcp-server/tools/contentV2ContentDraftsCreate.ts +0 -43
  68. package/src/mcp-server/tools/contentV2ContentFinalize.ts +0 -43
  69. package/src/mcp-server/tools/contentV2ContentRetrieve.ts +0 -43
  70. package/src/models/generatecontentdraftrequest.ts +0 -28
  71. package/src/models/publiccontent.ts +0 -24
  72. package/src/models/v2contentdraftscreateop.ts +0 -20
  73. package/src/models/v2contentfinalizeop.ts +0 -28
  74. package/src/models/v2contentretrieveop.ts +0 -28
@@ -1,153 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 39ba2f152e98
4
- */
5
-
6
- import { LightsageMcpCore } from "../core.js";
7
- import { encodeSimple } from "../lib/encodings.js";
8
- import { compactMap } from "../lib/primitives.js";
9
- import { safeParse } from "../lib/schemas.js";
10
- import { RequestOptions } from "../lib/sdks.js";
11
- import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
12
- import { pathToFunc } from "../lib/url.js";
13
- import { APIError } from "../models/errors/apierror.js";
14
- import {
15
- ConnectionError,
16
- InvalidRequestError,
17
- RequestAbortedError,
18
- RequestTimeoutError,
19
- UnexpectedClientError,
20
- } from "../models/errors/httpclienterrors.js";
21
- import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
22
- import {
23
- V2ContentRetrieveRequest,
24
- V2ContentRetrieveRequest$zodSchema,
25
- } from "../models/v2contentretrieveop.js";
26
- import { APICall, APIPromise } from "../types/async.js";
27
- import { Result } from "../types/fp.js";
28
-
29
- /**
30
- * Retrieve Content
31
- *
32
- * @remarks
33
- * Returns a content record by ID, including title, markdown body, slug, and status.
34
- */
35
- export function contentV2ContentRetrieve(
36
- client$: LightsageMcpCore,
37
- request: V2ContentRetrieveRequest,
38
- options?: RequestOptions,
39
- ): APIPromise<
40
- Result<
41
- Response,
42
- | APIError
43
- | SDKValidationError
44
- | UnexpectedClientError
45
- | InvalidRequestError
46
- | RequestAbortedError
47
- | RequestTimeoutError
48
- | ConnectionError
49
- >
50
- > {
51
- return new APIPromise($do(
52
- client$,
53
- request,
54
- options,
55
- ));
56
- }
57
-
58
- async function $do(
59
- client$: LightsageMcpCore,
60
- request: V2ContentRetrieveRequest,
61
- options?: RequestOptions,
62
- ): Promise<
63
- [
64
- Result<
65
- Response,
66
- | APIError
67
- | SDKValidationError
68
- | UnexpectedClientError
69
- | InvalidRequestError
70
- | RequestAbortedError
71
- | RequestTimeoutError
72
- | ConnectionError
73
- >,
74
- APICall,
75
- ]
76
- > {
77
- const parsed$ = safeParse(
78
- request,
79
- (value$) => V2ContentRetrieveRequest$zodSchema.parse(value$),
80
- "Input validation failed",
81
- );
82
- if (!parsed$.ok) {
83
- return [parsed$, { status: "invalid" }];
84
- }
85
- const payload$ = parsed$.value;
86
- const body$ = null;
87
-
88
- const pathParams$ = {
89
- content_id: encodeSimple("content_id", payload$.content_id, {
90
- explode: false,
91
- charEncoding: "percent",
92
- }),
93
- };
94
- const path$ = pathToFunc("/v2/content/{content_id}")(
95
- pathParams$,
96
- );
97
-
98
- const headers$ = new Headers(compactMap({
99
- Accept: "application/json",
100
- }));
101
- const securityInput = await extractSecurity(client$._options.security);
102
- const requestSecurity = resolveGlobalSecurity(securityInput);
103
-
104
- const context = {
105
- options: client$._options,
106
- baseURL: options?.serverURL ?? client$._baseURL ?? "",
107
- operationID: "v2_content_retrieve",
108
- oAuth2Scopes: null,
109
- resolvedSecurity: requestSecurity,
110
- securitySource: client$._options.security,
111
- retryConfig: options?.retries
112
- || client$._options.retryConfig
113
- || { strategy: "none" },
114
- retryCodes: options?.retryCodes || [
115
- "429",
116
- "500",
117
- "502",
118
- "503",
119
- "504",
120
- ],
121
- };
122
-
123
- const requestRes = client$._createRequest(context, {
124
- security: requestSecurity,
125
- method: "GET",
126
- baseURL: options?.serverURL,
127
- path: path$,
128
- headers: headers$,
129
- body: body$,
130
- userAgent: client$._options.userAgent,
131
- timeoutMs: options?.timeoutMs || client$._options.timeoutMs
132
- || -1,
133
- }, options);
134
- if (!requestRes.ok) {
135
- return [requestRes, { status: "invalid" }];
136
- }
137
- const req$ = requestRes.value;
138
-
139
- const doResult = await client$._do(req$, {
140
- context,
141
- errorCodes: [],
142
- retryConfig: context.retryConfig,
143
- retryCodes: context.retryCodes,
144
- });
145
- if (!doResult.ok) {
146
- return [doResult, { status: "request-error", request: req$ }];
147
- }
148
- return [doResult, {
149
- status: "complete",
150
- "request": req$,
151
- response: doResult.value,
152
- }];
153
- }
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: fda9acfbb00d
4
- */
5
-
6
- import { contentV2ContentDraftsCreate } from "../../funcs/contentV2ContentDraftsCreate.js";
7
- import { GenerateContentDraftRequest$zodSchema } from "../../models/generatecontentdraftrequest.js";
8
- import { formatResult, ToolDefinition } from "../tools.js";
9
-
10
- const args = {
11
- request: GenerateContentDraftRequest$zodSchema,
12
- };
13
-
14
- export const tool$contentV2ContentDraftsCreate: ToolDefinition<typeof args> = {
15
- name: "content-v2-content-drafts-create",
16
- description: `Create Content Draft
17
-
18
- Generates and saves a draft article using AI. Returns the new content record with its ID, title, markdown body, slug, and status. Consumes credits.`,
19
- annotations: {
20
- "title": "",
21
- "destructiveHint": false,
22
- "idempotentHint": false,
23
- "openWorldHint": false,
24
- "readOnlyHint": false,
25
- },
26
- args,
27
- tool: async (client, args, ctx) => {
28
- const [result] = await contentV2ContentDraftsCreate(
29
- client,
30
- args.request,
31
- { fetchOptions: { signal: ctx.signal } },
32
- ).$inspect();
33
-
34
- if (!result.ok) {
35
- return {
36
- content: [{ type: "text", text: result.error.message }],
37
- isError: true,
38
- };
39
- }
40
-
41
- return formatResult(result.value);
42
- },
43
- };
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: de0821e3a202
4
- */
5
-
6
- import { contentV2ContentFinalize } from "../../funcs/contentV2ContentFinalize.js";
7
- import { V2ContentFinalizeRequest$zodSchema } from "../../models/v2contentfinalizeop.js";
8
- import { formatResult, ToolDefinition } from "../tools.js";
9
-
10
- const args = {
11
- request: V2ContentFinalizeRequest$zodSchema,
12
- };
13
-
14
- export const tool$contentV2ContentFinalize: ToolDefinition<typeof args> = {
15
- name: "content-v2-content-finalize",
16
- description: `Finalize Content
17
-
18
- Rewrites an existing draft into final, publish-ready content and updates its status. Consumes credits.`,
19
- annotations: {
20
- "title": "",
21
- "destructiveHint": false,
22
- "idempotentHint": false,
23
- "openWorldHint": false,
24
- "readOnlyHint": false,
25
- },
26
- args,
27
- tool: async (client, args, ctx) => {
28
- const [result] = await contentV2ContentFinalize(
29
- client,
30
- args.request,
31
- { fetchOptions: { signal: ctx.signal } },
32
- ).$inspect();
33
-
34
- if (!result.ok) {
35
- return {
36
- content: [{ type: "text", text: result.error.message }],
37
- isError: true,
38
- };
39
- }
40
-
41
- return formatResult(result.value);
42
- },
43
- };
@@ -1,43 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: d877f6fd34f7
4
- */
5
-
6
- import { contentV2ContentRetrieve } from "../../funcs/contentV2ContentRetrieve.js";
7
- import { V2ContentRetrieveRequest$zodSchema } from "../../models/v2contentretrieveop.js";
8
- import { formatResult, ToolDefinition } from "../tools.js";
9
-
10
- const args = {
11
- request: V2ContentRetrieveRequest$zodSchema,
12
- };
13
-
14
- export const tool$contentV2ContentRetrieve: ToolDefinition<typeof args> = {
15
- name: "content-v2-content-retrieve",
16
- description: `Retrieve Content
17
-
18
- Returns a content record by ID, including title, markdown body, slug, and status.`,
19
- annotations: {
20
- "title": "",
21
- "destructiveHint": false,
22
- "idempotentHint": false,
23
- "openWorldHint": false,
24
- "readOnlyHint": true,
25
- },
26
- args,
27
- tool: async (client, args, ctx) => {
28
- const [result] = await contentV2ContentRetrieve(
29
- client,
30
- args.request,
31
- { fetchOptions: { signal: ctx.signal } },
32
- ).$inspect();
33
-
34
- if (!result.ok) {
35
- return {
36
- content: [{ type: "text", text: result.error.message }],
37
- isError: true,
38
- };
39
- }
40
-
41
- return formatResult(result.value);
42
- },
43
- };
@@ -1,28 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: dd64a9271eda
4
- */
5
-
6
- import * as z from "zod";
7
-
8
- export type GenerateContentDraftRequest = {
9
- title: string;
10
- topic_name?: string | undefined;
11
- description?: string | undefined;
12
- prompt_texts?: Array<string> | undefined;
13
- };
14
-
15
- export const GenerateContentDraftRequest$zodSchema: z.ZodType<
16
- GenerateContentDraftRequest
17
- > = z.object({
18
- description: z.string().optional().describe(
19
- "Brief on angle, audience, or goals.",
20
- ),
21
- prompt_texts: z.array(z.string()).optional().describe(
22
- "Related prompts or questions to ground the article.",
23
- ),
24
- title: z.string(),
25
- topic_name: z.string().optional().describe(
26
- "The topic or theme for the article. Defaults to `title`.",
27
- ),
28
- });
@@ -1,24 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 7b9d6d3d39e6
4
- */
5
-
6
- import * as z from "zod";
7
-
8
- export type PublicContent = {
9
- id: string;
10
- title: string;
11
- text: string;
12
- slug: string;
13
- status: string;
14
- description?: string | null | undefined;
15
- };
16
-
17
- export const PublicContent$zodSchema: z.ZodType<PublicContent> = z.object({
18
- description: z.string().nullable().optional(),
19
- id: z.string(),
20
- slug: z.string(),
21
- status: z.string(),
22
- text: z.string().describe("The article body in Markdown."),
23
- title: z.string(),
24
- });
@@ -1,20 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 0221968c431c
4
- */
5
-
6
- import * as z from "zod";
7
- import {
8
- HTTPValidationError,
9
- HTTPValidationError$zodSchema,
10
- } from "./httpvalidationerror.js";
11
- import { PublicContent, PublicContent$zodSchema } from "./publiccontent.js";
12
-
13
- export type V2ContentDraftsCreateResponse = PublicContent | HTTPValidationError;
14
-
15
- export const V2ContentDraftsCreateResponse$zodSchema: z.ZodType<
16
- V2ContentDraftsCreateResponse
17
- > = z.union([
18
- PublicContent$zodSchema,
19
- HTTPValidationError$zodSchema,
20
- ]);
@@ -1,28 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 9a35d349fcac
4
- */
5
-
6
- import * as z from "zod";
7
- import {
8
- HTTPValidationError,
9
- HTTPValidationError$zodSchema,
10
- } from "./httpvalidationerror.js";
11
- import { PublicContent, PublicContent$zodSchema } from "./publiccontent.js";
12
-
13
- export type V2ContentFinalizeRequest = { content_id: string };
14
-
15
- export const V2ContentFinalizeRequest$zodSchema: z.ZodType<
16
- V2ContentFinalizeRequest
17
- > = z.object({
18
- content_id: z.string(),
19
- });
20
-
21
- export type V2ContentFinalizeResponse = PublicContent | HTTPValidationError;
22
-
23
- export const V2ContentFinalizeResponse$zodSchema: z.ZodType<
24
- V2ContentFinalizeResponse
25
- > = z.union([
26
- PublicContent$zodSchema,
27
- HTTPValidationError$zodSchema,
28
- ]);
@@ -1,28 +0,0 @@
1
- /*
2
- * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
- * @generated-id: 5214c995de25
4
- */
5
-
6
- import * as z from "zod";
7
- import {
8
- HTTPValidationError,
9
- HTTPValidationError$zodSchema,
10
- } from "./httpvalidationerror.js";
11
- import { PublicContent, PublicContent$zodSchema } from "./publiccontent.js";
12
-
13
- export type V2ContentRetrieveRequest = { content_id: string };
14
-
15
- export const V2ContentRetrieveRequest$zodSchema: z.ZodType<
16
- V2ContentRetrieveRequest
17
- > = z.object({
18
- content_id: z.string(),
19
- });
20
-
21
- export type V2ContentRetrieveResponse = PublicContent | HTTPValidationError;
22
-
23
- export const V2ContentRetrieveResponse$zodSchema: z.ZodType<
24
- V2ContentRetrieveResponse
25
- > = z.union([
26
- PublicContent$zodSchema,
27
- HTTPValidationError$zodSchema,
28
- ]);