@apify/actors-mcp-server 0.11.7-beta.2 → 0.11.7-beta.3
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/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +50 -64
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool_call_error_mapper.d.ts +45 -0
- package/dist/mcp/tool_call_error_mapper.d.ts.map +1 -0
- package/dist/mcp/tool_call_error_mapper.js +59 -0
- package/dist/mcp/tool_call_error_mapper.js.map +1 -0
- package/dist/tools/actors/call_actor.d.ts +0 -3
- package/dist/tools/actors/call_actor.d.ts.map +1 -1
- package/dist/tools/actors/call_actor.js +2 -11
- package/dist/tools/actors/call_actor.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/payment_errors.d.ts +7 -1
- package/dist/utils/payment_errors.d.ts.map +1 -1
- package/dist/utils/payment_errors.js +10 -0
- package/dist/utils/payment_errors.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import { ApifyApiError } from 'apify-client';
|
|
1
2
|
import type { ApifyClient } from '../apify_client.js';
|
|
3
|
+
import { type ToolResponse } from './mcp.js';
|
|
2
4
|
/**
|
|
3
5
|
* True for a genuine x402 402 Payment Required. The concurrent-run limit also surfaces as
|
|
4
6
|
* 402 but is an account quota, not an x402 payment — excluded so callers fall through to
|
|
@@ -23,5 +25,9 @@ export declare function registerPaymentRequiredInterceptor(apifyClient: ApifyCli
|
|
|
23
25
|
* `structuredContent` (preferred) and `content[0].text` as JSON (fallback for clients
|
|
24
26
|
* that can't read structured content).
|
|
25
27
|
*/
|
|
26
|
-
export declare function buildPaymentRequiredResponse(errorOrMessage: unknown, precomputedPaymentData?: unknown):
|
|
28
|
+
export declare function buildPaymentRequiredResponse(errorOrMessage: unknown, precomputedPaymentData?: unknown): ToolResponse;
|
|
29
|
+
/** Text lines for a permission-approval response: the error message plus an optional approval URL. */
|
|
30
|
+
export declare function buildPermissionApprovalTexts(error: ApifyApiError): string[];
|
|
31
|
+
/** Exported for the shared tool-call error mapper (src/mcp/tool_call_error_mapper.ts) — no logging, no telemetry. */
|
|
32
|
+
export declare function buildPermissionApprovalResponse(error: ApifyApiError): ToolResponse;
|
|
27
33
|
//# sourceMappingURL=payment_errors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment_errors.d.ts","sourceRoot":"","sources":["../../src/utils/payment_errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"payment_errors.d.ts","sourceRoot":"","sources":["../../src/utils/payment_errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAI7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAItD,OAAO,EAA2B,KAAK,YAAY,EAAE,MAAM,UAAU,CAAC;AAItE;;;;GAIG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAElE;AAgCD;;;;;;;;GAQG;AACH,wBAAgB,kCAAkC,CAAC,WAAW,EAAE,WAAW,GAAG,IAAI,CAsBjF;AAyBD;;;;;;;GAOG;AACH,wBAAgB,4BAA4B,CAAC,cAAc,EAAE,OAAO,EAAE,sBAAsB,CAAC,EAAE,OAAO,gBASrG;AAED,sGAAsG;AACtG,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,CAG3E;AAED,qHAAqH;AACrH,wBAAgB,+BAA+B,CAAC,KAAK,EAAE,aAAa,GAAG,YAAY,CAElF"}
|
|
@@ -100,4 +100,14 @@ export function buildPaymentRequiredResponse(errorOrMessage, precomputedPaymentD
|
|
|
100
100
|
: [message];
|
|
101
101
|
return respondErrorNoTelemetry(texts, { structuredContent: paymentData });
|
|
102
102
|
}
|
|
103
|
+
/** Text lines for a permission-approval response: the error message plus an optional approval URL. */
|
|
104
|
+
export function buildPermissionApprovalTexts(error) {
|
|
105
|
+
var _a;
|
|
106
|
+
const approvalUrl = typeof ((_a = error.data) === null || _a === void 0 ? void 0 : _a.approvalUrl) === 'string' ? error.data.approvalUrl : undefined;
|
|
107
|
+
return [error.message, ...(approvalUrl ? [`Approve here: ${approvalUrl}`] : [])];
|
|
108
|
+
}
|
|
109
|
+
/** Exported for the shared tool-call error mapper (src/mcp/tool_call_error_mapper.ts) — no logging, no telemetry. */
|
|
110
|
+
export function buildPermissionApprovalResponse(error) {
|
|
111
|
+
return respondErrorNoTelemetry(buildPermissionApprovalTexts(error));
|
|
112
|
+
}
|
|
103
113
|
//# sourceMappingURL=payment_errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payment_errors.js","sourceRoot":"","sources":["../../src/utils/payment_errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,GAAG,MAAM,YAAY,CAAC;AAG7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,uBAAuB,
|
|
1
|
+
{"version":3,"file":"payment_errors.js","sourceRoot":"","sources":["../../src/utils/payment_errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,GAAG,MAAM,YAAY,CAAC;AAG7B,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAqB,MAAM,UAAU,CAAC;AAEtE,MAAM,uBAAuB,GAAG,kBAAkB,CAAC;AAEnD;;;;GAIG;A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