@get-technology-inc/jamf-docs-mcp-server 1.0.0 → 1.2.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 +61 -139
- package/dist/completions.d.ts +13 -0
- package/dist/completions.d.ts.map +1 -0
- package/dist/completions.js +31 -0
- package/dist/completions.js.map +1 -0
- package/dist/constants.d.ts +123 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +187 -17
- package/dist/constants.js.map +1 -1
- package/dist/index.js +46 -6
- package/dist/index.js.map +1 -1
- package/dist/prompts/compare-versions.d.ts +7 -0
- package/dist/prompts/compare-versions.d.ts.map +1 -0
- package/dist/prompts/compare-versions.js +56 -0
- package/dist/prompts/compare-versions.js.map +1 -0
- package/dist/prompts/index.d.ts +6 -0
- package/dist/prompts/index.d.ts.map +1 -0
- package/dist/prompts/index.js +12 -0
- package/dist/prompts/index.js.map +1 -0
- package/dist/prompts/setup-guide.d.ts +7 -0
- package/dist/prompts/setup-guide.d.ts.map +1 -0
- package/dist/prompts/setup-guide.js +53 -0
- package/dist/prompts/setup-guide.js.map +1 -0
- package/dist/prompts/troubleshoot.d.ts +7 -0
- package/dist/prompts/troubleshoot.d.ts.map +1 -0
- package/dist/prompts/troubleshoot.js +52 -0
- package/dist/prompts/troubleshoot.js.map +1 -0
- package/dist/resources/index.d.ts +13 -0
- package/dist/resources/index.d.ts.map +1 -0
- package/dist/resources/index.js +121 -0
- package/dist/resources/index.js.map +1 -0
- package/dist/schemas/index.d.ts +29 -63
- package/dist/schemas/index.d.ts.map +1 -1
- package/dist/schemas/index.js +35 -16
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/output.d.ts +63 -0
- package/dist/schemas/output.d.ts.map +1 -0
- package/dist/schemas/output.js +63 -0
- package/dist/schemas/output.js.map +1 -0
- package/dist/services/cache.d.ts +37 -12
- package/dist/services/cache.d.ts.map +1 -1
- package/dist/services/cache.js +141 -41
- package/dist/services/cache.js.map +1 -1
- package/dist/services/metadata.d.ts +78 -0
- package/dist/services/metadata.d.ts.map +1 -0
- package/dist/services/metadata.js +362 -0
- package/dist/services/metadata.js.map +1 -0
- package/dist/services/scraper.d.ts +3 -2
- package/dist/services/scraper.d.ts.map +1 -1
- package/dist/services/scraper.js +170 -145
- package/dist/services/scraper.js.map +1 -1
- package/dist/services/search-suggestions.d.ts +27 -0
- package/dist/services/search-suggestions.d.ts.map +1 -0
- package/dist/services/search-suggestions.js +193 -0
- package/dist/services/search-suggestions.js.map +1 -0
- package/dist/services/tokenizer.d.ts +17 -1
- package/dist/services/tokenizer.d.ts.map +1 -1
- package/dist/services/tokenizer.js +122 -66
- package/dist/services/tokenizer.js.map +1 -1
- package/dist/tools/get-article.d.ts +1 -1
- package/dist/tools/get-article.d.ts.map +1 -1
- package/dist/tools/get-article.js +145 -70
- package/dist/tools/get-article.js.map +1 -1
- package/dist/tools/get-toc.d.ts +1 -1
- package/dist/tools/get-toc.d.ts.map +1 -1
- package/dist/tools/get-toc.js +107 -47
- package/dist/tools/get-toc.js.map +1 -1
- package/dist/tools/list-products.d.ts +1 -1
- package/dist/tools/list-products.d.ts.map +1 -1
- package/dist/tools/list-products.js +42 -13
- package/dist/tools/list-products.js.map +1 -1
- package/dist/tools/search.d.ts +1 -1
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +142 -69
- package/dist/tools/search.js.map +1 -1
- package/dist/transport/http.d.ts +12 -0
- package/dist/transport/http.d.ts.map +1 -0
- package/dist/transport/http.js +297 -0
- package/dist/transport/http.js.map +1 -0
- package/dist/transport/index.d.ts +13 -0
- package/dist/transport/index.d.ts.map +1 -0
- package/dist/transport/index.js +40 -0
- package/dist/transport/index.js.map +1 -0
- package/dist/types.d.ts +12 -18
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/doc-type.d.ts +9 -0
- package/dist/utils/doc-type.d.ts.map +1 -0
- package/dist/utils/doc-type.js +16 -0
- package/dist/utils/doc-type.js.map +1 -0
- package/dist/utils/progress.d.ts +13 -0
- package/dist/utils/progress.d.ts.map +1 -0
- package/dist/utils/progress.js +18 -0
- package/dist/utils/progress.js.map +1 -0
- package/dist/utils/sanitize.d.ts +30 -0
- package/dist/utils/sanitize.d.ts.map +1 -0
- package/dist/utils/sanitize.js +57 -0
- package/dist/utils/sanitize.js.map +1 -0
- package/dist/utils/url.d.ts +11 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +23 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +8 -5
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Resources registration
|
|
3
|
+
*
|
|
4
|
+
* Exposes dynamic reference data for AI clients to read directly
|
|
5
|
+
* without needing to call tools. Data is fetched from the API
|
|
6
|
+
* with fallback to static constants.
|
|
7
|
+
*/
|
|
8
|
+
import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
9
|
+
import { JAMF_PRODUCTS } from '../constants.js';
|
|
10
|
+
import { getProductsResourceData, getTopicsResourceData, getAvailableVersions } from '../services/metadata.js';
|
|
11
|
+
import { fetchTableOfContents } from '../services/scraper.js';
|
|
12
|
+
import { completeProduct } from '../completions.js';
|
|
13
|
+
function validateProductId(productId, uri) {
|
|
14
|
+
const productIdStr = String(productId);
|
|
15
|
+
if (productIdStr in JAMF_PRODUCTS) {
|
|
16
|
+
return { valid: true, id: productIdStr };
|
|
17
|
+
}
|
|
18
|
+
const validIds = Object.keys(JAMF_PRODUCTS).join(', ');
|
|
19
|
+
return {
|
|
20
|
+
valid: false,
|
|
21
|
+
errorResponse: {
|
|
22
|
+
contents: [{
|
|
23
|
+
uri: uri.href,
|
|
24
|
+
mimeType: 'text/plain',
|
|
25
|
+
text: `Invalid product ID: "${productIdStr}". Valid products: ${validIds}`,
|
|
26
|
+
}],
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Register all MCP resources
|
|
32
|
+
*/
|
|
33
|
+
export function registerResources(server) {
|
|
34
|
+
// Products resource - dynamic with fallback
|
|
35
|
+
server.registerResource('products', 'jamf://products', {
|
|
36
|
+
title: 'Jamf Products List',
|
|
37
|
+
description: 'List of all available Jamf products (Jamf Pro, Jamf School, Jamf Connect, Jamf Protect) with their IDs and latest versions. Data is fetched dynamically from the API.',
|
|
38
|
+
mimeType: 'application/json'
|
|
39
|
+
}, async () => {
|
|
40
|
+
const data = await getProductsResourceData();
|
|
41
|
+
return {
|
|
42
|
+
contents: [{
|
|
43
|
+
uri: 'jamf://products',
|
|
44
|
+
mimeType: 'application/json',
|
|
45
|
+
text: JSON.stringify(data, null, 2)
|
|
46
|
+
}]
|
|
47
|
+
};
|
|
48
|
+
});
|
|
49
|
+
// Topics resource - dynamic with fallback
|
|
50
|
+
server.registerResource('topics', 'jamf://topics', {
|
|
51
|
+
title: 'Jamf Documentation Topics',
|
|
52
|
+
description: 'Topic categories for filtering documentation searches. Combines official TOC structure with curated categories.',
|
|
53
|
+
mimeType: 'application/json'
|
|
54
|
+
}, async () => {
|
|
55
|
+
const data = await getTopicsResourceData();
|
|
56
|
+
return {
|
|
57
|
+
contents: [{
|
|
58
|
+
uri: 'jamf://topics',
|
|
59
|
+
mimeType: 'application/json',
|
|
60
|
+
text: JSON.stringify(data, null, 2)
|
|
61
|
+
}]
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
// Resource template: Product-specific TOC
|
|
65
|
+
server.registerResource('product-toc', new ResourceTemplate('jamf://products/{productId}/toc', {
|
|
66
|
+
list: undefined,
|
|
67
|
+
complete: { productId: completeProduct },
|
|
68
|
+
}), {
|
|
69
|
+
title: 'Product Table of Contents',
|
|
70
|
+
description: 'Table of contents for a specific Jamf product documentation',
|
|
71
|
+
mimeType: 'application/json',
|
|
72
|
+
}, async (uri, { productId }) => {
|
|
73
|
+
const validation = validateProductId(productId, uri);
|
|
74
|
+
if (!validation.valid) {
|
|
75
|
+
return validation.errorResponse;
|
|
76
|
+
}
|
|
77
|
+
const tocResult = await fetchTableOfContents(validation.id, 'current', {
|
|
78
|
+
maxTokens: 20000,
|
|
79
|
+
});
|
|
80
|
+
return {
|
|
81
|
+
contents: [{
|
|
82
|
+
uri: uri.href,
|
|
83
|
+
mimeType: 'application/json',
|
|
84
|
+
text: JSON.stringify({
|
|
85
|
+
product: JAMF_PRODUCTS[validation.id].name,
|
|
86
|
+
totalEntries: tocResult.pagination.totalItems,
|
|
87
|
+
toc: tocResult.toc,
|
|
88
|
+
}, null, 2),
|
|
89
|
+
}],
|
|
90
|
+
};
|
|
91
|
+
});
|
|
92
|
+
// Resource template: Product-specific versions
|
|
93
|
+
server.registerResource('product-versions', new ResourceTemplate('jamf://products/{productId}/versions', {
|
|
94
|
+
list: undefined,
|
|
95
|
+
complete: { productId: completeProduct },
|
|
96
|
+
}), {
|
|
97
|
+
title: 'Product Documentation Versions',
|
|
98
|
+
description: 'Available documentation versions for a specific Jamf product',
|
|
99
|
+
mimeType: 'application/json',
|
|
100
|
+
}, async (uri, { productId }) => {
|
|
101
|
+
const validation = validateProductId(productId, uri);
|
|
102
|
+
if (!validation.valid) {
|
|
103
|
+
return validation.errorResponse;
|
|
104
|
+
}
|
|
105
|
+
const versions = await getAvailableVersions(validation.id);
|
|
106
|
+
return {
|
|
107
|
+
contents: [{
|
|
108
|
+
uri: uri.href,
|
|
109
|
+
mimeType: 'application/json',
|
|
110
|
+
text: JSON.stringify({
|
|
111
|
+
product: JAMF_PRODUCTS[validation.id].name,
|
|
112
|
+
productId: validation.id,
|
|
113
|
+
versions,
|
|
114
|
+
latestVersion: JAMF_PRODUCTS[validation.id].latestVersion,
|
|
115
|
+
}, null, 2),
|
|
116
|
+
}],
|
|
117
|
+
};
|
|
118
|
+
});
|
|
119
|
+
console.error('Registered resources: jamf://products, jamf://topics,', 'jamf://products/{productId}/toc, jamf://products/{productId}/versions');
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=index.js.map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C,CAAC,IAAI;wBAC1C,SAAS,EAAE,UAAU,CAAC,EAAE;wBACxB,QAAQ;wBACR,aAAa,EAAE,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,aAAa;qBAC1D,EAAE,IAAI,EAAE,CAAC,CAAC;iBACZ,CAAC;SACH,CAAC;IACJ,CAAC,CACF,CAAC;IAEF,OAAO,CAAC,KAAK,CACX,uDAAuD,EACvD,uEAAuE,CACxE,CAAC;AACJ,CAAC"}
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -2,97 +2,63 @@
|
|
|
2
2
|
* Zod schemas for input validation
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import { ResponseFormat } from '../constants.js';
|
|
5
|
+
import { ResponseFormat, OutputMode } from '../constants.js';
|
|
6
6
|
/**
|
|
7
7
|
* Schema for jamf_docs_list_products
|
|
8
8
|
*/
|
|
9
9
|
export declare const ListProductsInputSchema: z.ZodObject<{
|
|
10
10
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
maxTokens?: number | undefined;
|
|
15
|
-
}, {
|
|
16
|
-
maxTokens?: number | undefined;
|
|
17
|
-
responseFormat?: ResponseFormat | undefined;
|
|
18
|
-
}>;
|
|
11
|
+
outputMode: z.ZodDefault<z.ZodEnum<typeof OutputMode>>;
|
|
12
|
+
responseFormat: z.ZodDefault<z.ZodEnum<typeof ResponseFormat>>;
|
|
13
|
+
}, z.core.$strict>;
|
|
19
14
|
export type ListProductsInput = z.infer<typeof ListProductsInputSchema>;
|
|
20
15
|
/**
|
|
21
16
|
* Schema for jamf_docs_search
|
|
22
17
|
*/
|
|
23
18
|
export declare const SearchInputSchema: z.ZodObject<{
|
|
24
19
|
query: z.ZodString;
|
|
25
|
-
product: z.ZodOptional<z.ZodEnum<
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
product: import("@modelcontextprotocol/sdk/server/completable.js").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
21
|
+
[x: string]: string;
|
|
22
|
+
}>>>;
|
|
23
|
+
topic: import("@modelcontextprotocol/sdk/server/completable.js").CompletableSchema<z.ZodOptional<z.ZodEnum<{
|
|
24
|
+
[x: string]: string;
|
|
25
|
+
}>>>;
|
|
26
|
+
version: import("@modelcontextprotocol/sdk/server/completable.js").CompletableSchema<z.ZodOptional<z.ZodString>>;
|
|
27
|
+
docType: z.ZodOptional<z.ZodEnum<{
|
|
28
|
+
[x: string]: string;
|
|
29
|
+
}>>;
|
|
28
30
|
limit: z.ZodDefault<z.ZodNumber>;
|
|
29
31
|
page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
30
32
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
responseFormat: ResponseFormat;
|
|
35
|
-
limit: number;
|
|
36
|
-
version?: string | undefined;
|
|
37
|
-
maxTokens?: number | undefined;
|
|
38
|
-
product?: string | undefined;
|
|
39
|
-
topic?: string | undefined;
|
|
40
|
-
page?: number | undefined;
|
|
41
|
-
}, {
|
|
42
|
-
query: string;
|
|
43
|
-
version?: string | undefined;
|
|
44
|
-
maxTokens?: number | undefined;
|
|
45
|
-
responseFormat?: ResponseFormat | undefined;
|
|
46
|
-
product?: string | undefined;
|
|
47
|
-
topic?: string | undefined;
|
|
48
|
-
limit?: number | undefined;
|
|
49
|
-
page?: number | undefined;
|
|
50
|
-
}>;
|
|
33
|
+
outputMode: z.ZodDefault<z.ZodEnum<typeof OutputMode>>;
|
|
34
|
+
responseFormat: z.ZodDefault<z.ZodEnum<typeof ResponseFormat>>;
|
|
35
|
+
}, z.core.$strict>;
|
|
51
36
|
export type SearchInput = z.infer<typeof SearchInputSchema>;
|
|
52
37
|
/**
|
|
53
38
|
* Schema for jamf_docs_get_article
|
|
54
39
|
*/
|
|
55
40
|
export declare const GetArticleInputSchema: z.ZodObject<{
|
|
56
|
-
url: z.
|
|
41
|
+
url: z.ZodString;
|
|
57
42
|
section: z.ZodOptional<z.ZodString>;
|
|
43
|
+
summaryOnly: z.ZodDefault<z.ZodBoolean>;
|
|
58
44
|
includeRelated: z.ZodDefault<z.ZodBoolean>;
|
|
59
45
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
responseFormat: ResponseFormat;
|
|
64
|
-
includeRelated: boolean;
|
|
65
|
-
maxTokens?: number | undefined;
|
|
66
|
-
section?: string | undefined;
|
|
67
|
-
}, {
|
|
68
|
-
url: string;
|
|
69
|
-
maxTokens?: number | undefined;
|
|
70
|
-
responseFormat?: ResponseFormat | undefined;
|
|
71
|
-
section?: string | undefined;
|
|
72
|
-
includeRelated?: boolean | undefined;
|
|
73
|
-
}>;
|
|
46
|
+
outputMode: z.ZodDefault<z.ZodEnum<typeof OutputMode>>;
|
|
47
|
+
responseFormat: z.ZodDefault<z.ZodEnum<typeof ResponseFormat>>;
|
|
48
|
+
}, z.core.$strict>;
|
|
74
49
|
export type GetArticleInput = z.infer<typeof GetArticleInputSchema>;
|
|
75
50
|
/**
|
|
76
51
|
* Schema for jamf_docs_get_toc
|
|
77
52
|
*/
|
|
78
53
|
export declare const GetTocInputSchema: z.ZodObject<{
|
|
79
|
-
product: z.ZodEnum<
|
|
80
|
-
|
|
54
|
+
product: import("@modelcontextprotocol/sdk/server/completable.js").CompletableSchema<z.ZodEnum<{
|
|
55
|
+
[x: string]: string;
|
|
56
|
+
}>>;
|
|
57
|
+
version: import("@modelcontextprotocol/sdk/server/completable.js").CompletableSchema<z.ZodOptional<z.ZodString>>;
|
|
81
58
|
page: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
82
59
|
maxTokens: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
product: string;
|
|
87
|
-
version?: string | undefined;
|
|
88
|
-
maxTokens?: number | undefined;
|
|
89
|
-
page?: number | undefined;
|
|
90
|
-
}, {
|
|
91
|
-
product: string;
|
|
92
|
-
version?: string | undefined;
|
|
93
|
-
maxTokens?: number | undefined;
|
|
94
|
-
responseFormat?: ResponseFormat | undefined;
|
|
95
|
-
page?: number | undefined;
|
|
96
|
-
}>;
|
|
60
|
+
outputMode: z.ZodDefault<z.ZodEnum<typeof OutputMode>>;
|
|
61
|
+
responseFormat: z.ZodDefault<z.ZodEnum<typeof ResponseFormat>>;
|
|
62
|
+
}, z.core.$strict>;
|
|
97
63
|
export type GetTocInput = z.infer<typeof GetTocInputSchema>;
|
|
98
64
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,cAAc,EACd,UAAU,EAOX,MAAM,iBAAiB,CAAC;AA0BzB;;GAEG;AACH,eAAO,MAAM,uBAAuB;;;;kBAYzB,CAAC;AAEZ,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;kBAqDnB,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;kBAgCvB,CAAC;AAEZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE;;GAEG;AACH,eAAO,MAAM,iBAAiB;;;;;;;;;kBA6BnB,CAAC;AAEZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC"}
|
package/dist/schemas/index.js
CHANGED
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
* Zod schemas for input validation
|
|
3
3
|
*/
|
|
4
4
|
import { z } from 'zod';
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const topicIds = Object.keys(JAMF_TOPICS);
|
|
5
|
+
import { completable } from '@modelcontextprotocol/sdk/server/completable.js';
|
|
6
|
+
import { ResponseFormat, OutputMode, CONTENT_LIMITS, TOKEN_CONFIG, PAGINATION_CONFIG, PRODUCT_IDS, TOPIC_IDS, DOC_TYPE_IDS } from '../constants.js';
|
|
7
|
+
import { completeProduct, completeTopic, completeVersion } from '../completions.js';
|
|
8
|
+
import { isAllowedHostname } from '../utils/url.js';
|
|
10
9
|
// Response format enum
|
|
11
10
|
const ResponseFormatSchema = z.nativeEnum(ResponseFormat);
|
|
11
|
+
// Output mode enum
|
|
12
|
+
const OutputModeSchema = z.nativeEnum(OutputMode);
|
|
12
13
|
// Common maxTokens parameter schema
|
|
13
14
|
const MaxTokensSchema = z.number()
|
|
14
15
|
.int()
|
|
@@ -30,6 +31,9 @@ export const ListProductsInputSchema = z.object({
|
|
|
30
31
|
maxTokens: MaxTokensSchema
|
|
31
32
|
.optional()
|
|
32
33
|
.describe(`Maximum tokens in response (${TOKEN_CONFIG.MIN_TOKENS}-${TOKEN_CONFIG.MAX_TOKENS_LIMIT}, default: ${TOKEN_CONFIG.DEFAULT_MAX_TOKENS})`),
|
|
34
|
+
outputMode: OutputModeSchema
|
|
35
|
+
.default(OutputMode.FULL)
|
|
36
|
+
.describe('Output detail level: "full" for detailed output or "compact" for brief output'),
|
|
33
37
|
responseFormat: ResponseFormatSchema
|
|
34
38
|
.default(ResponseFormat.MARKDOWN)
|
|
35
39
|
.describe('Output format: "markdown" for human-readable or "json" for machine-readable')
|
|
@@ -42,15 +46,18 @@ export const SearchInputSchema = z.object({
|
|
|
42
46
|
.min(2, 'Query must be at least 2 characters')
|
|
43
47
|
.max(200, 'Query must not exceed 200 characters')
|
|
44
48
|
.describe('Search keywords to find in Jamf documentation'),
|
|
45
|
-
product: z.enum(
|
|
49
|
+
product: completable(z.enum(PRODUCT_IDS)
|
|
46
50
|
.optional()
|
|
47
|
-
.describe('Filter by product: jamf-pro, jamf-school, jamf-connect, jamf-protect'),
|
|
48
|
-
topic: z.enum(
|
|
51
|
+
.describe('Filter by product: jamf-pro, jamf-school, jamf-connect, jamf-protect'), completeProduct),
|
|
52
|
+
topic: completable(z.enum(TOPIC_IDS)
|
|
49
53
|
.optional()
|
|
50
|
-
.describe('Filter by topic: enrollment, profiles, security, inventory, policies, smart-groups, apps, identity, api, network'),
|
|
51
|
-
version: z.string()
|
|
54
|
+
.describe('Filter by topic: enrollment, profiles, security, inventory, policies, smart-groups, apps, identity, api, network'), completeTopic),
|
|
55
|
+
version: completable(z.string()
|
|
52
56
|
.optional()
|
|
53
|
-
.describe('Filter by version (e.g., "11.5.0", "10.x")'),
|
|
57
|
+
.describe('Filter by version (e.g., "11.5.0", "10.x")'), completeVersion),
|
|
58
|
+
docType: z.enum(DOC_TYPE_IDS)
|
|
59
|
+
.optional()
|
|
60
|
+
.describe('Filter by document type: documentation, release-notes, install-guide, technical-paper, configuration-guide, training'),
|
|
54
61
|
limit: z.number()
|
|
55
62
|
.int()
|
|
56
63
|
.min(1)
|
|
@@ -63,6 +70,9 @@ export const SearchInputSchema = z.object({
|
|
|
63
70
|
maxTokens: MaxTokensSchema
|
|
64
71
|
.optional()
|
|
65
72
|
.describe(`Maximum tokens in response (${TOKEN_CONFIG.MIN_TOKENS}-${TOKEN_CONFIG.MAX_TOKENS_LIMIT}, default: ${TOKEN_CONFIG.DEFAULT_MAX_TOKENS})`),
|
|
73
|
+
outputMode: OutputModeSchema
|
|
74
|
+
.default(OutputMode.FULL)
|
|
75
|
+
.describe('Output detail level: "full" for detailed output or "compact" for brief output'),
|
|
66
76
|
responseFormat: ResponseFormatSchema
|
|
67
77
|
.default(ResponseFormat.MARKDOWN)
|
|
68
78
|
.describe('Output format: "markdown" for human-readable or "json" for machine-readable')
|
|
@@ -73,17 +83,23 @@ export const SearchInputSchema = z.object({
|
|
|
73
83
|
export const GetArticleInputSchema = z.object({
|
|
74
84
|
url: z.string()
|
|
75
85
|
.url('Must be a valid URL')
|
|
76
|
-
.refine((url) =>
|
|
86
|
+
.refine((url) => isAllowedHostname(url), 'URL must be from docs.jamf.com or learn.jamf.com')
|
|
77
87
|
.describe('Full URL of the Jamf documentation article'),
|
|
78
88
|
section: z.string()
|
|
79
89
|
.optional()
|
|
80
90
|
.describe('Extract only a specific section by title or ID (e.g., "Prerequisites", "Configuration")'),
|
|
91
|
+
summaryOnly: z.boolean()
|
|
92
|
+
.default(false)
|
|
93
|
+
.describe('Return only article summary and outline instead of full content (token-efficient)'),
|
|
81
94
|
includeRelated: z.boolean()
|
|
82
95
|
.default(false)
|
|
83
96
|
.describe('Include related article links in the response'),
|
|
84
97
|
maxTokens: MaxTokensSchema
|
|
85
98
|
.optional()
|
|
86
99
|
.describe(`Maximum tokens in response (${TOKEN_CONFIG.MIN_TOKENS}-${TOKEN_CONFIG.MAX_TOKENS_LIMIT}, default: ${TOKEN_CONFIG.DEFAULT_MAX_TOKENS})`),
|
|
100
|
+
outputMode: OutputModeSchema
|
|
101
|
+
.default(OutputMode.FULL)
|
|
102
|
+
.describe('Output detail level: "full" for detailed output or "compact" for brief output'),
|
|
87
103
|
responseFormat: ResponseFormatSchema
|
|
88
104
|
.default(ResponseFormat.MARKDOWN)
|
|
89
105
|
.describe('Output format: "markdown" for human-readable or "json" for machine-readable')
|
|
@@ -92,17 +108,20 @@ export const GetArticleInputSchema = z.object({
|
|
|
92
108
|
* Schema for jamf_docs_get_toc
|
|
93
109
|
*/
|
|
94
110
|
export const GetTocInputSchema = z.object({
|
|
95
|
-
product: z.enum(
|
|
96
|
-
.describe('Product ID: jamf-pro, jamf-school, jamf-connect, jamf-protect'),
|
|
97
|
-
version: z.string()
|
|
111
|
+
product: completable(z.enum(PRODUCT_IDS)
|
|
112
|
+
.describe('Product ID: jamf-pro, jamf-school, jamf-connect, jamf-protect'), completeProduct),
|
|
113
|
+
version: completable(z.string()
|
|
98
114
|
.optional()
|
|
99
|
-
.describe('Specific version (defaults to latest)'),
|
|
115
|
+
.describe('Specific version (defaults to latest)'), completeVersion),
|
|
100
116
|
page: PageSchema
|
|
101
117
|
.optional()
|
|
102
118
|
.describe(`Page number for pagination (1-${PAGINATION_CONFIG.MAX_PAGE}, default: 1)`),
|
|
103
119
|
maxTokens: MaxTokensSchema
|
|
104
120
|
.optional()
|
|
105
121
|
.describe(`Maximum tokens in response (${TOKEN_CONFIG.MIN_TOKENS}-${TOKEN_CONFIG.MAX_TOKENS_LIMIT}, default: ${TOKEN_CONFIG.DEFAULT_MAX_TOKENS})`),
|
|
122
|
+
outputMode: OutputModeSchema
|
|
123
|
+
.default(OutputMode.FULL)
|
|
124
|
+
.describe('Output detail level: "full" for detailed output or "compact" for brief output'),
|
|
106
125
|
responseFormat: ResponseFormatSchema
|
|
107
126
|
.default(ResponseFormat.MARKDOWN)
|
|
108
127
|
.describe('Output format: "markdown" for human-readable or "json" for machine-readable')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,cAAc,EACd,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/schemas/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OA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
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export declare const ProductListOutputSchema: z.ZodObject<{
|
|
6
|
+
products: z.ZodArray<z.ZodObject<{
|
|
7
|
+
id: z.ZodString;
|
|
8
|
+
name: z.ZodString;
|
|
9
|
+
description: z.ZodString;
|
|
10
|
+
currentVersion: z.ZodString;
|
|
11
|
+
availableVersions: z.ZodArray<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>>;
|
|
13
|
+
topics: z.ZodArray<z.ZodObject<{
|
|
14
|
+
id: z.ZodString;
|
|
15
|
+
name: z.ZodString;
|
|
16
|
+
keywords: z.ZodArray<z.ZodString>;
|
|
17
|
+
}, z.core.$strip>>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
export declare const SearchOutputSchema: z.ZodObject<{
|
|
20
|
+
query: z.ZodString;
|
|
21
|
+
totalResults: z.ZodNumber;
|
|
22
|
+
page: z.ZodNumber;
|
|
23
|
+
totalPages: z.ZodNumber;
|
|
24
|
+
hasMore: z.ZodBoolean;
|
|
25
|
+
results: z.ZodArray<z.ZodObject<{
|
|
26
|
+
title: z.ZodString;
|
|
27
|
+
url: z.ZodString;
|
|
28
|
+
snippet: z.ZodString;
|
|
29
|
+
product: z.ZodString;
|
|
30
|
+
version: z.ZodOptional<z.ZodString>;
|
|
31
|
+
docType: z.ZodOptional<z.ZodString>;
|
|
32
|
+
}, z.core.$strip>>;
|
|
33
|
+
suggestions: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
34
|
+
}, z.core.$strip>;
|
|
35
|
+
export declare const ArticleOutputSchema: z.ZodObject<{
|
|
36
|
+
title: z.ZodString;
|
|
37
|
+
url: z.ZodString;
|
|
38
|
+
content: z.ZodString;
|
|
39
|
+
product: z.ZodOptional<z.ZodString>;
|
|
40
|
+
version: z.ZodOptional<z.ZodString>;
|
|
41
|
+
lastUpdated: z.ZodOptional<z.ZodString>;
|
|
42
|
+
breadcrumb: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
43
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
44
|
+
id: z.ZodString;
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
level: z.ZodNumber;
|
|
47
|
+
tokenCount: z.ZodNumber;
|
|
48
|
+
}, z.core.$strip>>;
|
|
49
|
+
truncated: z.ZodBoolean;
|
|
50
|
+
}, z.core.$strip>;
|
|
51
|
+
export declare const TocOutputSchema: z.ZodObject<{
|
|
52
|
+
product: z.ZodString;
|
|
53
|
+
version: z.ZodString;
|
|
54
|
+
totalEntries: z.ZodNumber;
|
|
55
|
+
page: z.ZodNumber;
|
|
56
|
+
totalPages: z.ZodNumber;
|
|
57
|
+
hasMore: z.ZodBoolean;
|
|
58
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
59
|
+
title: z.ZodString;
|
|
60
|
+
url: z.ZodString;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
//# sourceMappingURL=output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.d.ts","sourceRoot":"","sources":["../../src/schemas/output.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;iBAalC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;iBAe7B,CAAC;AAEH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;iBAe9B,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;iBAW1B,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Zod output schemas for structured tool output (outputSchema + structuredContent)
|
|
3
|
+
*/
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
export const ProductListOutputSchema = z.object({
|
|
6
|
+
products: z.array(z.object({
|
|
7
|
+
id: z.string(),
|
|
8
|
+
name: z.string(),
|
|
9
|
+
description: z.string(),
|
|
10
|
+
currentVersion: z.string(),
|
|
11
|
+
availableVersions: z.array(z.string()),
|
|
12
|
+
})),
|
|
13
|
+
topics: z.array(z.object({
|
|
14
|
+
id: z.string(),
|
|
15
|
+
name: z.string(),
|
|
16
|
+
keywords: z.array(z.string()),
|
|
17
|
+
})),
|
|
18
|
+
});
|
|
19
|
+
export const SearchOutputSchema = z.object({
|
|
20
|
+
query: z.string(),
|
|
21
|
+
totalResults: z.number(),
|
|
22
|
+
page: z.number(),
|
|
23
|
+
totalPages: z.number(),
|
|
24
|
+
hasMore: z.boolean(),
|
|
25
|
+
results: z.array(z.object({
|
|
26
|
+
title: z.string(),
|
|
27
|
+
url: z.string(),
|
|
28
|
+
snippet: z.string(),
|
|
29
|
+
product: z.string(),
|
|
30
|
+
version: z.string().optional(),
|
|
31
|
+
docType: z.string().optional(),
|
|
32
|
+
})),
|
|
33
|
+
suggestions: z.array(z.string()).optional(),
|
|
34
|
+
});
|
|
35
|
+
export const ArticleOutputSchema = z.object({
|
|
36
|
+
title: z.string(),
|
|
37
|
+
url: z.string(),
|
|
38
|
+
content: z.string(),
|
|
39
|
+
product: z.string().optional(),
|
|
40
|
+
version: z.string().optional(),
|
|
41
|
+
lastUpdated: z.string().optional(),
|
|
42
|
+
breadcrumb: z.array(z.string()).optional(),
|
|
43
|
+
sections: z.array(z.object({
|
|
44
|
+
id: z.string(),
|
|
45
|
+
title: z.string(),
|
|
46
|
+
level: z.number(),
|
|
47
|
+
tokenCount: z.number(),
|
|
48
|
+
})),
|
|
49
|
+
truncated: z.boolean(),
|
|
50
|
+
});
|
|
51
|
+
export const TocOutputSchema = z.object({
|
|
52
|
+
product: z.string(),
|
|
53
|
+
version: z.string(),
|
|
54
|
+
totalEntries: z.number(),
|
|
55
|
+
page: z.number(),
|
|
56
|
+
totalPages: z.number(),
|
|
57
|
+
hasMore: z.boolean(),
|
|
58
|
+
entries: z.array(z.object({
|
|
59
|
+
title: z.string(),
|
|
60
|
+
url: z.string(),
|
|
61
|
+
})),
|
|
62
|
+
});
|
|
63
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/schemas/output.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;QACvB,cAAc,EAAE,CAAC,CAAC,MAAM,EAAE;QAC1B,iBAAiB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KACvC,CAAC,CAAC;IACH,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACvB,EAAE,EAAE,CAAC,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;QAChB,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;KAC9B,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACxB,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AC,CAAC,MAAM,CAAC;IACtC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE;IACpB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACxB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;QACjB,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE;KAChB,CAAC,CAAC;CACJ,CAAC,CAAC"}
|
package/dist/services/cache.d.ts
CHANGED
|
@@ -1,35 +1,60 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Caching service for Jamf documentation
|
|
3
3
|
*
|
|
4
|
-
* Provides file-based caching with TTL support
|
|
4
|
+
* Provides file-based caching with TTL support and LRU memory eviction
|
|
5
5
|
*/
|
|
6
|
+
import { z } from 'zod';
|
|
6
7
|
/**
|
|
7
|
-
*
|
|
8
|
+
* Zod schema for validating cache entries read from disk
|
|
9
|
+
*/
|
|
10
|
+
export declare const CacheEntrySchema: z.ZodObject<{
|
|
11
|
+
data: z.ZodUnknown;
|
|
12
|
+
timestamp: z.ZodNumber;
|
|
13
|
+
ttl: z.ZodNumber;
|
|
14
|
+
}, z.core.$strip>;
|
|
15
|
+
/**
|
|
16
|
+
* File-based cache implementation with LRU-bounded memory cache
|
|
8
17
|
*/
|
|
9
18
|
declare class FileCache {
|
|
10
|
-
private cacheDir;
|
|
11
|
-
private
|
|
12
|
-
|
|
19
|
+
private readonly cacheDir;
|
|
20
|
+
private readonly maxEntries;
|
|
21
|
+
private readonly memoryCache;
|
|
22
|
+
private readonly lruMap;
|
|
23
|
+
private readonly lruHead;
|
|
24
|
+
private readonly lruTail;
|
|
25
|
+
private dirCreated;
|
|
26
|
+
constructor(cacheDir?: string, maxEntries?: number);
|
|
27
|
+
private static getCacheKey;
|
|
28
|
+
private getCachePath;
|
|
29
|
+
private ensureCacheDir;
|
|
13
30
|
/**
|
|
14
|
-
*
|
|
31
|
+
* Move a node to the front of the LRU list (most recently used)
|
|
15
32
|
*/
|
|
16
|
-
private
|
|
33
|
+
private lruMoveToFront;
|
|
17
34
|
/**
|
|
18
|
-
*
|
|
35
|
+
* Add a key to the LRU list (at front)
|
|
19
36
|
*/
|
|
20
|
-
private
|
|
37
|
+
private lruAdd;
|
|
21
38
|
/**
|
|
22
|
-
*
|
|
39
|
+
* Remove a key from the LRU list
|
|
23
40
|
*/
|
|
24
|
-
private
|
|
41
|
+
private lruRemove;
|
|
42
|
+
/**
|
|
43
|
+
* Evict the least recently used entry from memory cache
|
|
44
|
+
*/
|
|
45
|
+
private lruEvictLeast;
|
|
25
46
|
/**
|
|
26
47
|
* Get a value from cache
|
|
27
48
|
*/
|
|
28
49
|
get<T>(key: string): Promise<T | null>;
|
|
50
|
+
/**
|
|
51
|
+
* Store in memory cache, evicting LRU entry if at capacity
|
|
52
|
+
*/
|
|
53
|
+
private memoryCacheSet;
|
|
29
54
|
/**
|
|
30
55
|
* Set a value in cache
|
|
31
56
|
*/
|
|
32
|
-
set
|
|
57
|
+
set(key: string, data: unknown, ttl?: number): Promise<void>;
|
|
33
58
|
/**
|
|
34
59
|
* Delete a cache entry
|
|
35
60
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/services/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"cache.d.ts","sourceRoot":"","sources":["../../src/services/cache.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;iBAI3B,CAAC;AAWH;;GAEG;AACH,c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