@kya-os/create-mcpi-app 1.8.49 ā 1.8.52
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/.turbo/turbo-build.log +1 -1
- package/dist/helpers/fetch-cloudflare-mcpi-template.js +2 -2
- package/dist/helpers/generate-cloudflare-files.d.ts.map +1 -1
- package/dist/helpers/generate-cloudflare-files.js +828 -83
- package/dist/helpers/generate-cloudflare-files.js.map +1 -1
- package/package.json +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -103,7 +103,7 @@ export async function fetchCloudflareMcpiTemplate(targetDir, options) {
|
|
|
103
103
|
"cf-typegen": "wrangler types",
|
|
104
104
|
},
|
|
105
105
|
dependencies: {
|
|
106
|
-
"@kya-os/mcp-i-cloudflare": "1.6.
|
|
106
|
+
"@kya-os/mcp-i-cloudflare": "1.6.49",
|
|
107
107
|
"@modelcontextprotocol/sdk": "1.24.0",
|
|
108
108
|
agents: "0.2.30",
|
|
109
109
|
hono: "4.10.3",
|
|
@@ -482,7 +482,7 @@ dist
|
|
|
482
482
|
await runCommand(packageManager, ["install"], targetDir);
|
|
483
483
|
// 13a. Verify installed version matches expected version
|
|
484
484
|
console.log(chalk.blue("\nš Verifying package versions..."));
|
|
485
|
-
const expectedVersion = "1.6.
|
|
485
|
+
const expectedVersion = "1.6.49";
|
|
486
486
|
try {
|
|
487
487
|
const installedPackagePath = path.join(targetDir, "node_modules", "@kya-os", "mcp-i-cloudflare", "package.json");
|
|
488
488
|
if (fs.existsSync(installedPackagePath)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-cloudflare-files.d.ts","sourceRoot":"","sources":["../../src/helpers/generate-cloudflare-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAQH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,OAAO,EAAE,MAAM,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AAW,oBAAoB;IACnC,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,uBAAuB;IACvB,QAAQ,CAAC,EAAE,OAAO,GAAG,WAAW,GAAG,gBAAgB,CAAC;IACpD,+DAA+D;IAC/D,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,+DAA+D;IAC/D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,6CAA6C;IAC7C,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC,0BAA0B;IAC1B,KAAK,EAAE,aAAa,EAAE,CAAC;IACvB,qCAAqC;IACrC,QAAQ,EAAE;QACR,GAAG,EAAE,MAAM,CAAC;QACZ,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACjC;AAaD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,8BAA8B,CAClD,OAAO,EAAE,oBAAoB,GAC5B,OAAO,CAAC,mBAAmB,CAAC,CAmN9B"}
|
|
@@ -89,7 +89,7 @@ export async function generateCloudflareProjectFiles(options) {
|
|
|
89
89
|
"cf-typegen": "wrangler types",
|
|
90
90
|
},
|
|
91
91
|
dependencies: {
|
|
92
|
-
"@kya-os/mcp-i-cloudflare": "^1.6.
|
|
92
|
+
"@kya-os/mcp-i-cloudflare": "^1.6.49",
|
|
93
93
|
"@modelcontextprotocol/sdk": "1.24.0",
|
|
94
94
|
agents: "0.2.30",
|
|
95
95
|
hono: "4.10.3",
|
|
@@ -116,6 +116,7 @@ export async function generateCloudflareProjectFiles(options) {
|
|
|
116
116
|
publicKey: identity.publicKey,
|
|
117
117
|
agentShieldProjectId,
|
|
118
118
|
agentShieldApiUrl,
|
|
119
|
+
template,
|
|
119
120
|
}),
|
|
120
121
|
encoding: "utf-8",
|
|
121
122
|
});
|
|
@@ -247,7 +248,15 @@ function toPascalCase(str) {
|
|
|
247
248
|
return className;
|
|
248
249
|
}
|
|
249
250
|
function generateWranglerToml(opts) {
|
|
250
|
-
const { projectName, projectNameUpper, pascalCaseName, agentDid, publicKey, agentShieldProjectId, agentShieldApiUrl, } = opts;
|
|
251
|
+
const { projectName, projectNameUpper, pascalCaseName, agentDid, publicKey, agentShieldProjectId, agentShieldApiUrl, template, } = opts;
|
|
252
|
+
// Template-specific environment variables
|
|
253
|
+
let templateVars = "";
|
|
254
|
+
if (template === "hardware-world") {
|
|
255
|
+
templateVars = `
|
|
256
|
+
# Hardware World API Configuration
|
|
257
|
+
HARDWARE_WORLD_API_BASE_URL = "https://hardwareworld.com"
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
251
260
|
return `#:schema node_modules/wrangler/config-schema.json
|
|
252
261
|
name = "${projectName}"
|
|
253
262
|
main = "src/index.ts"
|
|
@@ -305,7 +314,7 @@ AGENTSHIELD_API_URL = "${agentShieldApiUrl}"
|
|
|
305
314
|
${agentShieldProjectId ? `AGENTSHIELD_PROJECT_ID = "${agentShieldProjectId}"` : '# AGENTSHIELD_PROJECT_ID = "your-project-id"'}
|
|
306
315
|
|
|
307
316
|
MCPI_ENV = "development"
|
|
308
|
-
|
|
317
|
+
${templateVars}
|
|
309
318
|
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
310
319
|
# SECRETS (managed via GitHub Secrets + wrangler secret)
|
|
311
320
|
# āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
|
|
@@ -368,6 +377,10 @@ export class ${pascalCaseName}MCP extends MCPICloudflareAgent {
|
|
|
368
377
|
`;
|
|
369
378
|
}
|
|
370
379
|
function generateRuntimeConfigTs(template) {
|
|
380
|
+
// Hardware World has different imports and tool protection
|
|
381
|
+
if (template === "hardware-world") {
|
|
382
|
+
return generateHardwareWorldRuntimeConfig();
|
|
383
|
+
}
|
|
371
384
|
const imports = [`import { greetTool } from "./tools/greet";`];
|
|
372
385
|
const tools = ["greetTool"];
|
|
373
386
|
if (template === "ecommerce") {
|
|
@@ -376,13 +389,6 @@ function generateRuntimeConfigTs(template) {
|
|
|
376
389
|
imports.push(`import { checkoutTool } from "./tools/checkout";`);
|
|
377
390
|
tools.push("addToCartTool", "getCartTool", "checkoutTool");
|
|
378
391
|
}
|
|
379
|
-
else if (template === "hardware-world") {
|
|
380
|
-
imports.push(`import { addToCartTool } from "./tools/add-to-cart";`);
|
|
381
|
-
imports.push(`import { getCartTool } from "./tools/get-cart";`);
|
|
382
|
-
imports.push(`import { removeFromCartTool } from "./tools/remove-from-cart";`);
|
|
383
|
-
imports.push(`import { searchProductsTool } from "./tools/search-products";`);
|
|
384
|
-
tools.push("addToCartTool", "getCartTool", "removeFromCartTool", "searchProductsTool");
|
|
385
|
-
}
|
|
386
392
|
return `import { defineConfig, type CloudflareRuntimeConfig } from "@kya-os/mcp-i-cloudflare";
|
|
387
393
|
import type { CloudflareEnv } from "@kya-os/mcp-i-cloudflare";
|
|
388
394
|
${imports.join("\n")}
|
|
@@ -424,6 +430,143 @@ export function getTools() {
|
|
|
424
430
|
}
|
|
425
431
|
`;
|
|
426
432
|
}
|
|
433
|
+
function generateHardwareWorldRuntimeConfig() {
|
|
434
|
+
return `/**
|
|
435
|
+
* MCP-I Runtime Configuration
|
|
436
|
+
*
|
|
437
|
+
* Defines tool protection, proofing, and other runtime settings.
|
|
438
|
+
* Uses inline config with correct scopes (no hyphens) to avoid
|
|
439
|
+
* AgentShield's auto-generated scope validation issues.
|
|
440
|
+
*/
|
|
441
|
+
|
|
442
|
+
import {
|
|
443
|
+
defineConfig,
|
|
444
|
+
type CloudflareRuntimeConfig,
|
|
445
|
+
type CloudflareEnv,
|
|
446
|
+
} from "@kya-os/mcp-i-cloudflare";
|
|
447
|
+
|
|
448
|
+
// Import tools
|
|
449
|
+
import { greetTool } from "./tools/greet";
|
|
450
|
+
import { getProductsTool } from "./tools/get-products";
|
|
451
|
+
import { getBrandsTool } from "./tools/get-brands";
|
|
452
|
+
import { getBrandTool } from "./tools/get-brand";
|
|
453
|
+
import { addToCartTool } from "./tools/add-to-cart";
|
|
454
|
+
import { getCartTool } from "./tools/get-cart";
|
|
455
|
+
import { getCustomerTool } from "./tools/get-customer";
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Tool Protection Configuration
|
|
459
|
+
*
|
|
460
|
+
* Using inline config because:
|
|
461
|
+
* 1. AgentShield auto-generates scopes like "ADD-TO-CART:EXECUTE" which fail validation
|
|
462
|
+
* 2. The scope regex /^[a-zA-Z0-9_]+:[a-zA-Z0-9_]+$/ doesn't allow hyphens
|
|
463
|
+
* 3. Inline config uses correct scopes like "cart:write"
|
|
464
|
+
*/
|
|
465
|
+
const toolProtections = {
|
|
466
|
+
// Public tools - no delegation required
|
|
467
|
+
greet: {
|
|
468
|
+
requiresDelegation: false,
|
|
469
|
+
requiredScopes: [] as string[],
|
|
470
|
+
riskLevel: "low" as const,
|
|
471
|
+
},
|
|
472
|
+
"get-products": {
|
|
473
|
+
requiresDelegation: false,
|
|
474
|
+
requiredScopes: [] as string[],
|
|
475
|
+
riskLevel: "low" as const,
|
|
476
|
+
},
|
|
477
|
+
"get-brands": {
|
|
478
|
+
requiresDelegation: false,
|
|
479
|
+
requiredScopes: [] as string[],
|
|
480
|
+
riskLevel: "low" as const,
|
|
481
|
+
},
|
|
482
|
+
"get-brand": {
|
|
483
|
+
requiresDelegation: false,
|
|
484
|
+
requiredScopes: [] as string[],
|
|
485
|
+
riskLevel: "low" as const,
|
|
486
|
+
},
|
|
487
|
+
|
|
488
|
+
// Protected tools - require user delegation
|
|
489
|
+
"get-customer": {
|
|
490
|
+
requiresDelegation: true,
|
|
491
|
+
requiredScopes: ["customer:read"],
|
|
492
|
+
riskLevel: "low" as const,
|
|
493
|
+
},
|
|
494
|
+
"get-cart": {
|
|
495
|
+
requiresDelegation: true,
|
|
496
|
+
requiredScopes: ["cart:read"],
|
|
497
|
+
riskLevel: "low" as const,
|
|
498
|
+
},
|
|
499
|
+
"add-to-cart": {
|
|
500
|
+
requiresDelegation: true,
|
|
501
|
+
requiredScopes: ["cart:write"],
|
|
502
|
+
riskLevel: "medium" as const,
|
|
503
|
+
},
|
|
504
|
+
};
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* Get runtime configuration for MCP-I
|
|
508
|
+
*/
|
|
509
|
+
export function getRuntimeConfig(env: CloudflareEnv): CloudflareRuntimeConfig {
|
|
510
|
+
const environment = (env.MCPI_ENV || "development") as
|
|
511
|
+
| "development"
|
|
512
|
+
| "production";
|
|
513
|
+
|
|
514
|
+
// Proofing config - sends execution proofs to AgentShield
|
|
515
|
+
const proofingConfig = env.AGENTSHIELD_API_KEY
|
|
516
|
+
? {
|
|
517
|
+
enabled: true,
|
|
518
|
+
batchQueue: {
|
|
519
|
+
destinations: [
|
|
520
|
+
{
|
|
521
|
+
type: "agentshield" as const,
|
|
522
|
+
apiKey: env.AGENTSHIELD_API_KEY,
|
|
523
|
+
apiUrl: env.AGENTSHIELD_API_URL || "https://kya.vouched.id",
|
|
524
|
+
},
|
|
525
|
+
],
|
|
526
|
+
},
|
|
527
|
+
}
|
|
528
|
+
: undefined;
|
|
529
|
+
|
|
530
|
+
// Tool protection - using inline config with correct scopes
|
|
531
|
+
const toolProtectionConfig = {
|
|
532
|
+
source: "inline" as const,
|
|
533
|
+
toolProtections,
|
|
534
|
+
};
|
|
535
|
+
|
|
536
|
+
return defineConfig({
|
|
537
|
+
environment,
|
|
538
|
+
proofing: proofingConfig,
|
|
539
|
+
toolProtection: toolProtectionConfig,
|
|
540
|
+
vars: {
|
|
541
|
+
ENVIRONMENT: environment,
|
|
542
|
+
AGENTSHIELD_API_KEY: env.AGENTSHIELD_API_KEY,
|
|
543
|
+
AGENTSHIELD_API_URL: env.AGENTSHIELD_API_URL,
|
|
544
|
+
AGENTSHIELD_PROJECT_ID: env.AGENTSHIELD_PROJECT_ID,
|
|
545
|
+
},
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
/**
|
|
550
|
+
* Get all tools for this agent
|
|
551
|
+
*
|
|
552
|
+
* Note: No login tool - users authenticate via the MCP-I consent flow,
|
|
553
|
+
* not by passing credentials through the agent.
|
|
554
|
+
*/
|
|
555
|
+
export function getTools() {
|
|
556
|
+
return [
|
|
557
|
+
// Public tools
|
|
558
|
+
greetTool,
|
|
559
|
+
getProductsTool,
|
|
560
|
+
getBrandsTool,
|
|
561
|
+
getBrandTool,
|
|
562
|
+
// Protected tools (require delegation)
|
|
563
|
+
getCustomerTool,
|
|
564
|
+
getCartTool,
|
|
565
|
+
addToCartTool,
|
|
566
|
+
];
|
|
567
|
+
}
|
|
568
|
+
`;
|
|
569
|
+
}
|
|
427
570
|
function generateGreetToolTs(projectName) {
|
|
428
571
|
return `import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
429
572
|
|
|
@@ -542,130 +685,732 @@ export const checkoutTool: ToolDefinition = {
|
|
|
542
685
|
}
|
|
543
686
|
function generateHardwareWorldTools() {
|
|
544
687
|
return [
|
|
688
|
+
// API Client - handles authentication and API calls
|
|
545
689
|
{
|
|
546
|
-
path: "src/
|
|
547
|
-
content:
|
|
690
|
+
path: "src/lib/api-client.ts",
|
|
691
|
+
content: `/**
|
|
692
|
+
* Hardware World API Client
|
|
693
|
+
*
|
|
694
|
+
* Utility functions for calling the Hardware World API.
|
|
695
|
+
* Handles authentication via ToolContext (idpHeaders from delegation flow).
|
|
696
|
+
*/
|
|
548
697
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
698
|
+
import type { ToolExecutionContext } from "@kya-os/mcp-i-cloudflare";
|
|
699
|
+
|
|
700
|
+
// Re-export for convenience
|
|
701
|
+
export type ToolContext = ToolExecutionContext;
|
|
702
|
+
|
|
703
|
+
export interface ApiResponse<T = unknown> {
|
|
704
|
+
status: number;
|
|
705
|
+
data: T;
|
|
706
|
+
ok: boolean;
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
export interface ApiOptions {
|
|
710
|
+
method?: "GET" | "POST" | "PUT" | "DELETE";
|
|
711
|
+
body?: Record<string, unknown> | null;
|
|
712
|
+
baseUrl?: string;
|
|
713
|
+
headers?: Record<string, string>;
|
|
714
|
+
}
|
|
715
|
+
|
|
716
|
+
// Default base URL - can be overridden via HARDWARE_WORLD_API_BASE_URL env var
|
|
717
|
+
const DEFAULT_BASE_URL = "https://hardwareworld.com";
|
|
718
|
+
|
|
719
|
+
// Get base URL from environment or use default
|
|
720
|
+
function getBaseUrl(): string {
|
|
721
|
+
// Check for environment variable (available in Cloudflare Workers)
|
|
722
|
+
if (typeof globalThis !== "undefined" && (globalThis as any).HARDWARE_WORLD_API_BASE_URL) {
|
|
723
|
+
return (globalThis as any).HARDWARE_WORLD_API_BASE_URL;
|
|
724
|
+
}
|
|
725
|
+
return DEFAULT_BASE_URL;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
/**
|
|
729
|
+
* Call the Hardware World API
|
|
730
|
+
*
|
|
731
|
+
* @param endpoint - API endpoint (e.g., "/products", "/cart/123")
|
|
732
|
+
* @param options - Request options
|
|
733
|
+
* @param context - Tool execution context with auth headers
|
|
734
|
+
*/
|
|
735
|
+
export async function callHardwareWorldAPI<T = unknown>(
|
|
736
|
+
endpoint: string,
|
|
737
|
+
options: ApiOptions = {},
|
|
738
|
+
context?: ToolContext
|
|
739
|
+
): Promise<ApiResponse<T>> {
|
|
740
|
+
const baseUrl = options.baseUrl || getBaseUrl();
|
|
741
|
+
const url = \`\${baseUrl}/api\${endpoint}\`;
|
|
742
|
+
|
|
743
|
+
const headers: Record<string, string> = {
|
|
744
|
+
"Content-Type": "application/json",
|
|
745
|
+
...options.headers,
|
|
746
|
+
};
|
|
747
|
+
|
|
748
|
+
// Hardware World API uses ONLY Cookie authentication (not Authorization header)
|
|
749
|
+
// The idpToken from credential provider contains the customerCookie value
|
|
750
|
+
if (context?.idpToken) {
|
|
751
|
+
// Hardware World API expects BOTH CIX and customerCookie for compatibility
|
|
752
|
+
headers["Cookie"] =
|
|
753
|
+
\`CIX=\${context.idpToken}; customerCookie=\${context.idpToken}\`;
|
|
754
|
+
console.log("[API Client] Cookie auth set from idpToken");
|
|
755
|
+
} else if (context?.idpHeaders?.["Cookie"]) {
|
|
756
|
+
// Fallback: use Cookie from idpHeaders if present
|
|
757
|
+
headers["Cookie"] = context.idpHeaders["Cookie"];
|
|
758
|
+
console.log("[API Client] Cookie auth set from idpHeaders");
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
console.log("[API Client] Request:", {
|
|
762
|
+
url,
|
|
763
|
+
method: options.method || "GET",
|
|
764
|
+
hasAuth: !!headers["Cookie"],
|
|
765
|
+
});
|
|
766
|
+
|
|
767
|
+
const response = await fetch(url, {
|
|
768
|
+
method: options.method || "GET",
|
|
769
|
+
headers,
|
|
770
|
+
body: options.body ? JSON.stringify(options.body) : null,
|
|
771
|
+
});
|
|
772
|
+
|
|
773
|
+
const responseData = await response.text();
|
|
774
|
+
let parsedData: T;
|
|
775
|
+
|
|
776
|
+
try {
|
|
777
|
+
parsedData = JSON.parse(responseData) as T;
|
|
778
|
+
} catch {
|
|
779
|
+
parsedData = responseData as T;
|
|
780
|
+
}
|
|
781
|
+
|
|
782
|
+
console.log("[API Client] Response:", {
|
|
783
|
+
status: response.status,
|
|
784
|
+
ok: response.ok,
|
|
785
|
+
});
|
|
786
|
+
|
|
787
|
+
return {
|
|
788
|
+
status: response.status,
|
|
789
|
+
data: parsedData,
|
|
790
|
+
ok: response.ok,
|
|
791
|
+
};
|
|
792
|
+
}
|
|
793
|
+
|
|
794
|
+
/**
|
|
795
|
+
* Format error response for MCP tools
|
|
796
|
+
*/
|
|
797
|
+
export function formatError(error: unknown): {
|
|
798
|
+
content: Array<{ type: "text"; text: string }>;
|
|
799
|
+
isError: true;
|
|
800
|
+
} {
|
|
801
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
802
|
+
return {
|
|
803
|
+
content: [{ type: "text", text: \`Error: \${message}\` }],
|
|
804
|
+
isError: true,
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* Format success response for MCP tools
|
|
810
|
+
*/
|
|
811
|
+
export function formatSuccess(data: unknown): {
|
|
812
|
+
content: Array<{ type: "text"; text: string }>;
|
|
813
|
+
} {
|
|
814
|
+
return {
|
|
815
|
+
content: [{ type: "text", text: JSON.stringify(data, null, 2) }],
|
|
816
|
+
};
|
|
817
|
+
}
|
|
818
|
+
`,
|
|
819
|
+
encoding: "utf-8",
|
|
820
|
+
},
|
|
821
|
+
// Get Products - Public tool
|
|
822
|
+
{
|
|
823
|
+
path: "src/tools/get-products.ts",
|
|
824
|
+
content: `/**
|
|
825
|
+
* Get Products Tool
|
|
826
|
+
*
|
|
827
|
+
* Retrieves products from the Hardware World catalog.
|
|
828
|
+
* Public tool - no authentication required.
|
|
829
|
+
*/
|
|
830
|
+
|
|
831
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
832
|
+
import {
|
|
833
|
+
callHardwareWorldAPI,
|
|
834
|
+
formatError,
|
|
835
|
+
formatSuccess,
|
|
836
|
+
} from "../lib/api-client";
|
|
837
|
+
|
|
838
|
+
interface Product {
|
|
839
|
+
productId: number;
|
|
840
|
+
name: string;
|
|
841
|
+
price: number;
|
|
842
|
+
description?: string;
|
|
843
|
+
[key: string]: unknown;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
interface ProductsResponse {
|
|
847
|
+
products?: Product[];
|
|
848
|
+
[key: string]: unknown;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
interface GetProductsArgs {
|
|
852
|
+
query?: string;
|
|
853
|
+
take?: number;
|
|
854
|
+
skip?: number;
|
|
855
|
+
baseUrl?: string;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export const getProductsTool: ToolDefinition = {
|
|
859
|
+
name: "get-products",
|
|
860
|
+
description:
|
|
861
|
+
"Search and browse Hardware World products. Supports filtering by search query and pagination.",
|
|
552
862
|
inputSchema: {
|
|
553
863
|
type: "object",
|
|
554
864
|
properties: {
|
|
555
|
-
|
|
556
|
-
|
|
865
|
+
query: {
|
|
866
|
+
type: "string",
|
|
867
|
+
description: "Search query to filter products (optional)",
|
|
868
|
+
},
|
|
869
|
+
take: {
|
|
870
|
+
type: "number",
|
|
871
|
+
description: "Number of products to return (default: 10)",
|
|
872
|
+
},
|
|
873
|
+
skip: {
|
|
874
|
+
type: "number",
|
|
875
|
+
description: "Number of products to skip for pagination (default: 0)",
|
|
876
|
+
},
|
|
877
|
+
baseUrl: {
|
|
878
|
+
type: "string",
|
|
879
|
+
description: "Override upstream base URL (optional)",
|
|
880
|
+
},
|
|
557
881
|
},
|
|
558
|
-
required: [
|
|
882
|
+
required: [],
|
|
559
883
|
},
|
|
560
|
-
handler: async (args:
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
884
|
+
handler: async (args: GetProductsArgs) => {
|
|
885
|
+
try {
|
|
886
|
+
const { query, take = 10, skip = 0, baseUrl } = args;
|
|
887
|
+
|
|
888
|
+
const endpoint = query
|
|
889
|
+
? \`/products/search?query=\${encodeURIComponent(query)}&skip=\${skip}&take=\${take}\`
|
|
890
|
+
: \`/products?take=\${take}&skip=\${skip}\`;
|
|
891
|
+
|
|
892
|
+
const result = await callHardwareWorldAPI<ProductsResponse>(endpoint, {
|
|
893
|
+
method: "GET",
|
|
894
|
+
baseUrl,
|
|
895
|
+
});
|
|
896
|
+
|
|
897
|
+
if (!result.ok) {
|
|
898
|
+
return {
|
|
899
|
+
content: [
|
|
900
|
+
{
|
|
901
|
+
type: "text" as const,
|
|
902
|
+
text: JSON.stringify(
|
|
903
|
+
{ error: "Failed to get products", details: result.data },
|
|
904
|
+
null,
|
|
905
|
+
2
|
|
906
|
+
),
|
|
907
|
+
},
|
|
908
|
+
],
|
|
909
|
+
isError: true,
|
|
910
|
+
};
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
const products = result.data?.products || result.data || [];
|
|
914
|
+
return formatSuccess({
|
|
915
|
+
success: true,
|
|
916
|
+
products,
|
|
917
|
+
count: Array.isArray(products) ? products.length : 0,
|
|
918
|
+
});
|
|
919
|
+
} catch (error) {
|
|
920
|
+
return formatError(error);
|
|
921
|
+
}
|
|
922
|
+
},
|
|
923
|
+
};
|
|
924
|
+
`,
|
|
925
|
+
encoding: "utf-8",
|
|
926
|
+
},
|
|
927
|
+
// Get Brands - Public tool
|
|
564
928
|
{
|
|
565
|
-
|
|
566
|
-
|
|
929
|
+
path: "src/tools/get-brands.ts",
|
|
930
|
+
content: `/**
|
|
931
|
+
* Get Brands Tool
|
|
932
|
+
*
|
|
933
|
+
* Retrieves all brands from Hardware World.
|
|
934
|
+
* Public tool - no authentication required.
|
|
935
|
+
*/
|
|
936
|
+
|
|
937
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
938
|
+
import {
|
|
939
|
+
callHardwareWorldAPI,
|
|
940
|
+
formatError,
|
|
941
|
+
formatSuccess,
|
|
942
|
+
} from "../lib/api-client";
|
|
943
|
+
|
|
944
|
+
interface Brand {
|
|
945
|
+
brandId: number;
|
|
946
|
+
name: string;
|
|
947
|
+
[key: string]: unknown;
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
interface BrandsResponse {
|
|
951
|
+
brands?: Brand[];
|
|
952
|
+
[key: string]: unknown;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
interface GetBrandsArgs {
|
|
956
|
+
baseUrl?: string;
|
|
957
|
+
}
|
|
958
|
+
|
|
959
|
+
export const getBrandsTool: ToolDefinition = {
|
|
960
|
+
name: "get-brands",
|
|
961
|
+
description: "Get all available brands from Hardware World catalog.",
|
|
962
|
+
inputSchema: {
|
|
963
|
+
type: "object",
|
|
964
|
+
properties: {
|
|
965
|
+
baseUrl: {
|
|
966
|
+
type: "string",
|
|
967
|
+
description: "Override upstream base URL (optional)",
|
|
968
|
+
},
|
|
969
|
+
},
|
|
970
|
+
required: [],
|
|
971
|
+
},
|
|
972
|
+
handler: async (args: GetBrandsArgs) => {
|
|
973
|
+
try {
|
|
974
|
+
const { baseUrl } = args;
|
|
975
|
+
|
|
976
|
+
const result = await callHardwareWorldAPI<BrandsResponse>("/brands", {
|
|
977
|
+
method: "GET",
|
|
978
|
+
baseUrl,
|
|
979
|
+
});
|
|
980
|
+
|
|
981
|
+
if (!result.ok) {
|
|
982
|
+
return {
|
|
983
|
+
content: [
|
|
984
|
+
{
|
|
985
|
+
type: "text" as const,
|
|
986
|
+
text: JSON.stringify(
|
|
987
|
+
{ error: "Failed to get brands", details: result.data },
|
|
988
|
+
null,
|
|
989
|
+
2
|
|
990
|
+
),
|
|
991
|
+
},
|
|
992
|
+
],
|
|
993
|
+
isError: true,
|
|
994
|
+
};
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
const brands = result.data?.brands || result.data || [];
|
|
998
|
+
return formatSuccess({
|
|
999
|
+
success: true,
|
|
1000
|
+
brands,
|
|
1001
|
+
count: Array.isArray(brands) ? brands.length : 0,
|
|
1002
|
+
});
|
|
1003
|
+
} catch (error) {
|
|
1004
|
+
return formatError(error);
|
|
1005
|
+
}
|
|
1006
|
+
},
|
|
1007
|
+
};
|
|
1008
|
+
`,
|
|
1009
|
+
encoding: "utf-8",
|
|
567
1010
|
},
|
|
568
|
-
|
|
569
|
-
|
|
1011
|
+
// Get Brand - Public tool
|
|
1012
|
+
{
|
|
1013
|
+
path: "src/tools/get-brand.ts",
|
|
1014
|
+
content: `/**
|
|
1015
|
+
* Get Brand Tool
|
|
1016
|
+
*
|
|
1017
|
+
* Retrieves a specific brand by ID from Hardware World.
|
|
1018
|
+
* Public tool - no authentication required.
|
|
1019
|
+
*/
|
|
1020
|
+
|
|
1021
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
1022
|
+
import {
|
|
1023
|
+
callHardwareWorldAPI,
|
|
1024
|
+
formatError,
|
|
1025
|
+
formatSuccess,
|
|
1026
|
+
} from "../lib/api-client";
|
|
1027
|
+
|
|
1028
|
+
interface Brand {
|
|
1029
|
+
brandId: number;
|
|
1030
|
+
name: string;
|
|
1031
|
+
description?: string;
|
|
1032
|
+
[key: string]: unknown;
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
interface GetBrandArgs {
|
|
1036
|
+
brandId: number;
|
|
1037
|
+
baseUrl?: string;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
export const getBrandTool: ToolDefinition = {
|
|
1041
|
+
name: "get-brand",
|
|
1042
|
+
description: "Get details for a specific brand by its ID.",
|
|
1043
|
+
inputSchema: {
|
|
1044
|
+
type: "object",
|
|
1045
|
+
properties: {
|
|
1046
|
+
brandId: {
|
|
1047
|
+
type: "number",
|
|
1048
|
+
description: "The brand ID to look up",
|
|
1049
|
+
},
|
|
1050
|
+
baseUrl: {
|
|
1051
|
+
type: "string",
|
|
1052
|
+
description: "Override upstream base URL (optional)",
|
|
1053
|
+
},
|
|
1054
|
+
},
|
|
1055
|
+
required: ["brandId"],
|
|
1056
|
+
},
|
|
1057
|
+
handler: async (args: GetBrandArgs) => {
|
|
1058
|
+
try {
|
|
1059
|
+
const { brandId, baseUrl } = args;
|
|
1060
|
+
|
|
1061
|
+
if (brandId === undefined || brandId === null) {
|
|
1062
|
+
return formatError("Brand ID is required");
|
|
1063
|
+
}
|
|
1064
|
+
|
|
1065
|
+
const result = await callHardwareWorldAPI<Brand>(\`/brands/\${brandId}\`, {
|
|
1066
|
+
method: "GET",
|
|
1067
|
+
baseUrl,
|
|
1068
|
+
});
|
|
1069
|
+
|
|
1070
|
+
if (!result.ok) {
|
|
1071
|
+
return {
|
|
1072
|
+
content: [
|
|
1073
|
+
{
|
|
1074
|
+
type: "text" as const,
|
|
1075
|
+
text: JSON.stringify(
|
|
1076
|
+
{ error: "Failed to get brand", details: result.data },
|
|
1077
|
+
null,
|
|
1078
|
+
2
|
|
1079
|
+
),
|
|
1080
|
+
},
|
|
1081
|
+
],
|
|
1082
|
+
isError: true,
|
|
1083
|
+
};
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
return formatSuccess({
|
|
1087
|
+
success: true,
|
|
1088
|
+
brand: result.data,
|
|
1089
|
+
});
|
|
1090
|
+
} catch (error) {
|
|
1091
|
+
return formatError(error);
|
|
1092
|
+
}
|
|
570
1093
|
},
|
|
571
1094
|
};
|
|
572
1095
|
`,
|
|
573
1096
|
encoding: "utf-8",
|
|
574
1097
|
},
|
|
1098
|
+
// Get Customer - Protected tool (requires delegation)
|
|
575
1099
|
{
|
|
576
|
-
path: "src/tools/get-
|
|
577
|
-
content:
|
|
1100
|
+
path: "src/tools/get-customer.ts",
|
|
1101
|
+
content: `/**
|
|
1102
|
+
* Get Customer Tool
|
|
1103
|
+
*
|
|
1104
|
+
* Retrieves the authenticated customer's information from Hardware World.
|
|
1105
|
+
*
|
|
1106
|
+
* PROTECTED OPERATION - requires delegation with 'customer:read' scope.
|
|
1107
|
+
* Authentication is handled via MCP-I delegation flow.
|
|
1108
|
+
*/
|
|
578
1109
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
1110
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
1111
|
+
import {
|
|
1112
|
+
callHardwareWorldAPI,
|
|
1113
|
+
formatError,
|
|
1114
|
+
formatSuccess,
|
|
1115
|
+
type ToolContext,
|
|
1116
|
+
} from "../lib/api-client";
|
|
1117
|
+
|
|
1118
|
+
interface CustomerData {
|
|
1119
|
+
customerId: number;
|
|
1120
|
+
email?: string;
|
|
1121
|
+
firstName?: string;
|
|
1122
|
+
lastName?: string;
|
|
1123
|
+
[key: string]: unknown;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
interface GetCustomerArgs {
|
|
1127
|
+
customerId?: number;
|
|
1128
|
+
baseUrl?: string;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
export const getCustomerTool: ToolDefinition = {
|
|
1132
|
+
name: "get-customer",
|
|
1133
|
+
description:
|
|
1134
|
+
"Get the authenticated customer's information. Requires user authorization (handled automatically via consent flow).",
|
|
582
1135
|
inputSchema: {
|
|
583
1136
|
type: "object",
|
|
584
|
-
properties: {
|
|
1137
|
+
properties: {
|
|
1138
|
+
customerId: {
|
|
1139
|
+
type: "number",
|
|
1140
|
+
description:
|
|
1141
|
+
"Customer ID (optional - automatically provided via authorization)",
|
|
1142
|
+
},
|
|
1143
|
+
baseUrl: {
|
|
1144
|
+
type: "string",
|
|
1145
|
+
description: "Override upstream base URL (optional)",
|
|
1146
|
+
},
|
|
1147
|
+
},
|
|
1148
|
+
required: [],
|
|
585
1149
|
},
|
|
586
|
-
handler: async () => {
|
|
587
|
-
|
|
588
|
-
|
|
1150
|
+
handler: async (args: GetCustomerArgs, context?: ToolContext) => {
|
|
1151
|
+
try {
|
|
1152
|
+
const { baseUrl } = args;
|
|
1153
|
+
|
|
1154
|
+
// Verify we have authentication
|
|
1155
|
+
if (!context?.idpToken) {
|
|
1156
|
+
return formatError(
|
|
1157
|
+
"Authentication not available. Please ensure you have authorized this tool."
|
|
1158
|
+
);
|
|
1159
|
+
}
|
|
1160
|
+
|
|
1161
|
+
// Get customerId from context or args
|
|
1162
|
+
const customerId = args.customerId || context?.userId;
|
|
1163
|
+
|
|
1164
|
+
if (customerId === undefined || customerId === null) {
|
|
1165
|
+
return formatError(
|
|
1166
|
+
"Customer ID not available. Please ensure you have authorized this tool."
|
|
1167
|
+
);
|
|
1168
|
+
}
|
|
1169
|
+
|
|
1170
|
+
const result = await callHardwareWorldAPI<CustomerData>(
|
|
1171
|
+
\`/customers/\${customerId}\`,
|
|
589
1172
|
{
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
items: [],
|
|
593
|
-
total: 0,
|
|
594
|
-
message: "Your Hardware World cart is empty!",
|
|
595
|
-
}),
|
|
1173
|
+
method: "GET",
|
|
1174
|
+
baseUrl,
|
|
596
1175
|
},
|
|
597
|
-
|
|
598
|
-
|
|
1176
|
+
context
|
|
1177
|
+
);
|
|
1178
|
+
|
|
1179
|
+
if (!result.ok) {
|
|
1180
|
+
return {
|
|
1181
|
+
content: [
|
|
1182
|
+
{
|
|
1183
|
+
type: "text" as const,
|
|
1184
|
+
text: JSON.stringify(
|
|
1185
|
+
{ error: "Failed to get customer", details: result.data },
|
|
1186
|
+
null,
|
|
1187
|
+
2
|
|
1188
|
+
),
|
|
1189
|
+
},
|
|
1190
|
+
],
|
|
1191
|
+
isError: true,
|
|
1192
|
+
};
|
|
1193
|
+
}
|
|
1194
|
+
|
|
1195
|
+
return formatSuccess({
|
|
1196
|
+
success: true,
|
|
1197
|
+
customer: result.data,
|
|
1198
|
+
});
|
|
1199
|
+
} catch (error) {
|
|
1200
|
+
return formatError(error);
|
|
1201
|
+
}
|
|
599
1202
|
},
|
|
600
1203
|
};
|
|
601
1204
|
`,
|
|
602
1205
|
encoding: "utf-8",
|
|
603
1206
|
},
|
|
1207
|
+
// Get Cart - Protected tool (requires delegation)
|
|
604
1208
|
{
|
|
605
|
-
path: "src/tools/
|
|
606
|
-
content:
|
|
1209
|
+
path: "src/tools/get-cart.ts",
|
|
1210
|
+
content: `/**
|
|
1211
|
+
* Get Cart Tool
|
|
1212
|
+
*
|
|
1213
|
+
* Retrieves the customer's shopping cart contents and totals.
|
|
1214
|
+
*
|
|
1215
|
+
* PROTECTED OPERATION - requires delegation with 'cart:read' scope.
|
|
1216
|
+
* Authentication is handled via MCP-I delegation flow.
|
|
1217
|
+
*/
|
|
1218
|
+
|
|
1219
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
1220
|
+
import {
|
|
1221
|
+
callHardwareWorldAPI,
|
|
1222
|
+
formatError,
|
|
1223
|
+
formatSuccess,
|
|
1224
|
+
type ToolContext,
|
|
1225
|
+
} from "../lib/api-client";
|
|
1226
|
+
|
|
1227
|
+
interface CartData {
|
|
1228
|
+
items?: unknown[];
|
|
1229
|
+
total?: number;
|
|
1230
|
+
[key: string]: unknown;
|
|
1231
|
+
}
|
|
607
1232
|
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
1233
|
+
interface GetCartArgs {
|
|
1234
|
+
customerId?: number;
|
|
1235
|
+
baseUrl?: string;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
export const getCartTool: ToolDefinition = {
|
|
1239
|
+
name: "get-cart",
|
|
1240
|
+
description:
|
|
1241
|
+
"Get the current shopping cart contents and totals. Requires user authorization (handled automatically via consent flow).",
|
|
611
1242
|
inputSchema: {
|
|
612
1243
|
type: "object",
|
|
613
1244
|
properties: {
|
|
614
|
-
|
|
1245
|
+
customerId: {
|
|
1246
|
+
type: "number",
|
|
1247
|
+
description:
|
|
1248
|
+
"Customer ID (optional - automatically provided via authorization)",
|
|
1249
|
+
},
|
|
1250
|
+
baseUrl: {
|
|
1251
|
+
type: "string",
|
|
1252
|
+
description: "Override upstream base URL (optional)",
|
|
1253
|
+
},
|
|
615
1254
|
},
|
|
616
|
-
required: [
|
|
1255
|
+
required: [],
|
|
617
1256
|
},
|
|
618
|
-
handler: async (args:
|
|
619
|
-
|
|
620
|
-
|
|
1257
|
+
handler: async (args: GetCartArgs, context?: ToolContext) => {
|
|
1258
|
+
try {
|
|
1259
|
+
const { baseUrl } = args;
|
|
1260
|
+
|
|
1261
|
+
// Verify we have authentication
|
|
1262
|
+
if (!context?.idpToken) {
|
|
1263
|
+
return formatError(
|
|
1264
|
+
"Authentication not available. Please ensure you have authorized this tool."
|
|
1265
|
+
);
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
const result = await callHardwareWorldAPI<CartData>(
|
|
1269
|
+
"/cart",
|
|
621
1270
|
{
|
|
622
|
-
|
|
623
|
-
|
|
1271
|
+
method: "GET",
|
|
1272
|
+
baseUrl,
|
|
624
1273
|
},
|
|
625
|
-
|
|
626
|
-
|
|
1274
|
+
context
|
|
1275
|
+
);
|
|
1276
|
+
|
|
1277
|
+
if (!result.ok) {
|
|
1278
|
+
return {
|
|
1279
|
+
content: [
|
|
1280
|
+
{
|
|
1281
|
+
type: "text" as const,
|
|
1282
|
+
text: JSON.stringify(
|
|
1283
|
+
{ error: "Failed to get cart", details: result.data },
|
|
1284
|
+
null,
|
|
1285
|
+
2
|
|
1286
|
+
),
|
|
1287
|
+
},
|
|
1288
|
+
],
|
|
1289
|
+
isError: true,
|
|
1290
|
+
};
|
|
1291
|
+
}
|
|
1292
|
+
|
|
1293
|
+
return formatSuccess({
|
|
1294
|
+
success: true,
|
|
1295
|
+
cart: result.data,
|
|
1296
|
+
});
|
|
1297
|
+
} catch (error) {
|
|
1298
|
+
return formatError(error);
|
|
1299
|
+
}
|
|
627
1300
|
},
|
|
628
1301
|
};
|
|
629
1302
|
`,
|
|
630
1303
|
encoding: "utf-8",
|
|
631
1304
|
},
|
|
1305
|
+
// Add to Cart - Protected tool (requires delegation)
|
|
632
1306
|
{
|
|
633
|
-
path: "src/tools/
|
|
634
|
-
content:
|
|
1307
|
+
path: "src/tools/add-to-cart.ts",
|
|
1308
|
+
content: `/**
|
|
1309
|
+
* Add to Cart Tool
|
|
1310
|
+
*
|
|
1311
|
+
* Adds a product to the customer's shopping cart.
|
|
1312
|
+
*
|
|
1313
|
+
* PROTECTED OPERATION - requires delegation with 'cart:write' scope.
|
|
1314
|
+
* Authentication is handled via MCP-I delegation flow.
|
|
1315
|
+
*/
|
|
635
1316
|
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
1317
|
+
import type { ToolDefinition } from "@kya-os/mcp-i-cloudflare";
|
|
1318
|
+
import {
|
|
1319
|
+
callHardwareWorldAPI,
|
|
1320
|
+
formatError,
|
|
1321
|
+
formatSuccess,
|
|
1322
|
+
type ToolContext,
|
|
1323
|
+
} from "../lib/api-client";
|
|
1324
|
+
|
|
1325
|
+
interface CartResponse {
|
|
1326
|
+
message?: string;
|
|
1327
|
+
customerId?: number;
|
|
1328
|
+
[key: string]: unknown;
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
interface AddToCartArgs {
|
|
1332
|
+
productId: number;
|
|
1333
|
+
quantity?: number;
|
|
1334
|
+
customerId?: number;
|
|
1335
|
+
baseUrl?: string;
|
|
1336
|
+
}
|
|
1337
|
+
|
|
1338
|
+
export const addToCartTool: ToolDefinition = {
|
|
1339
|
+
name: "add-to-cart",
|
|
1340
|
+
description:
|
|
1341
|
+
"Add a product to the shopping cart. Requires user authorization (handled automatically via consent flow).",
|
|
639
1342
|
inputSchema: {
|
|
640
1343
|
type: "object",
|
|
641
1344
|
properties: {
|
|
642
|
-
|
|
643
|
-
|
|
1345
|
+
productId: {
|
|
1346
|
+
type: "number",
|
|
1347
|
+
description: "Product ID to add to cart",
|
|
1348
|
+
},
|
|
1349
|
+
quantity: {
|
|
1350
|
+
type: "number",
|
|
1351
|
+
description: "Quantity to add (default: 1)",
|
|
1352
|
+
},
|
|
1353
|
+
customerId: {
|
|
1354
|
+
type: "number",
|
|
1355
|
+
description:
|
|
1356
|
+
"Customer ID (optional - automatically provided via authorization)",
|
|
1357
|
+
},
|
|
1358
|
+
baseUrl: {
|
|
644
1359
|
type: "string",
|
|
645
|
-
description: "
|
|
1360
|
+
description: "Override upstream base URL (optional)",
|
|
646
1361
|
},
|
|
647
1362
|
},
|
|
648
|
-
required: ["
|
|
1363
|
+
required: ["productId"],
|
|
649
1364
|
},
|
|
650
|
-
handler: async (args:
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
1365
|
+
handler: async (args: AddToCartArgs, context?: ToolContext) => {
|
|
1366
|
+
try {
|
|
1367
|
+
const { productId, quantity = 1, baseUrl } = args;
|
|
1368
|
+
|
|
1369
|
+
if (productId === undefined || productId === null) {
|
|
1370
|
+
return formatError("Product ID is required");
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// Verify we have authentication
|
|
1374
|
+
if (!context?.idpToken) {
|
|
1375
|
+
return formatError(
|
|
1376
|
+
"Authentication not available. Please ensure you have authorized this tool."
|
|
1377
|
+
);
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
const result = await callHardwareWorldAPI<CartResponse>(
|
|
1381
|
+
"/cart/add",
|
|
654
1382
|
{
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
category: args.category,
|
|
659
|
-
results: [
|
|
660
|
-
{ id: "hw-001", name: "Power Drill", price: 79.99 },
|
|
661
|
-
{ id: "hw-002", name: "Hammer", price: 24.99 },
|
|
662
|
-
{ id: "hw-003", name: "Screwdriver Set", price: 34.99 },
|
|
663
|
-
],
|
|
664
|
-
message: \`Found 3 products matching "\${args.query}"\${categoryFilter}\`,
|
|
665
|
-
}),
|
|
1383
|
+
method: "POST",
|
|
1384
|
+
body: { productId, quantity },
|
|
1385
|
+
baseUrl,
|
|
666
1386
|
},
|
|
667
|
-
|
|
668
|
-
|
|
1387
|
+
context
|
|
1388
|
+
);
|
|
1389
|
+
|
|
1390
|
+
if (!result.ok) {
|
|
1391
|
+
return {
|
|
1392
|
+
content: [
|
|
1393
|
+
{
|
|
1394
|
+
type: "text" as const,
|
|
1395
|
+
text: JSON.stringify(
|
|
1396
|
+
{ error: "Failed to add to cart", details: result.data },
|
|
1397
|
+
null,
|
|
1398
|
+
2
|
|
1399
|
+
),
|
|
1400
|
+
},
|
|
1401
|
+
],
|
|
1402
|
+
isError: true,
|
|
1403
|
+
};
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
return formatSuccess({
|
|
1407
|
+
success: true,
|
|
1408
|
+
message: "Product added to cart",
|
|
1409
|
+
data: result.data,
|
|
1410
|
+
});
|
|
1411
|
+
} catch (error) {
|
|
1412
|
+
return formatError(error);
|
|
1413
|
+
}
|
|
669
1414
|
},
|
|
670
1415
|
};
|
|
671
1416
|
`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-cloudflare-files.js","sourceRoot":"","sources":["../../src/helpers/generate-cloudflare-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,EACL,gBAAgB,GAEjB,MAAM,wBAAwB,CAAC;AAgDhC;;GAEG;AACH,MAAM,gBAAgB,GAAG;IACvB,aAAa;IACb,eAAe;IACf,kBAAkB;IAClB,oBAAoB;IACpB,oBAAoB;CACZ,CAAC;AAEX;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CAClD,OAA6B;IAE7B,MAAM,EACJ,WAAW,EACX,QAAQ,GAAG,OAAO,EAClB,oBAAoB,EACpB,iBAAiB,GAAG,wBAAwB,EAC5C,iBAAiB,EACjB,YAAY,GAAG,KAAK,GACrB,GAAG,OAAO,CAAC;IAEZ,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACtE,MAAM,cAAc,GAAG,YAAY,CAAC,WAAW,CAAC,CAAC;IAEjD,oBAAoB;IACpB,IAAI,QAA2B,CAAC;IAChC,IAAI,YAAY,EAAE,CAAC;QACjB,QAAQ,GAAG;YACT,GAAG,EAAE,2BAA2B;YAChC,GAAG,EAAE,iCAAiC;YACtC,UAAU,EAAE,kBAAkB;YAC9B,SAAS,EAAE,iBAAiB;YAC5B,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,IAAI,EAAE,aAAa;SACpB,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,QAAQ,GAAG,MAAM,gBAAgB,EAAE,CAAC;IACtC,CAAC;IAED,mCAAmC;IACnC,MAAM,qBAAqB,GAAG,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAErE,MAAM,KAAK,GAAoB,EAAE,CAAC;IAElC,kBAAkB;IAClB,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,IAAI,CAAC,SAAS,CACrB;YACE,IAAI,EAAE,WAAW;YACjB,OAAO,EAAE,OAAO;YAChB,OAAO,EAAE,IAAI;YACb,OAAO,EAAE;gBACP,MAAM,EAAE,iBAAiB;gBACzB,GAAG,EAAE,cAAc;gBACnB,KAAK,EAAE,cAAc;gBACrB,IAAI,EAAE,QAAQ;gBACd,YAAY,EAAE,gBAAgB;aAC/B;YACD,YAAY,EAAE;gBACZ,0BAA0B,EAAE,SAAS;gBACrC,2BAA2B,EAAE,QAAQ;gBACrC,MAAM,EAAE,QAAQ;gBAChB,IAAI,EAAE,QAAQ;aACf;YACD,eAAe,EAAE;gBACf,iCAAiC,EAAE,SAAS;gBAC5C,2BAA2B,EAAE,eAAe;gBAC5C,aAAa,EAAE,SAAS;gBACxB,UAAU,EAAE,QAAQ;gBACpB,MAAM,EAAE,QAAQ;gBAChB,QAAQ,EAAE,SAAS;aACpB;SACF,EACD,IAAI,EACJ,CAAC,CACF;QACD,QAAQ,EAAE,OAAO;KAClB,CAAC,CAAC;IAEH,kEAAkE;IAClE,KAAK,CAAC,IAAI,CAAC;QACT,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,oBAAoB,CAAC;YAC5B,WAAW;YACX,gBAAgB;YAChB,cAAc;YACd,QAAQ,EAAE,QAAQ,CAAC,GAAG;YACtB,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,oBAAoB;YACpB,iBAAiB;
|
|
1
|
+
{"version":3,"file":"generate-cloudflare-files.js","sourceRoot":"","sources":["../../src/helpers/generate-cloudflare-files.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO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
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/helpers/index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@kya-os/cli-effects": "^1.0.19",
|
|
37
37
|
"@kya-os/contracts": "^1.6.19",
|
|
38
38
|
"@kya-os/mcp-i": "^1.6.15",
|
|
39
|
-
"@kya-os/mcp-i-cloudflare": "^1.6.
|
|
39
|
+
"@kya-os/mcp-i-cloudflare": "^1.6.49",
|
|
40
40
|
"base-x": "^5.0.0",
|
|
41
41
|
"chalk": "^4.1.2",
|
|
42
42
|
"commander": "^12.1.0",
|