@augno/sdk-mcp 0.10.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/LICENSE +201 -0
- package/README.md +103 -0
- package/auth.d.mts +6 -0
- package/auth.d.mts.map +1 -0
- package/auth.d.ts +6 -0
- package/auth.d.ts.map +1 -0
- package/auth.js +37 -0
- package/auth.js.map +1 -0
- package/auth.mjs +32 -0
- package/auth.mjs.map +1 -0
- package/code-tool-paths.cjs +8 -0
- package/code-tool-paths.cjs.map +1 -0
- package/code-tool-paths.d.cts +2 -0
- package/code-tool-paths.d.cts.map +1 -0
- package/code-tool-types.d.mts +14 -0
- package/code-tool-types.d.mts.map +1 -0
- package/code-tool-types.d.ts +14 -0
- package/code-tool-types.d.ts.map +1 -0
- package/code-tool-types.js +4 -0
- package/code-tool-types.js.map +1 -0
- package/code-tool-types.mjs +3 -0
- package/code-tool-types.mjs.map +1 -0
- package/code-tool-worker.d.mts +5 -0
- package/code-tool-worker.d.mts.map +1 -0
- package/code-tool-worker.d.ts +5 -0
- package/code-tool-worker.d.ts.map +1 -0
- package/code-tool-worker.js +486 -0
- package/code-tool-worker.js.map +1 -0
- package/code-tool-worker.mjs +448 -0
- package/code-tool-worker.mjs.map +1 -0
- package/code-tool.d.mts +21 -0
- package/code-tool.d.mts.map +1 -0
- package/code-tool.d.ts +21 -0
- package/code-tool.d.ts.map +1 -0
- package/code-tool.js +287 -0
- package/code-tool.js.map +1 -0
- package/code-tool.mjs +251 -0
- package/code-tool.mjs.map +1 -0
- package/http.d.mts +12 -0
- package/http.d.mts.map +1 -0
- package/http.d.ts +12 -0
- package/http.d.ts.map +1 -0
- package/http.js +190 -0
- package/http.js.map +1 -0
- package/http.mjs +182 -0
- package/http.mjs.map +1 -0
- package/index.d.mts +3 -0
- package/index.d.mts.map +1 -0
- package/index.d.ts +3 -0
- package/index.d.ts.map +1 -0
- package/index.js +60 -0
- package/index.js.map +1 -0
- package/index.mjs +58 -0
- package/index.mjs.map +1 -0
- package/instructions.d.mts +5 -0
- package/instructions.d.mts.map +1 -0
- package/instructions.d.ts +5 -0
- package/instructions.d.ts.map +1 -0
- package/instructions.js +47 -0
- package/instructions.js.map +1 -0
- package/instructions.mjs +41 -0
- package/instructions.mjs.map +1 -0
- package/logger.d.mts +7 -0
- package/logger.d.mts.map +1 -0
- package/logger.d.ts +7 -0
- package/logger.d.ts.map +1 -0
- package/logger.js +29 -0
- package/logger.js.map +1 -0
- package/logger.mjs +22 -0
- package/logger.mjs.map +1 -0
- package/methods.d.mts +10 -0
- package/methods.d.mts.map +1 -0
- package/methods.d.ts +10 -0
- package/methods.d.ts.map +1 -0
- package/methods.js +1385 -0
- package/methods.js.map +1 -0
- package/methods.mjs +1381 -0
- package/methods.mjs.map +1 -0
- package/options.d.mts +20 -0
- package/options.d.mts.map +1 -0
- package/options.d.ts +20 -0
- package/options.d.ts.map +1 -0
- package/options.js +121 -0
- package/options.js.map +1 -0
- package/options.mjs +114 -0
- package/options.mjs.map +1 -0
- package/package.json +216 -0
- package/server.d.mts +38 -0
- package/server.d.mts.map +1 -0
- package/server.d.ts +38 -0
- package/server.d.ts.map +1 -0
- package/server.js +162 -0
- package/server.js.map +1 -0
- package/server.mjs +152 -0
- package/server.mjs.map +1 -0
- package/src/auth.ts +42 -0
- package/src/code-tool-paths.cts +5 -0
- package/src/code-tool-types.ts +17 -0
- package/src/code-tool-worker.ts +499 -0
- package/src/code-tool.ts +316 -0
- package/src/http.ts +227 -0
- package/src/index.ts +67 -0
- package/src/instructions.ts +59 -0
- package/src/logger.ts +28 -0
- package/src/methods.ts +1406 -0
- package/src/options.ts +159 -0
- package/src/server.ts +202 -0
- package/src/stdio.ts +17 -0
- package/src/tsconfig.json +11 -0
- package/src/types.ts +126 -0
- package/src/util.ts +25 -0
- package/stdio.d.mts +3 -0
- package/stdio.d.mts.map +1 -0
- package/stdio.d.ts +3 -0
- package/stdio.d.ts.map +1 -0
- package/stdio.js +18 -0
- package/stdio.js.map +1 -0
- package/stdio.mjs +14 -0
- package/stdio.mjs.map +1 -0
- package/types.d.mts +65 -0
- package/types.d.mts.map +1 -0
- package/types.d.ts +65 -0
- package/types.d.ts.map +1 -0
- package/types.js +58 -0
- package/types.js.map +1 -0
- package/types.mjs +53 -0
- package/types.mjs.map +1 -0
- package/util.d.mts +4 -0
- package/util.d.mts.map +1 -0
- package/util.d.ts +4 -0
- package/util.d.ts.map +1 -0
- package/util.js +30 -0
- package/util.js.map +1 -0
- package/util.mjs +24 -0
- package/util.mjs.map +1 -0
package/instructions.mjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import fs from 'fs/promises';
|
|
3
|
+
import { getLogger } from "./logger.mjs";
|
|
4
|
+
const INSTRUCTIONS_CACHE_TTL_MS = 15 * 60 * 1000; // 15 minutes
|
|
5
|
+
const instructionsCache = new Map();
|
|
6
|
+
export async function getInstructions({ stainlessApiKey, customInstructionsPath, }) {
|
|
7
|
+
const now = Date.now();
|
|
8
|
+
const cacheKey = customInstructionsPath ?? stainlessApiKey ?? '';
|
|
9
|
+
const cached = instructionsCache.get(cacheKey);
|
|
10
|
+
if (cached && now - cached.fetchedAt <= INSTRUCTIONS_CACHE_TTL_MS) {
|
|
11
|
+
return cached.fetchedInstructions;
|
|
12
|
+
}
|
|
13
|
+
// Evict stale entries so the cache doesn't grow unboundedly.
|
|
14
|
+
for (const [key, entry] of instructionsCache) {
|
|
15
|
+
if (now - entry.fetchedAt > INSTRUCTIONS_CACHE_TTL_MS) {
|
|
16
|
+
instructionsCache.delete(key);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
let fetchedInstructions;
|
|
20
|
+
if (customInstructionsPath) {
|
|
21
|
+
fetchedInstructions = await fetchLatestInstructionsFromFile(customInstructionsPath);
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
fetchedInstructions =
|
|
25
|
+
'\n This is the augno MCP server.\n\n Available tools:\n - search_docs: Search SDK documentation to find the right methods and parameters.\n - execute: Run TypeScript code against a pre-authenticated SDK client. Define an async run(client) function.\n\n Workflow:\n - If unsure about the API, call search_docs first.\n - Write complete solutions in a single execute call when possible. For large datasets, use API filters to narrow results or paginate within a single execute block.\n - If execute returns an error, read the error and fix your code rather than retrying the same approach.\n - Variables do not persist between execute calls. Return or log all data you need.\n - Individual HTTP requests to the API have a 30-second timeout. If a request times out, try a smaller query or add filters.\n - Code execution has a total timeout of approximately 5 minutes. If your code times out, simplify it or break it into smaller steps.\n ';
|
|
26
|
+
fetchedInstructions +=
|
|
27
|
+
'\nThis MCP server wraps the Augno API (production management for SMB\nmanufacturers). Use the code tool to call the API by writing TypeScript\nagainst the Augno SDK. Authenticate with an Augno API key as a Bearer\ntoken; set the active account with the Augno-Account header when\noperating across multiple accounts.\n';
|
|
28
|
+
}
|
|
29
|
+
instructionsCache.set(cacheKey, { fetchedInstructions, fetchedAt: now });
|
|
30
|
+
return fetchedInstructions;
|
|
31
|
+
}
|
|
32
|
+
async function fetchLatestInstructionsFromFile(path) {
|
|
33
|
+
try {
|
|
34
|
+
return await fs.readFile(path, 'utf-8');
|
|
35
|
+
}
|
|
36
|
+
catch (error) {
|
|
37
|
+
getLogger().error({ error, path }, 'Error fetching instructions from file');
|
|
38
|
+
throw error;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=instructions.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instructions.mjs","sourceRoot":"","sources":["src/instructions.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,MAAM,aAAa;OACrB,EAAE,SAAS,EAAE;AAEpB,MAAM,yBAAyB,GAAG,EAAE,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,aAAa;AAO/D,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAkC,CAAC;AAEpE,MAAM,CAAC,KAAK,UAAU,eAAe,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AM,KAAK,CAAC;IACd,CAAC;AACH,CAAC"}
|
package/logger.d.mts
ADDED
package/logger.d.mts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.mts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"OAEO,EAAQ,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM;AAKpD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAarG;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/logger.d.ts
ADDED
package/logger.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"OAEO,EAAQ,KAAK,KAAK,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM;AAKpD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,CAarG;AAED,wBAAgB,SAAS,IAAI,MAAM,CAKlC"}
|
package/logger.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.configureLogger = configureLogger;
|
|
8
|
+
exports.getLogger = getLogger;
|
|
9
|
+
const pino_1 = require("pino");
|
|
10
|
+
const pino_pretty_1 = __importDefault(require("pino-pretty"));
|
|
11
|
+
let _logger;
|
|
12
|
+
function configureLogger({ level, pretty: usePretty }) {
|
|
13
|
+
_logger = (0, pino_1.pino)({
|
|
14
|
+
level,
|
|
15
|
+
timestamp: pino_1.pino.stdTimeFunctions.isoTime,
|
|
16
|
+
formatters: {
|
|
17
|
+
level(label) {
|
|
18
|
+
return { level: label };
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
}, usePretty ? (0, pino_pretty_1.default)({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr);
|
|
22
|
+
}
|
|
23
|
+
function getLogger() {
|
|
24
|
+
if (!_logger) {
|
|
25
|
+
throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
|
|
26
|
+
}
|
|
27
|
+
return _logger;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=logger.js.map
|
package/logger.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;;;AAOtF,0CAaC;AAED,8BAKC;AAzBD,+BAAqD;AACrD,8DAAiC;AAEjC,IAAI,OAA2B,CAAC;AAEhC,SAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAqC;IAC7F,OAAO,GAAG,IAAA,WAAI,EACZ;QACE,KAAK;QACL,SAAS,EAAE,WAAI,CAAC,gBAAgB,CAAC,OAAO;QACxC,UAAU,EAAE;YACV,KAAK,CAAC,KAAK;gBACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1B,CAAC;SACF;KACF,EACD,SAAS,CAAC,CAAC,CAAC,IAAA,qBAAM,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAC1F,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS;IACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/logger.mjs
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { pino } from 'pino';
|
|
3
|
+
import pretty from 'pino-pretty';
|
|
4
|
+
let _logger;
|
|
5
|
+
export function configureLogger({ level, pretty: usePretty }) {
|
|
6
|
+
_logger = pino({
|
|
7
|
+
level,
|
|
8
|
+
timestamp: pino.stdTimeFunctions.isoTime,
|
|
9
|
+
formatters: {
|
|
10
|
+
level(label) {
|
|
11
|
+
return { level: label };
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
}, usePretty ? pretty({ colorize: true, levelFirst: true, destination: 2 }) : process.stderr);
|
|
15
|
+
}
|
|
16
|
+
export function getLogger() {
|
|
17
|
+
if (!_logger) {
|
|
18
|
+
throw new Error('Logger has not been configured. Call configureLogger() before using the logger.');
|
|
19
|
+
}
|
|
20
|
+
return _logger;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=logger.mjs.map
|
package/logger.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.mjs","sourceRoot":"","sources":["src/logger.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,IAAI,EAA2B,MAAM,MAAM;OAC7C,MAAM,MAAM,aAAa;AAEhC,IAAI,OAA2B,CAAC;AAEhC,MAAM,UAAU,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAqC;IAC7F,OAAO,GAAG,IAAI,CACZ;QACE,KAAK;QACL,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACxC,UAAU,EAAE;YACV,KAAK,CAAC,KAAK;gBACT,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;YAC1B,CAAC;SACF;KACF,EACD,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAC1F,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,iFAAiF,CAAC,CAAC;IACrG,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
package/methods.d.mts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.mjs";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.mts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EAyyCjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|
package/methods.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { McpOptions } from "./options.js";
|
|
2
|
+
export type SdkMethod = {
|
|
3
|
+
clientCallName: string;
|
|
4
|
+
fullyQualifiedName: string;
|
|
5
|
+
httpMethod?: 'get' | 'post' | 'put' | 'patch' | 'delete' | 'query';
|
|
6
|
+
httpPath?: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const sdkMethods: SdkMethod[];
|
|
9
|
+
export declare function blockedMethodsForCodeTool(options: McpOptions | undefined): SdkMethod[] | undefined;
|
|
10
|
+
//# sourceMappingURL=methods.d.ts.map
|
package/methods.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"methods.d.ts","sourceRoot":"","sources":["src/methods.ts"],"names":[],"mappings":"OAEO,EAAE,UAAU,EAAE;AAErB,MAAM,MAAM,SAAS,GAAG;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,SAAS,EAyyCjC,CAAC;AA+DF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,UAAU,GAAG,SAAS,GAAG,SAAS,EAAE,GAAG,SAAS,CAUlG"}
|