@01.software/cli 0.10.0 → 0.10.1
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/dist/index.js +209 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/{chunk-CADO6WG6.js → chunk-2ECTVUKU.js} +439 -109
- package/dist/mcp/chunk-2ECTVUKU.js.map +1 -0
- package/dist/mcp/http.js +18 -8
- package/dist/mcp/http.js.map +1 -1
- package/dist/mcp/stdio.js +1 -1
- package/dist/mcp/vercel.js +457 -117
- package/package.json +17 -9
- package/dist/mcp/chunk-CADO6WG6.js.map +0 -1
package/dist/mcp/vercel.js
CHANGED
|
@@ -125,6 +125,77 @@ var tenantContextResponseSchema = z.object({
|
|
|
125
125
|
webhookConfigured: z.boolean()
|
|
126
126
|
}).strict().optional()
|
|
127
127
|
}).strict();
|
|
128
|
+
var tenantFeatureProgressFeatureSchema = z.enum(["ecommerce"]);
|
|
129
|
+
var tenantFeatureProgressInputSchema = z.object({
|
|
130
|
+
feature: tenantFeatureProgressFeatureSchema.describe(
|
|
131
|
+
"Feature to inspect for tenant implementation readiness"
|
|
132
|
+
),
|
|
133
|
+
includeEvidence: z.boolean().optional().default(false).describe("Include sanitized counts and static surface evidence")
|
|
134
|
+
}).strict();
|
|
135
|
+
var tenantFeatureProgressStatusSchema = z.enum([
|
|
136
|
+
"ready",
|
|
137
|
+
"attention",
|
|
138
|
+
"blocked"
|
|
139
|
+
]);
|
|
140
|
+
var tenantFeatureProgressItemStateSchema = z.enum([
|
|
141
|
+
"complete",
|
|
142
|
+
"incomplete",
|
|
143
|
+
"blocked",
|
|
144
|
+
"attention",
|
|
145
|
+
"optional",
|
|
146
|
+
"unknown",
|
|
147
|
+
"manual",
|
|
148
|
+
"not-applicable"
|
|
149
|
+
]);
|
|
150
|
+
var tenantFeatureProgressSeveritySchema = z.enum([
|
|
151
|
+
"required",
|
|
152
|
+
"recommended",
|
|
153
|
+
"optional"
|
|
154
|
+
]);
|
|
155
|
+
var tenantFeatureProgressEvidenceValueSchema = z.union([
|
|
156
|
+
z.string(),
|
|
157
|
+
z.number(),
|
|
158
|
+
z.boolean(),
|
|
159
|
+
z.null()
|
|
160
|
+
]);
|
|
161
|
+
var tenantFeatureProgressItemSchema = z.object({
|
|
162
|
+
id: z.string(),
|
|
163
|
+
title: z.string(),
|
|
164
|
+
state: tenantFeatureProgressItemStateSchema,
|
|
165
|
+
severity: tenantFeatureProgressSeveritySchema,
|
|
166
|
+
summary: z.string(),
|
|
167
|
+
evidence: z.record(z.string(), tenantFeatureProgressEvidenceValueSchema).optional()
|
|
168
|
+
}).strict();
|
|
169
|
+
var tenantFeatureProgressGroupSchema = z.object({
|
|
170
|
+
id: z.string(),
|
|
171
|
+
title: z.string(),
|
|
172
|
+
summary: z.string().optional(),
|
|
173
|
+
items: z.array(tenantFeatureProgressItemSchema)
|
|
174
|
+
}).strict();
|
|
175
|
+
var tenantFeatureProgressResponseSchema = z.object({
|
|
176
|
+
schemaVersion: z.literal(1),
|
|
177
|
+
feature: tenantFeatureProgressFeatureSchema,
|
|
178
|
+
status: tenantFeatureProgressStatusSchema,
|
|
179
|
+
generatedAt: z.string(),
|
|
180
|
+
tenant: z.object({
|
|
181
|
+
id: z.string(),
|
|
182
|
+
name: z.string(),
|
|
183
|
+
plan: z.string()
|
|
184
|
+
}).strict(),
|
|
185
|
+
capability: z.object({
|
|
186
|
+
effectiveFeatures: z.array(z.string()),
|
|
187
|
+
planBlocked: z.array(z.string()),
|
|
188
|
+
closureAdded: z.array(z.string())
|
|
189
|
+
}).strict(),
|
|
190
|
+
summary: z.object({
|
|
191
|
+
complete: z.number().int().nonnegative(),
|
|
192
|
+
total: z.number().int().nonnegative(),
|
|
193
|
+
blocking: z.number().int().nonnegative(),
|
|
194
|
+
manual: z.number().int().nonnegative(),
|
|
195
|
+
unknown: z.number().int().nonnegative()
|
|
196
|
+
}).strict(),
|
|
197
|
+
groups: z.array(tenantFeatureProgressGroupSchema)
|
|
198
|
+
}).strict();
|
|
128
199
|
var COLLECTION_SCHEMA_CONTRACT_VERSION = 1;
|
|
129
200
|
var collectionSchemaEndpointParamsSchema = z.object({
|
|
130
201
|
collectionSlug: z.string().min(1, "collectionSlug is required")
|
|
@@ -190,6 +261,29 @@ var updateTransactionSchema = z2.object({
|
|
|
190
261
|
amount: z2.number().int().positive().optional().describe("Provider-confirmed amount for verified paid confirmation")
|
|
191
262
|
}).strict();
|
|
192
263
|
var UpdateTransactionSchema = updateTransactionSchema;
|
|
264
|
+
var providerSlugSchema = z2.string().trim().regex(/^[a-z0-9][a-z0-9_-]{0,63}$/, "pgProvider must be lowercase slug");
|
|
265
|
+
var confirmPaymentSchema = z2.object({
|
|
266
|
+
orderNumber: z2.string().min(1).optional(),
|
|
267
|
+
pgPaymentId: z2.string().min(1, "pgPaymentId is required").describe("Provider payment identifier stored on the transaction"),
|
|
268
|
+
pgProvider: providerSlugSchema.describe(
|
|
269
|
+
"Payment provider slug, e.g. toss, portone, stripe"
|
|
270
|
+
),
|
|
271
|
+
pgOrderId: z2.string().min(1).optional(),
|
|
272
|
+
amount: z2.number().int().nonnegative("amount must be non-negative").describe("Provider-confirmed amount in minor units"),
|
|
273
|
+
currency: z2.string().min(1).optional(),
|
|
274
|
+
paymentMethod: z2.string().optional(),
|
|
275
|
+
receiptUrl: z2.string().url().optional(),
|
|
276
|
+
approvedAt: z2.string().optional(),
|
|
277
|
+
providerStatus: z2.string().optional(),
|
|
278
|
+
providerEventId: z2.string().min(1).optional(),
|
|
279
|
+
confirmationSource: z2.enum([
|
|
280
|
+
"provider_webhook",
|
|
281
|
+
"provider_lookup",
|
|
282
|
+
"provider_api_confirm",
|
|
283
|
+
"manual_server"
|
|
284
|
+
]).optional(),
|
|
285
|
+
metadata: z2.record(z2.string(), z2.unknown()).optional()
|
|
286
|
+
}).strict();
|
|
193
287
|
var returnReasonSchema = z2.enum([
|
|
194
288
|
"change_of_mind",
|
|
195
289
|
"defective",
|
|
@@ -262,6 +356,11 @@ var MCP_TOOL_CONTRACT = {
|
|
|
262
356
|
oauthScope: "mcp:read",
|
|
263
357
|
readOnly: true
|
|
264
358
|
},
|
|
359
|
+
"check-feature-progress": {
|
|
360
|
+
consoleRole: "tenant-viewer",
|
|
361
|
+
oauthScope: "mcp:read",
|
|
362
|
+
readOnly: true
|
|
363
|
+
},
|
|
265
364
|
"add-cart-item": {
|
|
266
365
|
consoleRole: "tenant-editor",
|
|
267
366
|
oauthScope: "mcp:write",
|
|
@@ -363,9 +462,7 @@ var MCP_TOOL_CONTRACT = {
|
|
|
363
462
|
readOnly: true
|
|
364
463
|
}
|
|
365
464
|
};
|
|
366
|
-
var MCP_TOOL_NAMES = Object.keys(
|
|
367
|
-
MCP_TOOL_CONTRACT
|
|
368
|
-
);
|
|
465
|
+
var MCP_TOOL_NAMES = Object.keys(MCP_TOOL_CONTRACT);
|
|
369
466
|
function isMcpToolName(toolName) {
|
|
370
467
|
return Object.prototype.hasOwnProperty.call(MCP_TOOL_CONTRACT, toolName);
|
|
371
468
|
}
|
|
@@ -469,6 +566,13 @@ var TOOL_POLICY_MANIFEST = {
|
|
|
469
566
|
consoleSurface: "GET /api/tenants/context",
|
|
470
567
|
annotationPolicy: READ_ONLY_ANNOTATION
|
|
471
568
|
},
|
|
569
|
+
"check-feature-progress": {
|
|
570
|
+
category: "read-only-tenant",
|
|
571
|
+
oauthScope: MCP_SCOPES.read,
|
|
572
|
+
consoleRole: "tenant-viewer",
|
|
573
|
+
consoleSurface: "GET /api/tenants/feature-progress",
|
|
574
|
+
annotationPolicy: READ_ONLY_ANNOTATION
|
|
575
|
+
},
|
|
472
576
|
// ── Cart mutations (mcp:write, tenant-editor) ──
|
|
473
577
|
"add-cart-item": {
|
|
474
578
|
category: "mutation-cart",
|
|
@@ -518,7 +622,7 @@ var TOOL_POLICY_MANIFEST = {
|
|
|
518
622
|
exemptionReason: REASON_CART_EPHEMERAL
|
|
519
623
|
},
|
|
520
624
|
// ── Order mutations (mcp:write, tenant-admin) ──
|
|
521
|
-
|
|
625
|
+
checkout: {
|
|
522
626
|
category: "mutation-order",
|
|
523
627
|
oauthScope: MCP_SCOPES.write,
|
|
524
628
|
consoleRole: "tenant-admin",
|
|
@@ -1812,6 +1916,11 @@ async function getCollectionSchemaTool({
|
|
|
1812
1916
|
function getTenantContextPath(includeCounts) {
|
|
1813
1917
|
return includeCounts ? "/api/tenants/context?counts=true" : "/api/tenants/context";
|
|
1814
1918
|
}
|
|
1919
|
+
function getTenantFeatureProgressPath(feature, includeEvidence) {
|
|
1920
|
+
const search = new URLSearchParams({ feature });
|
|
1921
|
+
if (includeEvidence) search.set("includeEvidence", "true");
|
|
1922
|
+
return `/api/tenants/feature-progress?${search.toString()}`;
|
|
1923
|
+
}
|
|
1815
1924
|
async function getTenantContext(includeCounts = false) {
|
|
1816
1925
|
const apiKey = resolveApiKey();
|
|
1817
1926
|
const data = await consoleGet(
|
|
@@ -1820,6 +1929,14 @@ async function getTenantContext(includeCounts = false) {
|
|
|
1820
1929
|
);
|
|
1821
1930
|
return tenantContextResponseSchema.parse(data);
|
|
1822
1931
|
}
|
|
1932
|
+
async function getTenantFeatureProgress(feature, includeEvidence = false) {
|
|
1933
|
+
const apiKey = resolveApiKey();
|
|
1934
|
+
const data = await consoleGet(
|
|
1935
|
+
getTenantFeatureProgressPath(feature, includeEvidence),
|
|
1936
|
+
apiKey
|
|
1937
|
+
);
|
|
1938
|
+
return tenantFeatureProgressResponseSchema.parse(data);
|
|
1939
|
+
}
|
|
1823
1940
|
|
|
1824
1941
|
// src/tools/get-tenant-context.ts
|
|
1825
1942
|
var schema23 = tenantContextToolInputSchema.shape;
|
|
@@ -1899,6 +2016,30 @@ async function handler({
|
|
|
1899
2016
|
}
|
|
1900
2017
|
}
|
|
1901
2018
|
|
|
2019
|
+
// src/tools/check-feature-progress.ts
|
|
2020
|
+
var schema24 = tenantFeatureProgressInputSchema.shape;
|
|
2021
|
+
var metadata24 = {
|
|
2022
|
+
name: "check-feature-progress",
|
|
2023
|
+
description: "Check tenant implementation progress for a supported feature. Start with feature=ecommerce to inspect catalog, cart, checkout, payment result, webhook, and operations readiness without mutating tenant data.",
|
|
2024
|
+
annotations: {
|
|
2025
|
+
title: "Check Feature Progress",
|
|
2026
|
+
readOnlyHint: true,
|
|
2027
|
+
destructiveHint: false,
|
|
2028
|
+
idempotentHint: true
|
|
2029
|
+
}
|
|
2030
|
+
};
|
|
2031
|
+
async function handler2({
|
|
2032
|
+
feature,
|
|
2033
|
+
includeEvidence
|
|
2034
|
+
}) {
|
|
2035
|
+
try {
|
|
2036
|
+
const progress = await getTenantFeatureProgress(feature, includeEvidence);
|
|
2037
|
+
return toolSuccess({ progress });
|
|
2038
|
+
} catch (error) {
|
|
2039
|
+
return toolError(error);
|
|
2040
|
+
}
|
|
2041
|
+
}
|
|
2042
|
+
|
|
1902
2043
|
// src/tools/list-configurable-fields.ts
|
|
1903
2044
|
import { z as z22 } from "zod";
|
|
1904
2045
|
|
|
@@ -1923,12 +2064,12 @@ function invalidateFieldConfigCache() {
|
|
|
1923
2064
|
}
|
|
1924
2065
|
|
|
1925
2066
|
// src/tools/list-configurable-fields.ts
|
|
1926
|
-
var
|
|
2067
|
+
var schema25 = {
|
|
1927
2068
|
collection: z22.string().optional().describe(
|
|
1928
2069
|
"Filter by collection slug (optional \u2014 returns all if omitted). Use this filter to reduce response size when you know which collection to check."
|
|
1929
2070
|
)
|
|
1930
2071
|
};
|
|
1931
|
-
var
|
|
2072
|
+
var metadata25 = {
|
|
1932
2073
|
name: "list-configurable-fields",
|
|
1933
2074
|
description: "List all configurable fields for tenant collections with current visibility state. Shows which fields can be shown/hidden and their current status. Returns all collections including inactive features \u2014 cross-reference with get-tenant-context for active features. Response includes ~300 fields across 47 collections \u2014 use collection filter when possible.",
|
|
1934
2075
|
annotations: {
|
|
@@ -1960,7 +2101,7 @@ async function listConfigurableFields(params) {
|
|
|
1960
2101
|
|
|
1961
2102
|
// src/tools/update-field-config.ts
|
|
1962
2103
|
import { z as z23 } from "zod";
|
|
1963
|
-
var
|
|
2104
|
+
var schema26 = {
|
|
1964
2105
|
collection: z23.string().min(1).describe("Collection slug (required)"),
|
|
1965
2106
|
hiddenFields: z23.array(z23.string().min(1).max(200)).max(300).describe(
|
|
1966
2107
|
"Fields to hide (required). This is a FULL REPLACE \u2014 fields NOT in this list will be shown. Pass [] to show all fields. Use list-configurable-fields first to see available field paths."
|
|
@@ -1969,7 +2110,7 @@ var schema25 = {
|
|
|
1969
2110
|
"Hide the entire collection from Admin Panel (optional). When true, individual hiddenFields are irrelevant."
|
|
1970
2111
|
)
|
|
1971
2112
|
};
|
|
1972
|
-
var
|
|
2113
|
+
var metadata26 = {
|
|
1973
2114
|
name: "update-field-config",
|
|
1974
2115
|
description: "Update field visibility configuration for a tenant collection. Hidden fields are removed from the Admin Panel UI. IMPORTANT: hiddenFields is a full replace, not a merge. Always call list-configurable-fields first to see current state.",
|
|
1975
2116
|
annotations: {
|
|
@@ -2429,7 +2570,7 @@ function getRecipe(goal, runtime = "both") {
|
|
|
2429
2570
|
}
|
|
2430
2571
|
|
|
2431
2572
|
// src/tools/sdk-get-recipe.ts
|
|
2432
|
-
var
|
|
2573
|
+
var schema27 = {
|
|
2433
2574
|
goal: z24.enum([
|
|
2434
2575
|
"fetch-list",
|
|
2435
2576
|
"fetch-by-id",
|
|
@@ -2446,7 +2587,7 @@ var schema26 = {
|
|
|
2446
2587
|
collection: z24.string().optional().describe("Specific collection name if applicable"),
|
|
2447
2588
|
includeExample: z24.boolean().default(true).describe("Whether to include a full code example")
|
|
2448
2589
|
};
|
|
2449
|
-
var
|
|
2590
|
+
var metadata27 = {
|
|
2450
2591
|
name: "sdk-get-recipe",
|
|
2451
2592
|
description: "Get a complete SDK code recipe for a specific task. Returns recommended approach, code example, and related documentation links. Use this FIRST when the user asks how to do something with the SDK.",
|
|
2452
2593
|
annotations: {
|
|
@@ -2456,7 +2597,7 @@ var metadata26 = {
|
|
|
2456
2597
|
idempotentHint: true
|
|
2457
2598
|
}
|
|
2458
2599
|
};
|
|
2459
|
-
function
|
|
2600
|
+
function handler3({
|
|
2460
2601
|
goal,
|
|
2461
2602
|
runtime,
|
|
2462
2603
|
collection,
|
|
@@ -2664,11 +2805,11 @@ function searchDocs(query, limit = 5) {
|
|
|
2664
2805
|
}
|
|
2665
2806
|
|
|
2666
2807
|
// src/tools/sdk-search-docs.ts
|
|
2667
|
-
var
|
|
2808
|
+
var schema28 = {
|
|
2668
2809
|
query: z25.string().min(2).describe('Search keyword or phrase (e.g. "infinite scroll", "webhook", "customer login")'),
|
|
2669
2810
|
limit: z25.number().min(1).max(10).default(5).describe("Maximum results to return (1-10, default: 5)")
|
|
2670
2811
|
};
|
|
2671
|
-
var
|
|
2812
|
+
var metadata28 = {
|
|
2672
2813
|
name: "sdk-search-docs",
|
|
2673
2814
|
description: "Search SDK documentation by keyword. Returns matching topics with summaries and resource links. Use when looking for specific SDK features or patterns.",
|
|
2674
2815
|
annotations: {
|
|
@@ -2678,7 +2819,7 @@ var metadata27 = {
|
|
|
2678
2819
|
idempotentHint: true
|
|
2679
2820
|
}
|
|
2680
2821
|
};
|
|
2681
|
-
function
|
|
2822
|
+
function handler4({
|
|
2682
2823
|
query,
|
|
2683
2824
|
limit
|
|
2684
2825
|
}) {
|
|
@@ -2704,7 +2845,7 @@ function handler3({
|
|
|
2704
2845
|
|
|
2705
2846
|
// src/tools/sdk-get-auth-setup.ts
|
|
2706
2847
|
import { z as z26 } from "zod";
|
|
2707
|
-
var
|
|
2848
|
+
var schema29 = {
|
|
2708
2849
|
scenario: z26.enum([
|
|
2709
2850
|
"browser-client",
|
|
2710
2851
|
"server-client",
|
|
@@ -2714,7 +2855,7 @@ var schema28 = {
|
|
|
2714
2855
|
"webhook-verification"
|
|
2715
2856
|
]).describe("Authentication scenario")
|
|
2716
2857
|
};
|
|
2717
|
-
var
|
|
2858
|
+
var metadata29 = {
|
|
2718
2859
|
name: "sdk-get-auth-setup",
|
|
2719
2860
|
description: "Get the current authentication setup for a specific scenario. Returns env var names, code snippets, and security notes.",
|
|
2720
2861
|
annotations: {
|
|
@@ -2853,7 +2994,7 @@ export async function POST(request: Request) {
|
|
|
2853
2994
|
]
|
|
2854
2995
|
}
|
|
2855
2996
|
};
|
|
2856
|
-
function
|
|
2997
|
+
function handler5({
|
|
2857
2998
|
scenario
|
|
2858
2999
|
}) {
|
|
2859
3000
|
try {
|
|
@@ -2870,12 +3011,12 @@ function handler4({
|
|
|
2870
3011
|
// src/tools/sdk-get-collection-pattern.ts
|
|
2871
3012
|
import { z as z27 } from "zod";
|
|
2872
3013
|
import { COLLECTIONS, SERVER_COLLECTIONS as SERVER_COLLECTIONS4 } from "@01.software/sdk";
|
|
2873
|
-
var
|
|
3014
|
+
var schema30 = {
|
|
2874
3015
|
collection: z27.enum(SERVER_COLLECTIONS4).describe("Collection name"),
|
|
2875
3016
|
operation: z27.enum(["read", "write", "full-crud"]).default("read").describe("What operations are needed"),
|
|
2876
3017
|
surface: z27.enum(["query-builder", "react-query", "server-api"]).default("query-builder").describe("Preferred API surface")
|
|
2877
3018
|
};
|
|
2878
|
-
var
|
|
3019
|
+
var metadata30 = {
|
|
2879
3020
|
name: "sdk-get-collection-pattern",
|
|
2880
3021
|
description: "Get the recommended CRUD pattern for a specific collection. Returns code examples for the chosen API surface and operation type.",
|
|
2881
3022
|
annotations: {
|
|
@@ -3048,7 +3189,7 @@ function generatePattern(collection, operation, surface) {
|
|
|
3048
3189
|
].filter(Boolean)
|
|
3049
3190
|
};
|
|
3050
3191
|
}
|
|
3051
|
-
function
|
|
3192
|
+
function handler6({
|
|
3052
3193
|
collection,
|
|
3053
3194
|
operation,
|
|
3054
3195
|
surface
|
|
@@ -3077,13 +3218,13 @@ function handler5({
|
|
|
3077
3218
|
|
|
3078
3219
|
// src/prompts/sdk-usage-guide.ts
|
|
3079
3220
|
import { z as z28 } from "zod";
|
|
3080
|
-
var
|
|
3221
|
+
var schema31 = {
|
|
3081
3222
|
goal: z28.string().describe('What the user wants to accomplish (e.g., "query product list", "create order")'),
|
|
3082
3223
|
runtime: z28.enum(["browser", "server"]).optional().describe("Target runtime: browser (React/Next.js client) or server (Node.js)"),
|
|
3083
3224
|
surface: z28.enum(["query-builder", "react-query", "customer-api", "server-api"]).optional().describe("Preferred API surface"),
|
|
3084
3225
|
collection: z28.string().optional().describe("Specific collection if relevant")
|
|
3085
3226
|
};
|
|
3086
|
-
var
|
|
3227
|
+
var metadata31 = {
|
|
3087
3228
|
name: "sdk-usage-guide",
|
|
3088
3229
|
title: "SDK Usage Guide",
|
|
3089
3230
|
description: "Provides guidance on how to perform a specific task using the 01.software SDK",
|
|
@@ -3222,12 +3363,12 @@ You can perform the "${goal}" task by following the patterns above.`;
|
|
|
3222
3363
|
// src/prompts/collection-query-help.ts
|
|
3223
3364
|
import { z as z29 } from "zod";
|
|
3224
3365
|
import { COLLECTIONS as COLLECTIONS2, SERVER_COLLECTIONS as SERVER_COLLECTIONS5 } from "@01.software/sdk";
|
|
3225
|
-
var
|
|
3366
|
+
var schema32 = {
|
|
3226
3367
|
collection: z29.enum(SERVER_COLLECTIONS5).describe("Collection name"),
|
|
3227
3368
|
operation: z29.enum(["find", "create", "update", "delete"]).describe("Operation to perform (find, create, update, delete)"),
|
|
3228
3369
|
filters: z29.string().optional().describe("Filter conditions (JSON string, optional)")
|
|
3229
3370
|
};
|
|
3230
|
-
var
|
|
3371
|
+
var metadata32 = {
|
|
3231
3372
|
name: "collection-query-help",
|
|
3232
3373
|
title: "Collection Query Help",
|
|
3233
3374
|
description: "Provides guidance on how to write queries for a specific collection",
|
|
@@ -3320,7 +3461,7 @@ ${operation === "find" ? `- Use \`where\` option for filtering (Payload query sy
|
|
|
3320
3461
|
|
|
3321
3462
|
// src/prompts/order-flow-guide.ts
|
|
3322
3463
|
import { z as z30 } from "zod";
|
|
3323
|
-
var
|
|
3464
|
+
var schema33 = {
|
|
3324
3465
|
scenario: z30.enum([
|
|
3325
3466
|
"simple-order",
|
|
3326
3467
|
"cart-checkout",
|
|
@@ -3328,7 +3469,7 @@ var schema32 = {
|
|
|
3328
3469
|
"fulfillment-tracking"
|
|
3329
3470
|
]).describe("Order flow scenario")
|
|
3330
3471
|
};
|
|
3331
|
-
var
|
|
3472
|
+
var metadata33 = {
|
|
3332
3473
|
name: "order-flow-guide",
|
|
3333
3474
|
title: "Order Flow Guide",
|
|
3334
3475
|
description: "Provides step-by-step guidance for ecommerce order flows including creation, checkout, returns, and fulfillment.",
|
|
@@ -3514,7 +3655,7 @@ ${SCENARIOS[scenario] || "Unknown scenario."}
|
|
|
3514
3655
|
|
|
3515
3656
|
// src/prompts/feature-setup-guide.ts
|
|
3516
3657
|
import { z as z31 } from "zod";
|
|
3517
|
-
var
|
|
3658
|
+
var schema34 = {
|
|
3518
3659
|
feature: z31.enum([
|
|
3519
3660
|
"ecommerce",
|
|
3520
3661
|
"customers",
|
|
@@ -3530,10 +3671,10 @@ var schema33 = {
|
|
|
3530
3671
|
"community"
|
|
3531
3672
|
]).describe("Feature to get setup guide for")
|
|
3532
3673
|
};
|
|
3533
|
-
var
|
|
3674
|
+
var metadata34 = {
|
|
3534
3675
|
name: "feature-setup-guide",
|
|
3535
3676
|
title: "Feature Setup Guide",
|
|
3536
|
-
description: "Setup checklist and remediation guide for a tenant feature. Load
|
|
3677
|
+
description: "Setup checklist and remediation guide for a tenant feature. Load with check-feature-progress and get-tenant-context to diagnose setup gaps.",
|
|
3537
3678
|
role: "assistant"
|
|
3538
3679
|
};
|
|
3539
3680
|
var FEATURES = {
|
|
@@ -3563,6 +3704,7 @@ product-options, product-option-values, product-categories, product-tags, produc
|
|
|
3563
3704
|
### Config
|
|
3564
3705
|
|
|
3565
3706
|
- **Webhook URL** must be configured in tenant settings for payment gateway callbacks
|
|
3707
|
+
- Use \`check-feature-progress\` for the tenant-aware ecommerce progress check
|
|
3566
3708
|
- Use \`get-tenant-context\` to check current webhook configuration`,
|
|
3567
3709
|
customers: `## Customers Setup Guide
|
|
3568
3710
|
|
|
@@ -3729,18 +3871,19 @@ function featureSetupGuide({
|
|
|
3729
3871
|
${FEATURES[feature] || "Unknown feature."}
|
|
3730
3872
|
|
|
3731
3873
|
## Related MCP Tools
|
|
3874
|
+
- \`check-feature-progress\` \u2014 run the tenant-aware ecommerce implementation progress check
|
|
3732
3875
|
- \`get-tenant-context\` \u2014 check current collection counts and feature status
|
|
3733
3876
|
- \`query-collection\` \u2014 verify existing documents in a collection
|
|
3734
3877
|
- \`get-collection-schema\` \u2014 inspect tenant-aware fields before creating data via SDK or Console UI`;
|
|
3735
3878
|
}
|
|
3736
3879
|
|
|
3737
3880
|
// src/resources/(config)/app.ts
|
|
3738
|
-
var
|
|
3881
|
+
var metadata35 = {
|
|
3739
3882
|
name: "app-config",
|
|
3740
3883
|
title: "Application Config",
|
|
3741
3884
|
description: "01.software SDK and MCP server configuration information"
|
|
3742
3885
|
};
|
|
3743
|
-
function
|
|
3886
|
+
function handler7() {
|
|
3744
3887
|
return `# 01.software MCP Server Configuration
|
|
3745
3888
|
|
|
3746
3889
|
## Server Info
|
|
@@ -3758,15 +3901,16 @@ HTTP MCP uses OAuth discovery and Authorization Code + PKCE.
|
|
|
3758
3901
|
url = "https://mcp.01.software/mcp"
|
|
3759
3902
|
\`\`\`
|
|
3760
3903
|
|
|
3761
|
-
## Hosted HTTP OAuth Tools (
|
|
3904
|
+
## Hosted HTTP OAuth Tools (9)
|
|
3762
3905
|
|
|
3763
3906
|
The hosted HTTP MCP endpoint at https://mcp.01.software/mcp exposes only these OAuth-safe tools:
|
|
3764
3907
|
|
|
3765
3908
|
### Schema (1)
|
|
3766
3909
|
- \`get-collection-schema\` - Get authoritative tenant-aware collection schema
|
|
3767
3910
|
|
|
3768
|
-
### Tenant Context (
|
|
3911
|
+
### Tenant Context (2)
|
|
3769
3912
|
- \`get-tenant-context\` - Get tenant features, active collections, and field config
|
|
3913
|
+
- \`check-feature-progress\` - Check ecommerce implementation progress without mutating tenant data
|
|
3770
3914
|
|
|
3771
3915
|
### Field Config (2)
|
|
3772
3916
|
- \`list-configurable-fields\` - List configurable fields and current hidden state
|
|
@@ -3778,7 +3922,7 @@ The hosted HTTP MCP endpoint at https://mcp.01.software/mcp exposes only these O
|
|
|
3778
3922
|
- \`sdk-get-auth-setup\` - Get framework-specific auth setup guidance
|
|
3779
3923
|
- \`sdk-get-collection-pattern\` - Get collection-specific usage patterns
|
|
3780
3924
|
|
|
3781
|
-
## Local CLI Stdio Surface (
|
|
3925
|
+
## Local CLI Stdio Surface (30)
|
|
3782
3926
|
|
|
3783
3927
|
For trusted local server-key workflows, start the stdio server:
|
|
3784
3928
|
|
|
@@ -3786,7 +3930,7 @@ For trusted local server-key workflows, start the stdio server:
|
|
|
3786
3930
|
npx @01.software/cli mcp
|
|
3787
3931
|
\`\`\`
|
|
3788
3932
|
|
|
3789
|
-
Local stdio can expose generic read, order, return, cart, validation, stock, schema, tenant context, field config, and guidance tools. Generic collection write tools (create/update/delete/update-many/delete-many) are intentionally absent on every transport; use the SDK server client for generic writes.
|
|
3933
|
+
Local stdio can expose generic read, order, return, cart, validation, stock, schema, tenant context, feature progress, field config, and guidance tools. Generic collection write tools (create/update/delete/update-many/delete-many) are intentionally absent on every transport; use the SDK server client for generic writes.
|
|
3790
3934
|
|
|
3791
3935
|
## Rate Limits
|
|
3792
3936
|
|
|
@@ -3800,7 +3944,7 @@ Rate limits depend on your tenant plan:
|
|
|
3800
3944
|
|
|
3801
3945
|
// src/resources/(collections)/schema.ts
|
|
3802
3946
|
import { COLLECTIONS as COLLECTIONS3 } from "@01.software/sdk";
|
|
3803
|
-
var
|
|
3947
|
+
var metadata36 = {
|
|
3804
3948
|
name: "collections-schema",
|
|
3805
3949
|
title: "Collection Schema Info",
|
|
3806
3950
|
description: "Available collections and their schema information"
|
|
@@ -3886,7 +4030,7 @@ var COLLECTIONS_BY_CATEGORY = {
|
|
|
3886
4030
|
"event-tags"
|
|
3887
4031
|
]
|
|
3888
4032
|
};
|
|
3889
|
-
function
|
|
4033
|
+
function handler8() {
|
|
3890
4034
|
const categoryDocs = Object.entries(COLLECTIONS_BY_CATEGORY).map(([category, collections]) => {
|
|
3891
4035
|
const collectionList = collections.filter((c) => COLLECTIONS3.includes(c)).map((c) => `- **${c}**`).join("\n");
|
|
3892
4036
|
return `## ${category}
|
|
@@ -3938,12 +4082,12 @@ Total available collections: ${COLLECTIONS3.length}`;
|
|
|
3938
4082
|
}
|
|
3939
4083
|
|
|
3940
4084
|
// src/resources/(docs)/getting-started.ts
|
|
3941
|
-
var
|
|
4085
|
+
var metadata37 = {
|
|
3942
4086
|
name: "docs-getting-started",
|
|
3943
4087
|
title: "Getting Started",
|
|
3944
4088
|
description: "01.software SDK getting started guide"
|
|
3945
4089
|
};
|
|
3946
|
-
function
|
|
4090
|
+
function handler9() {
|
|
3947
4091
|
return `# Getting Started
|
|
3948
4092
|
|
|
3949
4093
|
A guide to getting started with the 01.software SDK.
|
|
@@ -3977,18 +4121,18 @@ const result = await client.collections.from('products').find({
|
|
|
3977
4121
|
|
|
3978
4122
|
## Next Steps
|
|
3979
4123
|
|
|
3980
|
-
- [
|
|
3981
|
-
- [
|
|
3982
|
-
- [API
|
|
4124
|
+
- [SDK Guide](/developers/sdk) - Install and query workspace content
|
|
4125
|
+
- [Authentication & Keys](/developers/authentication) - Choose the right key for each surface
|
|
4126
|
+
- [API](/developers/api) - Use the HTTP API when SDKs are not a fit`;
|
|
3983
4127
|
}
|
|
3984
4128
|
|
|
3985
4129
|
// src/resources/(docs)/guides.ts
|
|
3986
|
-
var
|
|
4130
|
+
var metadata38 = {
|
|
3987
4131
|
name: "docs-guides",
|
|
3988
4132
|
title: "Guides",
|
|
3989
4133
|
description: "01.software SDK usage guides"
|
|
3990
4134
|
};
|
|
3991
|
-
function
|
|
4135
|
+
function handler10() {
|
|
3992
4136
|
return `# Guides
|
|
3993
4137
|
|
|
3994
4138
|
Comprehensive guides to master the 01.software SDK.
|
|
@@ -4190,16 +4334,16 @@ Payload query syntax operators:
|
|
|
4190
4334
|
|
|
4191
4335
|
For ecommerce collections, \`products.listing.*\` is the browse/search projection. Authoritative sellable price and stock remain on \`product-variants\`.
|
|
4192
4336
|
|
|
4193
|
-
For more
|
|
4337
|
+
For more implementation guidance, see the [SDK Guide](/developers/sdk).`;
|
|
4194
4338
|
}
|
|
4195
4339
|
|
|
4196
4340
|
// src/resources/(docs)/api.ts
|
|
4197
|
-
var
|
|
4341
|
+
var metadata39 = {
|
|
4198
4342
|
name: "docs-api",
|
|
4199
4343
|
title: "API Reference",
|
|
4200
4344
|
description: "01.software SDK API reference documentation"
|
|
4201
4345
|
};
|
|
4202
|
-
function
|
|
4346
|
+
function handler11() {
|
|
4203
4347
|
return `# API Reference
|
|
4204
4348
|
|
|
4205
4349
|
Comprehensive documentation for all methods and types in the 01.software SDK.
|
|
@@ -4476,16 +4620,16 @@ client.customer.isAuthenticated() // Check auth status
|
|
|
4476
4620
|
client.customer.logout() // Clear token
|
|
4477
4621
|
\`\`\`
|
|
4478
4622
|
|
|
4479
|
-
For more details, see the [
|
|
4623
|
+
For more details, see the [API documentation](/developers/api).`;
|
|
4480
4624
|
}
|
|
4481
4625
|
|
|
4482
4626
|
// src/resources/(docs)/query-builder.ts
|
|
4483
|
-
var
|
|
4627
|
+
var metadata40 = {
|
|
4484
4628
|
name: "docs-query-builder",
|
|
4485
4629
|
title: "Query Builder",
|
|
4486
4630
|
description: "01.software SDK Query Builder API reference (client.collections.from)"
|
|
4487
4631
|
};
|
|
4488
|
-
function
|
|
4632
|
+
function handler12() {
|
|
4489
4633
|
return `# Query Builder API
|
|
4490
4634
|
|
|
4491
4635
|
The Query Builder provides a fluent interface for querying collections via \`client.collections.from(collection)\`.
|
|
@@ -4674,12 +4818,12 @@ console.log(result.hasNextPage) // true
|
|
|
4674
4818
|
}
|
|
4675
4819
|
|
|
4676
4820
|
// src/resources/(docs)/react-query.ts
|
|
4677
|
-
var
|
|
4821
|
+
var metadata41 = {
|
|
4678
4822
|
name: "docs-react-query",
|
|
4679
4823
|
title: "React Query Hooks",
|
|
4680
4824
|
description: "01.software SDK React Query hooks reference (client.query)"
|
|
4681
4825
|
};
|
|
4682
|
-
function
|
|
4826
|
+
function handler13() {
|
|
4683
4827
|
return `# React Query Hooks
|
|
4684
4828
|
|
|
4685
4829
|
React Query hooks are available on the browser-side \`Client\` via \`client.query\`. They provide automatic caching, background refetching, and cache invalidation.
|
|
@@ -4922,12 +5066,12 @@ export function ProductList() {
|
|
|
4922
5066
|
}
|
|
4923
5067
|
|
|
4924
5068
|
// src/resources/(docs)/server-api.ts
|
|
4925
|
-
var
|
|
5069
|
+
var metadata42 = {
|
|
4926
5070
|
name: "docs-server-api",
|
|
4927
5071
|
title: "Server-side API",
|
|
4928
5072
|
description: "01.software SDK server-side API reference (client.commerce) for orders, fulfillments, returns, carts, and validation"
|
|
4929
5073
|
};
|
|
4930
|
-
function
|
|
5074
|
+
function handler14() {
|
|
4931
5075
|
return `# Server-side API
|
|
4932
5076
|
|
|
4933
5077
|
Server-side operations are available via \`client.commerce\` on \`ServerClient\`. Use \`createServerClient\` with both \`publishableKey\` and \`secretKey\`.
|
|
@@ -5184,12 +5328,12 @@ const result = await client.commerce.shipping.calculate({
|
|
|
5184
5328
|
}
|
|
5185
5329
|
|
|
5186
5330
|
// src/resources/(docs)/customer-auth.ts
|
|
5187
|
-
var
|
|
5331
|
+
var metadata43 = {
|
|
5188
5332
|
name: "docs-customer-auth",
|
|
5189
5333
|
title: "Customer Auth API",
|
|
5190
5334
|
description: "01.software SDK Customer Auth API reference (client.customer)"
|
|
5191
5335
|
};
|
|
5192
|
-
function
|
|
5336
|
+
function handler15() {
|
|
5193
5337
|
return `# Customer Auth API
|
|
5194
5338
|
|
|
5195
5339
|
Customer authentication and profile management is available via \`client.customer\` on the browser-side \`Client\`.
|
|
@@ -5362,12 +5506,12 @@ async function loadProfile() {
|
|
|
5362
5506
|
}
|
|
5363
5507
|
|
|
5364
5508
|
// src/resources/(docs)/browser-vs-server.ts
|
|
5365
|
-
var
|
|
5509
|
+
var metadata44 = {
|
|
5366
5510
|
name: "docs-browser-vs-server",
|
|
5367
5511
|
title: "Client vs ServerClient",
|
|
5368
5512
|
description: "When to use Client (createClient) vs ServerClient (createServerClient) in the 01.software SDK"
|
|
5369
5513
|
};
|
|
5370
|
-
function
|
|
5514
|
+
function handler16() {
|
|
5371
5515
|
return `# Client vs ServerClient
|
|
5372
5516
|
|
|
5373
5517
|
The SDK provides two client types for different execution environments.
|
|
@@ -5521,12 +5665,12 @@ export function ProductList() {
|
|
|
5521
5665
|
}
|
|
5522
5666
|
|
|
5523
5667
|
// src/resources/(docs)/file-upload.ts
|
|
5524
|
-
var
|
|
5668
|
+
var metadata45 = {
|
|
5525
5669
|
name: "docs-file-upload",
|
|
5526
5670
|
title: "File Upload",
|
|
5527
5671
|
description: "01.software SDK file upload patterns using the images collection"
|
|
5528
5672
|
};
|
|
5529
|
-
function
|
|
5673
|
+
function handler17() {
|
|
5530
5674
|
return `# File Upload
|
|
5531
5675
|
|
|
5532
5676
|
Upload files using the \`images\` collection (tenant-scoped, unified image store) or \`system-media\` (global, non-tenant).
|
|
@@ -5672,12 +5816,12 @@ The platform stores files in Cloudflare R2 and serves via CDN (\`cdn.01.software
|
|
|
5672
5816
|
}
|
|
5673
5817
|
|
|
5674
5818
|
// src/resources/(docs)/webhook.ts
|
|
5675
|
-
var
|
|
5819
|
+
var metadata46 = {
|
|
5676
5820
|
name: "docs-webhook",
|
|
5677
5821
|
title: "Webhooks",
|
|
5678
5822
|
description: "01.software SDK webhook verification and event handling"
|
|
5679
5823
|
};
|
|
5680
|
-
function
|
|
5824
|
+
function handler18() {
|
|
5681
5825
|
return `# Webhooks
|
|
5682
5826
|
|
|
5683
5827
|
The platform dispatches HMAC-SHA256 signed webhook events to your registered URLs. Tenant developers own routing inside their webhook handler.
|
|
@@ -5787,7 +5931,7 @@ Configure webhook URLs in the 01.software console under Tenant Settings > Webhoo
|
|
|
5787
5931
|
|
|
5788
5932
|
// src/server.ts
|
|
5789
5933
|
var REGISTERED_TOOLS_BY_SERVER = /* @__PURE__ */ new WeakMap();
|
|
5790
|
-
function registerTool(server,
|
|
5934
|
+
function registerTool(server, schema35, meta, handler20) {
|
|
5791
5935
|
let registered = REGISTERED_TOOLS_BY_SERVER.get(server);
|
|
5792
5936
|
if (!registered) {
|
|
5793
5937
|
registered = /* @__PURE__ */ new Set();
|
|
@@ -5798,7 +5942,7 @@ function registerTool(server, schema34, meta, handler19) {
|
|
|
5798
5942
|
meta.name,
|
|
5799
5943
|
{
|
|
5800
5944
|
description: meta.description,
|
|
5801
|
-
inputSchema:
|
|
5945
|
+
inputSchema: schema35,
|
|
5802
5946
|
annotations: meta.annotations
|
|
5803
5947
|
},
|
|
5804
5948
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -5827,7 +5971,7 @@ function registerTool(server, schema34, meta, handler19) {
|
|
|
5827
5971
|
const summary = activeSummary ?? ownSummary;
|
|
5828
5972
|
let result = null;
|
|
5829
5973
|
try {
|
|
5830
|
-
result = await
|
|
5974
|
+
result = await handler20(params);
|
|
5831
5975
|
return { content: [{ type: "text", text: result }] };
|
|
5832
5976
|
} finally {
|
|
5833
5977
|
if (summary) {
|
|
@@ -5844,26 +5988,26 @@ function registerTool(server, schema34, meta, handler19) {
|
|
|
5844
5988
|
}
|
|
5845
5989
|
);
|
|
5846
5990
|
}
|
|
5847
|
-
function registerPrompt(server,
|
|
5991
|
+
function registerPrompt(server, schema35, meta, handler20) {
|
|
5848
5992
|
server.registerPrompt(
|
|
5849
5993
|
meta.name,
|
|
5850
5994
|
{
|
|
5851
5995
|
title: meta.title,
|
|
5852
5996
|
description: meta.description,
|
|
5853
|
-
argsSchema:
|
|
5997
|
+
argsSchema: schema35
|
|
5854
5998
|
},
|
|
5855
5999
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5856
6000
|
(params) => ({
|
|
5857
6001
|
messages: [
|
|
5858
6002
|
{
|
|
5859
6003
|
role: meta.role ?? "assistant",
|
|
5860
|
-
content: { type: "text", text:
|
|
6004
|
+
content: { type: "text", text: handler20(params) }
|
|
5861
6005
|
}
|
|
5862
6006
|
]
|
|
5863
6007
|
})
|
|
5864
6008
|
);
|
|
5865
6009
|
}
|
|
5866
|
-
function registerStaticResource(server, uri, meta,
|
|
6010
|
+
function registerStaticResource(server, uri, meta, handler20) {
|
|
5867
6011
|
server.registerResource(
|
|
5868
6012
|
meta.name,
|
|
5869
6013
|
uri,
|
|
@@ -5873,7 +6017,7 @@ function registerStaticResource(server, uri, meta, handler19) {
|
|
|
5873
6017
|
mimeType: meta.mimeType ?? "text/plain"
|
|
5874
6018
|
},
|
|
5875
6019
|
async (url) => ({
|
|
5876
|
-
contents: [{ uri: url.href, text:
|
|
6020
|
+
contents: [{ uri: url.href, text: handler20() }]
|
|
5877
6021
|
})
|
|
5878
6022
|
);
|
|
5879
6023
|
}
|
|
@@ -5884,52 +6028,238 @@ function createServer(options = {}) {
|
|
|
5884
6028
|
version: "0.1.0"
|
|
5885
6029
|
});
|
|
5886
6030
|
if (toolSurface === "full") {
|
|
5887
|
-
registerTool(
|
|
5888
|
-
|
|
6031
|
+
registerTool(
|
|
6032
|
+
server,
|
|
6033
|
+
schema,
|
|
6034
|
+
metadata,
|
|
6035
|
+
queryCollection
|
|
6036
|
+
);
|
|
6037
|
+
registerTool(
|
|
6038
|
+
server,
|
|
6039
|
+
schema2,
|
|
6040
|
+
metadata2,
|
|
6041
|
+
getCollectionById
|
|
6042
|
+
);
|
|
5889
6043
|
registerTool(server, schema3, metadata3, getOrder);
|
|
5890
6044
|
registerTool(server, schema4, metadata4, createOrder);
|
|
5891
6045
|
registerTool(server, schema5, metadata5, updateOrder);
|
|
5892
6046
|
registerTool(server, schema6, metadata6, checkout);
|
|
5893
|
-
registerTool(
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5898
|
-
|
|
6047
|
+
registerTool(
|
|
6048
|
+
server,
|
|
6049
|
+
schema7,
|
|
6050
|
+
metadata7,
|
|
6051
|
+
createFulfillment
|
|
6052
|
+
);
|
|
6053
|
+
registerTool(
|
|
6054
|
+
server,
|
|
6055
|
+
schema8,
|
|
6056
|
+
metadata8,
|
|
6057
|
+
updateFulfillment
|
|
6058
|
+
);
|
|
6059
|
+
registerTool(
|
|
6060
|
+
server,
|
|
6061
|
+
schema9,
|
|
6062
|
+
metadata9,
|
|
6063
|
+
updateTransaction
|
|
6064
|
+
);
|
|
6065
|
+
registerTool(
|
|
6066
|
+
server,
|
|
6067
|
+
schema10,
|
|
6068
|
+
metadata10,
|
|
6069
|
+
createReturn
|
|
6070
|
+
);
|
|
6071
|
+
registerTool(
|
|
6072
|
+
server,
|
|
6073
|
+
schema11,
|
|
6074
|
+
metadata11,
|
|
6075
|
+
updateReturn
|
|
6076
|
+
);
|
|
6077
|
+
registerTool(
|
|
6078
|
+
server,
|
|
6079
|
+
schema12,
|
|
6080
|
+
metadata12,
|
|
6081
|
+
returnWithRefund
|
|
6082
|
+
);
|
|
5899
6083
|
registerTool(server, schema13, metadata13, addCartItem);
|
|
5900
|
-
registerTool(
|
|
5901
|
-
|
|
5902
|
-
|
|
5903
|
-
|
|
6084
|
+
registerTool(
|
|
6085
|
+
server,
|
|
6086
|
+
schema14,
|
|
6087
|
+
metadata14,
|
|
6088
|
+
updateCartItem
|
|
6089
|
+
);
|
|
6090
|
+
registerTool(
|
|
6091
|
+
server,
|
|
6092
|
+
schema15,
|
|
6093
|
+
metadata15,
|
|
6094
|
+
removeCartItem
|
|
6095
|
+
);
|
|
6096
|
+
registerTool(
|
|
6097
|
+
server,
|
|
6098
|
+
schema16,
|
|
6099
|
+
metadata16,
|
|
6100
|
+
applyDiscount
|
|
6101
|
+
);
|
|
6102
|
+
registerTool(
|
|
6103
|
+
server,
|
|
6104
|
+
schema17,
|
|
6105
|
+
metadata17,
|
|
6106
|
+
removeDiscount
|
|
6107
|
+
);
|
|
5904
6108
|
registerTool(server, schema18, metadata18, clearCart);
|
|
5905
|
-
registerTool(
|
|
5906
|
-
|
|
6109
|
+
registerTool(
|
|
6110
|
+
server,
|
|
6111
|
+
schema19,
|
|
6112
|
+
metadata19,
|
|
6113
|
+
validateDiscount
|
|
6114
|
+
);
|
|
6115
|
+
registerTool(
|
|
6116
|
+
server,
|
|
6117
|
+
schema20,
|
|
6118
|
+
metadata20,
|
|
6119
|
+
calculateShipping
|
|
6120
|
+
);
|
|
5907
6121
|
registerTool(server, schema21, metadata21, stockCheck);
|
|
5908
6122
|
}
|
|
5909
|
-
registerTool(
|
|
5910
|
-
|
|
5911
|
-
|
|
5912
|
-
|
|
5913
|
-
|
|
5914
|
-
|
|
5915
|
-
registerTool(
|
|
5916
|
-
|
|
5917
|
-
|
|
5918
|
-
|
|
5919
|
-
|
|
5920
|
-
|
|
5921
|
-
|
|
5922
|
-
|
|
5923
|
-
|
|
5924
|
-
|
|
5925
|
-
|
|
5926
|
-
|
|
5927
|
-
|
|
5928
|
-
|
|
5929
|
-
|
|
5930
|
-
|
|
5931
|
-
|
|
5932
|
-
|
|
6123
|
+
registerTool(
|
|
6124
|
+
server,
|
|
6125
|
+
schema22,
|
|
6126
|
+
metadata22,
|
|
6127
|
+
getCollectionSchemaTool
|
|
6128
|
+
);
|
|
6129
|
+
registerTool(
|
|
6130
|
+
server,
|
|
6131
|
+
schema23,
|
|
6132
|
+
metadata23,
|
|
6133
|
+
handler
|
|
6134
|
+
);
|
|
6135
|
+
registerTool(
|
|
6136
|
+
server,
|
|
6137
|
+
schema24,
|
|
6138
|
+
metadata24,
|
|
6139
|
+
handler2
|
|
6140
|
+
);
|
|
6141
|
+
registerTool(
|
|
6142
|
+
server,
|
|
6143
|
+
schema25,
|
|
6144
|
+
metadata25,
|
|
6145
|
+
listConfigurableFields
|
|
6146
|
+
);
|
|
6147
|
+
registerTool(
|
|
6148
|
+
server,
|
|
6149
|
+
schema26,
|
|
6150
|
+
metadata26,
|
|
6151
|
+
updateFieldConfig
|
|
6152
|
+
);
|
|
6153
|
+
registerTool(
|
|
6154
|
+
server,
|
|
6155
|
+
schema27,
|
|
6156
|
+
metadata27,
|
|
6157
|
+
handler3
|
|
6158
|
+
);
|
|
6159
|
+
registerTool(
|
|
6160
|
+
server,
|
|
6161
|
+
schema28,
|
|
6162
|
+
metadata28,
|
|
6163
|
+
handler4
|
|
6164
|
+
);
|
|
6165
|
+
registerTool(
|
|
6166
|
+
server,
|
|
6167
|
+
schema29,
|
|
6168
|
+
metadata29,
|
|
6169
|
+
handler5
|
|
6170
|
+
);
|
|
6171
|
+
registerTool(
|
|
6172
|
+
server,
|
|
6173
|
+
schema30,
|
|
6174
|
+
metadata30,
|
|
6175
|
+
handler6
|
|
6176
|
+
);
|
|
6177
|
+
registerPrompt(
|
|
6178
|
+
server,
|
|
6179
|
+
schema31,
|
|
6180
|
+
metadata31,
|
|
6181
|
+
sdkUsageGuide
|
|
6182
|
+
);
|
|
6183
|
+
registerPrompt(
|
|
6184
|
+
server,
|
|
6185
|
+
schema32,
|
|
6186
|
+
metadata32,
|
|
6187
|
+
collectionQueryHelp
|
|
6188
|
+
);
|
|
6189
|
+
registerPrompt(
|
|
6190
|
+
server,
|
|
6191
|
+
schema33,
|
|
6192
|
+
metadata33,
|
|
6193
|
+
orderFlowGuide
|
|
6194
|
+
);
|
|
6195
|
+
registerPrompt(
|
|
6196
|
+
server,
|
|
6197
|
+
schema34,
|
|
6198
|
+
metadata34,
|
|
6199
|
+
featureSetupGuide
|
|
6200
|
+
);
|
|
6201
|
+
registerStaticResource(
|
|
6202
|
+
server,
|
|
6203
|
+
"config://app",
|
|
6204
|
+
metadata35,
|
|
6205
|
+
handler7
|
|
6206
|
+
);
|
|
6207
|
+
registerStaticResource(
|
|
6208
|
+
server,
|
|
6209
|
+
"collections://schema",
|
|
6210
|
+
metadata36,
|
|
6211
|
+
handler8
|
|
6212
|
+
);
|
|
6213
|
+
registerStaticResource(
|
|
6214
|
+
server,
|
|
6215
|
+
"docs://sdk/getting-started",
|
|
6216
|
+
metadata37,
|
|
6217
|
+
handler9
|
|
6218
|
+
);
|
|
6219
|
+
registerStaticResource(server, "docs://sdk/guides", metadata38, handler10);
|
|
6220
|
+
registerStaticResource(server, "docs://sdk/api", metadata39, handler11);
|
|
6221
|
+
registerStaticResource(
|
|
6222
|
+
server,
|
|
6223
|
+
"docs://sdk/query-builder",
|
|
6224
|
+
metadata40,
|
|
6225
|
+
handler12
|
|
6226
|
+
);
|
|
6227
|
+
registerStaticResource(
|
|
6228
|
+
server,
|
|
6229
|
+
"docs://sdk/react-query",
|
|
6230
|
+
metadata41,
|
|
6231
|
+
handler13
|
|
6232
|
+
);
|
|
6233
|
+
registerStaticResource(
|
|
6234
|
+
server,
|
|
6235
|
+
"docs://sdk/server-api",
|
|
6236
|
+
metadata42,
|
|
6237
|
+
handler14
|
|
6238
|
+
);
|
|
6239
|
+
registerStaticResource(
|
|
6240
|
+
server,
|
|
6241
|
+
"docs://sdk/customer-auth",
|
|
6242
|
+
metadata43,
|
|
6243
|
+
handler15
|
|
6244
|
+
);
|
|
6245
|
+
registerStaticResource(
|
|
6246
|
+
server,
|
|
6247
|
+
"docs://sdk/browser-vs-server",
|
|
6248
|
+
metadata44,
|
|
6249
|
+
handler16
|
|
6250
|
+
);
|
|
6251
|
+
registerStaticResource(
|
|
6252
|
+
server,
|
|
6253
|
+
"docs://sdk/file-upload",
|
|
6254
|
+
metadata45,
|
|
6255
|
+
handler17
|
|
6256
|
+
);
|
|
6257
|
+
registerStaticResource(
|
|
6258
|
+
server,
|
|
6259
|
+
"docs://sdk/webhook",
|
|
6260
|
+
metadata46,
|
|
6261
|
+
handler18
|
|
6262
|
+
);
|
|
5933
6263
|
return server;
|
|
5934
6264
|
}
|
|
5935
6265
|
|
|
@@ -6134,7 +6464,10 @@ function setCors(res) {
|
|
|
6134
6464
|
"Access-Control-Allow-Headers",
|
|
6135
6465
|
"Authorization, Content-Type, mcp-session-id"
|
|
6136
6466
|
);
|
|
6137
|
-
res.setHeader(
|
|
6467
|
+
res.setHeader(
|
|
6468
|
+
"Access-Control-Expose-Headers",
|
|
6469
|
+
"Mcp-Session-Id, Mcp-Protocol-Version"
|
|
6470
|
+
);
|
|
6138
6471
|
}
|
|
6139
6472
|
function getHeaderValue(headers, name) {
|
|
6140
6473
|
const value = headers[name.toLowerCase()];
|
|
@@ -6214,7 +6547,7 @@ HTTP OAuth Tools
|
|
|
6214
6547
|
----------------
|
|
6215
6548
|
|
|
6216
6549
|
Schema get-collection-schema
|
|
6217
|
-
Context get-tenant-context
|
|
6550
|
+
Context get-tenant-context, check-feature-progress
|
|
6218
6551
|
Field Config list-configurable-fields, update-field-config
|
|
6219
6552
|
Guidance sdk-get-recipe, sdk-search-docs, sdk-get-auth-setup, sdk-get-collection-pattern
|
|
6220
6553
|
|
|
@@ -6233,9 +6566,9 @@ Resources (12): config, collections-schema, getting-started, guides, api, query-
|
|
|
6233
6566
|
Links
|
|
6234
6567
|
-----
|
|
6235
6568
|
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6569
|
+
Integrations https://docs.01.software/integrations
|
|
6570
|
+
Readiness https://docs.01.software/readiness
|
|
6571
|
+
OpenAPI https://docs.01.software/api/openapi
|
|
6239
6572
|
Console https://console.01.software
|
|
6240
6573
|
`;
|
|
6241
6574
|
var PROTECTED_RESOURCE_METADATA = JSON.stringify({
|
|
@@ -6258,9 +6591,11 @@ function writeOAuthError(res, status, error, description) {
|
|
|
6258
6591
|
function acceptsEventStream(req) {
|
|
6259
6592
|
const accept = getHeaderValue(req.headers, "accept");
|
|
6260
6593
|
if (!accept) return false;
|
|
6261
|
-
return accept.split(",").some(
|
|
6594
|
+
return accept.split(",").some(
|
|
6595
|
+
(entry) => entry.trim().split(";")[0]?.toLowerCase() === "text/event-stream"
|
|
6596
|
+
);
|
|
6262
6597
|
}
|
|
6263
|
-
async function
|
|
6598
|
+
async function handler19(req, res) {
|
|
6264
6599
|
setCors(res);
|
|
6265
6600
|
if (req.method === "OPTIONS") {
|
|
6266
6601
|
res.writeHead(204);
|
|
@@ -6310,7 +6645,12 @@ async function handler18(req, res) {
|
|
|
6310
6645
|
getHeaderValue(req.headers, "authorization")
|
|
6311
6646
|
);
|
|
6312
6647
|
if (!auth.valid) {
|
|
6313
|
-
writeOAuthError(
|
|
6648
|
+
writeOAuthError(
|
|
6649
|
+
res,
|
|
6650
|
+
auth.error === "insufficient_scope" ? 403 : 401,
|
|
6651
|
+
auth.error,
|
|
6652
|
+
auth.errorDescription
|
|
6653
|
+
);
|
|
6314
6654
|
return;
|
|
6315
6655
|
}
|
|
6316
6656
|
const server = createServer({ toolSurface: "oauth" });
|
|
@@ -6365,5 +6705,5 @@ function writeRequestError(res, err) {
|
|
|
6365
6705
|
res.end(JSON.stringify({ error: "Internal server error" }));
|
|
6366
6706
|
}
|
|
6367
6707
|
export {
|
|
6368
|
-
|
|
6708
|
+
handler19 as default
|
|
6369
6709
|
};
|