executor 1.3.0-beta.4 → 1.3.0-beta.5
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/bin/executor.mjs +98 -49
- package/package.json +1 -1
- package/resources/web/assets/{highlighted-body-TPN3WLV5-DWag2KgW.js → highlighted-body-TPN3WLV5-46YyTVIj.js} +1 -1
- package/resources/web/assets/{index-Bd3QqIqU.js → index-vE9OfFSV.js} +2 -2
- package/resources/web/assets/{mermaid-O7DHMXV3-Dhg9dniF.js → mermaid-O7DHMXV3-C705YdCO.js} +3 -3
- package/resources/web/index.html +1 -1
package/bin/executor.mjs
CHANGED
|
@@ -325915,6 +325915,8 @@ var sourceInspectOps = {
|
|
|
325915
325915
|
tool: operationErrors("sources.inspect.tool"),
|
|
325916
325916
|
discover: operationErrors("sources.inspect.discover")
|
|
325917
325917
|
};
|
|
325918
|
+
var PRETTY_JSON_SECTION_MAX_CHARS = 20000;
|
|
325919
|
+
var MAX_CODE_SECTION_CHARS = 1e5;
|
|
325918
325920
|
var tokenize3 = (value7) => value7.trim().toLowerCase().split(/[^a-z0-9]+/).filter(Boolean);
|
|
325919
325921
|
var canInspectSourceWithoutCatalog = (source2) => source2.status === "draft" || source2.status === "probing" || source2.status === "auth_required";
|
|
325920
325922
|
var loadSourceForMissingCatalog = (input) => gen2(function* () {
|
|
@@ -325988,12 +325990,31 @@ var persistedToolSummaryFromTool = (tool) => {
|
|
|
325988
325990
|
};
|
|
325989
325991
|
};
|
|
325990
325992
|
var nativeEncodingLanguage = (encoding) => encoding === "graphql" || encoding === "yaml" || encoding === "json" || encoding === "text" ? encoding : "json";
|
|
325991
|
-
var
|
|
325993
|
+
var truncatedCodeBody = (input) => input.body.length <= MAX_CODE_SECTION_CHARS ? input.body : [
|
|
325994
|
+
`[${input.title} truncated for inspection UI: ${String(input.body.length)} chars total, showing first ${String(MAX_CODE_SECTION_CHARS)}]`,
|
|
325995
|
+
input.body.slice(0, MAX_CODE_SECTION_CHARS)
|
|
325996
|
+
].join(`
|
|
325997
|
+
`);
|
|
325998
|
+
var serializedJsonSectionBody = (title, value7) => {
|
|
325999
|
+
const compact4 = JSON.stringify(value7);
|
|
326000
|
+
if (compact4.length <= PRETTY_JSON_SECTION_MAX_CHARS) {
|
|
326001
|
+
return JSON.stringify(value7, null, 2);
|
|
326002
|
+
}
|
|
326003
|
+
return truncatedCodeBody({
|
|
326004
|
+
title,
|
|
326005
|
+
body: compact4
|
|
326006
|
+
});
|
|
326007
|
+
};
|
|
326008
|
+
var codeSection = (title, language, body) => ({
|
|
325992
326009
|
kind: "code",
|
|
325993
326010
|
title,
|
|
325994
|
-
language
|
|
325995
|
-
body:
|
|
325996
|
-
|
|
326011
|
+
language,
|
|
326012
|
+
body: truncatedCodeBody({
|
|
326013
|
+
title,
|
|
326014
|
+
body
|
|
326015
|
+
})
|
|
326016
|
+
});
|
|
326017
|
+
var jsonSection = (title, value7) => value7 === null || value7 === undefined ? null : codeSection(title, "json", serializedJsonSectionBody(title, value7));
|
|
325997
326018
|
var inspectionToolDetailFromTool = (tool) => gen2(function* () {
|
|
325998
326019
|
const summary6 = persistedToolSummaryFromTool(tool);
|
|
325999
326020
|
const details = executableDetails(tool);
|
|
@@ -326012,18 +326033,14 @@ var inspectionToolDetailFromTool = (tool) => gen2(function* () {
|
|
|
326012
326033
|
{ label: "Response set", value: contract.responseSetId, mono: true }
|
|
326013
326034
|
];
|
|
326014
326035
|
const nativeSections = [
|
|
326015
|
-
...(tool.capability.native ?? []).map((blob, index) =>
|
|
326016
|
-
|
|
326017
|
-
title
|
|
326018
|
-
|
|
326019
|
-
|
|
326020
|
-
|
|
326021
|
-
|
|
326022
|
-
|
|
326023
|
-
title: `Executable native ${String(index + 1)}: ${blob.kind}`,
|
|
326024
|
-
language: nativeEncodingLanguage(blob.encoding),
|
|
326025
|
-
body: typeof blob.value === "string" ? blob.value : JSON.stringify(blob.value ?? null, null, 2)
|
|
326026
|
-
}))
|
|
326036
|
+
...(tool.capability.native ?? []).map((blob, index) => {
|
|
326037
|
+
const title = `Capability native ${String(index + 1)}: ${blob.kind}`;
|
|
326038
|
+
return codeSection(title, nativeEncodingLanguage(blob.encoding), typeof blob.value === "string" ? blob.value : serializedJsonSectionBody(title, blob.value ?? null));
|
|
326039
|
+
}),
|
|
326040
|
+
...(tool.executable.native ?? []).map((blob, index) => {
|
|
326041
|
+
const title = `Executable native ${String(index + 1)}: ${blob.kind}`;
|
|
326042
|
+
return codeSection(title, nativeEncodingLanguage(blob.encoding), typeof blob.value === "string" ? blob.value : serializedJsonSectionBody(title, blob.value ?? null));
|
|
326043
|
+
})
|
|
326027
326044
|
];
|
|
326028
326045
|
const sections = [
|
|
326029
326046
|
{
|
|
@@ -354804,6 +354821,16 @@ var resolveMcpEndpoint = (input) => {
|
|
|
354804
354821
|
return url3.toString();
|
|
354805
354822
|
};
|
|
354806
354823
|
|
|
354824
|
+
// plugins/mcp/sdk/executable-binding.ts
|
|
354825
|
+
var McpExecutableBindingSchema = Struct({
|
|
354826
|
+
toolId: String$,
|
|
354827
|
+
toolName: String$
|
|
354828
|
+
});
|
|
354829
|
+
var mcpExecutableBindingFromProviderData = (input) => ({
|
|
354830
|
+
toolId: input.toolId,
|
|
354831
|
+
toolName: input.toolName
|
|
354832
|
+
});
|
|
354833
|
+
|
|
354807
354834
|
// plugins/mcp/sdk/catalog.ts
|
|
354808
354835
|
var mcpResumeSupport = (execution2) => execution2?.taskSupport === "optional" || execution2?.taskSupport === "required";
|
|
354809
354836
|
var mcpSemanticsForOperation = (input) => {
|
|
@@ -354873,7 +354900,7 @@ var createMcpCapability = (input) => {
|
|
|
354873
354900
|
scopeId: input.serviceScopeId,
|
|
354874
354901
|
pluginKey: "mcp",
|
|
354875
354902
|
bindingVersion: EXECUTABLE_BINDING_VERSION,
|
|
354876
|
-
binding: input.operation.providerData,
|
|
354903
|
+
binding: mcpExecutableBindingFromProviderData(input.operation.providerData),
|
|
354877
354904
|
projection: {
|
|
354878
354905
|
responseSetId,
|
|
354879
354906
|
callShapeId,
|
|
@@ -357336,19 +357363,6 @@ var McpCompleteOAuthInputSchema = Struct({
|
|
|
357336
357363
|
error: optional(String$),
|
|
357337
357364
|
errorDescription: optional(String$)
|
|
357338
357365
|
});
|
|
357339
|
-
var McpExecutableBindingSchema = Struct({
|
|
357340
|
-
toolId: String$,
|
|
357341
|
-
toolName: String$,
|
|
357342
|
-
displayTitle: String$,
|
|
357343
|
-
title: NullOr(String$),
|
|
357344
|
-
description: NullOr(String$),
|
|
357345
|
-
annotations: NullOr(Unknown),
|
|
357346
|
-
execution: NullOr(Unknown),
|
|
357347
|
-
icons: NullOr(Unknown),
|
|
357348
|
-
meta: NullOr(Unknown),
|
|
357349
|
-
rawTool: NullOr(Unknown),
|
|
357350
|
-
server: NullOr(Unknown)
|
|
357351
|
-
});
|
|
357352
357366
|
var decodeProviderData3 = decodeUnknownSync(McpExecutableBindingSchema);
|
|
357353
357367
|
var McpExecutorAddInputSchema = Struct({
|
|
357354
357368
|
kind: optional(Literal2("mcp")),
|
|
@@ -357773,19 +357787,11 @@ var mcpSdkPlugin = (options7) => defineExecutorSourcePlugin({
|
|
|
357773
357787
|
});
|
|
357774
357788
|
const manifest = {
|
|
357775
357789
|
version: 2,
|
|
357776
|
-
server: providerData.server,
|
|
357777
357790
|
tools: [
|
|
357778
357791
|
{
|
|
357779
357792
|
toolId: providerData.toolId,
|
|
357780
357793
|
toolName: providerData.toolName,
|
|
357781
|
-
|
|
357782
|
-
title: providerData.title,
|
|
357783
|
-
description: providerData.description,
|
|
357784
|
-
annotations: providerData.annotations,
|
|
357785
|
-
execution: providerData.execution,
|
|
357786
|
-
icons: providerData.icons,
|
|
357787
|
-
meta: providerData.meta,
|
|
357788
|
-
rawTool: providerData.rawTool,
|
|
357794
|
+
description: input.descriptor.description ?? null,
|
|
357789
357795
|
inputSchema: input.descriptor.contract?.inputSchema,
|
|
357790
357796
|
outputSchema: input.descriptor.contract?.outputSchema
|
|
357791
357797
|
}
|
|
@@ -358885,7 +358891,14 @@ var createHttpCapabilityFromOpenApi = (input) => {
|
|
|
358885
358891
|
})(),
|
|
358886
358892
|
pluginKey: "openapi",
|
|
358887
358893
|
bindingVersion: EXECUTABLE_BINDING_VERSION,
|
|
358888
|
-
binding:
|
|
358894
|
+
binding: {
|
|
358895
|
+
kind: "openapi",
|
|
358896
|
+
toolId: input.operation.providerData.toolId,
|
|
358897
|
+
...input.operation.providerData.operationId ? { operationId: input.operation.providerData.operationId } : {},
|
|
358898
|
+
invocation: input.operation.providerData.invocation,
|
|
358899
|
+
...input.operation.providerData.documentServers ? { documentServers: input.operation.providerData.documentServers } : {},
|
|
358900
|
+
...input.operation.providerData.servers ? { servers: input.operation.providerData.servers } : {}
|
|
358901
|
+
},
|
|
358889
358902
|
projection: {
|
|
358890
358903
|
responseSetId,
|
|
358891
358904
|
callShapeId
|
|
@@ -359143,6 +359156,14 @@ var OpenApiToolProviderDataSchema = Struct({
|
|
|
359143
359156
|
documentServers: optional(Array$(OpenApiServerSchema)),
|
|
359144
359157
|
servers: optional(Array$(OpenApiServerSchema))
|
|
359145
359158
|
});
|
|
359159
|
+
var OpenApiExecutableBindingSchema = Struct({
|
|
359160
|
+
kind: Literal2("openapi"),
|
|
359161
|
+
toolId: String$,
|
|
359162
|
+
operationId: optional(String$),
|
|
359163
|
+
invocation: OpenApiInvocationPayloadSchema,
|
|
359164
|
+
documentServers: optional(Array$(OpenApiServerSchema)),
|
|
359165
|
+
servers: optional(Array$(OpenApiServerSchema))
|
|
359166
|
+
});
|
|
359146
359167
|
|
|
359147
359168
|
// plugins/openapi/sdk/extraction.ts
|
|
359148
359169
|
var asObject3 = (value7) => value7 !== null && typeof value7 === "object" && !Array.isArray(value7) ? value7 : {};
|
|
@@ -359248,13 +359269,20 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359248
359269
|
return next;
|
|
359249
359270
|
};
|
|
359250
359271
|
const dereference = async (inputValue) => {
|
|
359251
|
-
const {
|
|
359272
|
+
const {
|
|
359273
|
+
value: value7,
|
|
359274
|
+
currentDocument,
|
|
359275
|
+
currentDocumentUrl,
|
|
359276
|
+
activeRefs,
|
|
359277
|
+
preserveLocalRefs
|
|
359278
|
+
} = inputValue;
|
|
359252
359279
|
if (Array.isArray(value7)) {
|
|
359253
359280
|
return Promise.all(value7.map((entry) => dereference({
|
|
359254
359281
|
value: entry,
|
|
359255
359282
|
currentDocument,
|
|
359256
359283
|
currentDocumentUrl,
|
|
359257
|
-
activeRefs
|
|
359284
|
+
activeRefs,
|
|
359285
|
+
preserveLocalRefs
|
|
359258
359286
|
})));
|
|
359259
359287
|
}
|
|
359260
359288
|
if (value7 === null || typeof value7 !== "object") {
|
|
@@ -359267,6 +359295,23 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359267
359295
|
if (!target?.documentUrl && !ref.startsWith("#")) {
|
|
359268
359296
|
return value7;
|
|
359269
359297
|
}
|
|
359298
|
+
const isLocalRef = ref.startsWith("#") && (target?.documentUrl === undefined || target.documentUrl === currentDocumentUrl);
|
|
359299
|
+
if (isLocalRef && preserveLocalRefs) {
|
|
359300
|
+
const siblingEntries2 = Object.fromEntries(await Promise.all(Object.entries(object4).filter(([key]) => key !== "$ref").map(async ([key, entry]) => [
|
|
359301
|
+
key,
|
|
359302
|
+
await dereference({
|
|
359303
|
+
value: entry,
|
|
359304
|
+
currentDocument,
|
|
359305
|
+
currentDocumentUrl,
|
|
359306
|
+
activeRefs,
|
|
359307
|
+
preserveLocalRefs
|
|
359308
|
+
})
|
|
359309
|
+
])));
|
|
359310
|
+
return Object.keys(siblingEntries2).length > 0 ? {
|
|
359311
|
+
$ref: ref,
|
|
359312
|
+
...siblingEntries2
|
|
359313
|
+
} : value7;
|
|
359314
|
+
}
|
|
359270
359315
|
const activeKey = `${target?.documentUrl ?? currentDocumentUrl ?? "root"}|${target?.pointer ?? ref}`;
|
|
359271
359316
|
if (activeRefs.has(activeKey)) {
|
|
359272
359317
|
return value7;
|
|
@@ -359282,7 +359327,8 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359282
359327
|
value: targetValue,
|
|
359283
359328
|
currentDocument: targetDocument,
|
|
359284
359329
|
currentDocumentUrl: target?.documentUrl ?? currentDocumentUrl,
|
|
359285
|
-
activeRefs: nextActiveRefs
|
|
359330
|
+
activeRefs: nextActiveRefs,
|
|
359331
|
+
preserveLocalRefs: target?.documentUrl ? false : preserveLocalRefs
|
|
359286
359332
|
});
|
|
359287
359333
|
const siblingEntries = Object.fromEntries(await Promise.all(Object.entries(object4).filter(([key]) => key !== "$ref").map(async ([key, entry]) => [
|
|
359288
359334
|
key,
|
|
@@ -359290,7 +359336,8 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359290
359336
|
value: entry,
|
|
359291
359337
|
currentDocument,
|
|
359292
359338
|
currentDocumentUrl,
|
|
359293
|
-
activeRefs: nextActiveRefs
|
|
359339
|
+
activeRefs: nextActiveRefs,
|
|
359340
|
+
preserveLocalRefs
|
|
359294
359341
|
})
|
|
359295
359342
|
])));
|
|
359296
359343
|
const resolvedObject = asObject3(resolvedValue);
|
|
@@ -359302,7 +359349,8 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359302
359349
|
value: entry,
|
|
359303
359350
|
currentDocument,
|
|
359304
359351
|
currentDocumentUrl,
|
|
359305
|
-
activeRefs
|
|
359352
|
+
activeRefs,
|
|
359353
|
+
preserveLocalRefs
|
|
359306
359354
|
})
|
|
359307
359355
|
])));
|
|
359308
359356
|
};
|
|
@@ -359310,7 +359358,8 @@ var loadDereferencedOpenApiDocument = async (input) => {
|
|
|
359310
359358
|
value: input.document,
|
|
359311
359359
|
currentDocument: input.document,
|
|
359312
359360
|
currentDocumentUrl: input.documentUrl,
|
|
359313
|
-
activeRefs: new Set
|
|
359361
|
+
activeRefs: new Set,
|
|
359362
|
+
preserveLocalRefs: true
|
|
359314
359363
|
});
|
|
359315
359364
|
};
|
|
359316
359365
|
var preferredContentEntry = (content) => {
|
|
@@ -360399,7 +360448,7 @@ var openApiStoredSourceDataFromLocalConfig = (input) => {
|
|
|
360399
360448
|
}
|
|
360400
360449
|
throw new Error("Unsupported OpenAPI local source config.");
|
|
360401
360450
|
};
|
|
360402
|
-
var
|
|
360451
|
+
var decodeExecutableBinding = decodeUnknownSync(OpenApiExecutableBindingSchema);
|
|
360403
360452
|
var asRecord11 = (value7) => typeof value7 === "object" && value7 !== null && !Array.isArray(value7) ? value7 : {};
|
|
360404
360453
|
var parameterContainerKeys = {
|
|
360405
360454
|
path: ["path", "pathParams", "params"],
|
|
@@ -360685,7 +360734,7 @@ var openApiSdkPlugin = (options7) => defineExecutorSourcePlugin({
|
|
|
360685
360734
|
return yield* runtimeEffectError("plugins/openapi/sdk", `OpenAPI source storage missing for ${input.source.id}`);
|
|
360686
360735
|
}
|
|
360687
360736
|
const normalizedStored = normalizeStoredSourceData3(input.stored);
|
|
360688
|
-
const providerData =
|
|
360737
|
+
const providerData = decodeExecutableBinding(input.executable.binding);
|
|
360689
360738
|
const args2 = asRecord11(input.args);
|
|
360690
360739
|
const resolvedPath = replacePathTemplate(providerData.invocation.pathTemplate, args2, providerData.invocation);
|
|
360691
360740
|
const headers = {
|
|
@@ -360745,7 +360794,7 @@ var openApiSdkPlugin = (options7) => defineExecutorSourcePlugin({
|
|
|
360745
360794
|
}
|
|
360746
360795
|
const response = yield* tryPromise2({
|
|
360747
360796
|
try: () => fetch(finalUrl.toString(), {
|
|
360748
|
-
method: providerData.method.toUpperCase(),
|
|
360797
|
+
method: providerData.invocation.method.toUpperCase(),
|
|
360749
360798
|
headers: requestHeaders,
|
|
360750
360799
|
...body !== undefined ? {
|
|
360751
360800
|
body: typeof body === "string" ? body : new Uint8Array(body).buffer
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-
|
|
1
|
+
import{r,R as c,M as p,B as x}from"./mermaid-O7DHMXV3-C705YdCO.js";import{j as d}from"./index-CRuElBS1.js";var R=({code:i,language:e,raw:t,className:g,startLine:u,...m})=>{let{shikiTheme:o}=r.useContext(c),a=p(),[n,s]=r.useState(t);return r.useEffect(()=>{if(!a){s(t);return}let l=a.highlight({code:i,language:e,themes:o},h=>{s(h)});l&&s(l)},[i,e,o,a,t]),d.jsx(x,{className:g,language:e,result:n,startLine:u,...m})};export{R as HighlightedCodeBlockBody};
|