executor 1.3.0-beta.3 → 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 +104 -571
- package/package.json +1 -1
- package/resources/web/assets/{highlighted-body-TPN3WLV5-CDRNFkjL.js → highlighted-body-TPN3WLV5-46YyTVIj.js} +1 -1
- package/resources/web/assets/{index-Dd_qDhpI.js → index-vE9OfFSV.js} +2 -2
- package/resources/web/assets/{mermaid-O7DHMXV3-CSkwp1or.js → mermaid-O7DHMXV3-C705YdCO.js} +81 -81
- package/resources/web/assets/mermaid-O7DHMXV3-CQK1gbuD.css +1 -0
- package/resources/web/index.html +1 -1
- package/resources/web/assets/mermaid-O7DHMXV3-TBgTjb2d.css +0 -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
|
|
@@ -364877,512 +364926,28 @@ var openApiHttpPlugin = () => ({
|
|
|
364877
364926
|
})), mapError2(mapPluginStorageError4("openapi.updateSource")))).handle("refreshSource", ({ path: path4 }) => resolveRequestedLocalWorkspace("openapi.refreshSource", path4.workspaceId).pipe(flatMap10(() => executor2.openapi.refreshSource(path4.sourceId)), mapError2(mapPluginStorageError4("openapi.refreshSource")))).handle("removeSource", ({ path: path4 }) => resolveRequestedLocalWorkspace("openapi.removeSource", path4.workspaceId).pipe(flatMap10(() => executor2.openapi.removeSource(path4.sourceId)), map16((removed) => ({ removed })), mapError2(mapPluginStorageError4("openapi.removeSource")))))
|
|
364878
364927
|
});
|
|
364879
364928
|
|
|
364880
|
-
// plugins/onepassword/shared/index.ts
|
|
364881
|
-
var ONEPASSWORD_SECRET_STORE_KIND = "onepassword";
|
|
364882
|
-
var ONEPASSWORD_SECRET_FIELD_ID = "credential";
|
|
364883
|
-
var OnePasswordStoreAuthSchema = Union2(Struct({
|
|
364884
|
-
kind: Literal2("desktop-app"),
|
|
364885
|
-
accountName: String$
|
|
364886
|
-
}), Struct({
|
|
364887
|
-
kind: Literal2("service-account"),
|
|
364888
|
-
tokenSecretRef: SecretRefSchema2
|
|
364889
|
-
}));
|
|
364890
|
-
var OnePasswordConnectInputSchema = Struct({
|
|
364891
|
-
kind: Literal2(ONEPASSWORD_SECRET_STORE_KIND),
|
|
364892
|
-
name: String$,
|
|
364893
|
-
vaultId: String$,
|
|
364894
|
-
auth: OnePasswordStoreAuthSchema
|
|
364895
|
-
});
|
|
364896
|
-
var OnePasswordStoreConfigPayloadSchema = OnePasswordConnectInputSchema;
|
|
364897
|
-
var OnePasswordUpdateStoreInputSchema = Struct({
|
|
364898
|
-
storeId: String$,
|
|
364899
|
-
config: OnePasswordStoreConfigPayloadSchema
|
|
364900
|
-
});
|
|
364901
|
-
var OnePasswordStoredStoreDataSchema = Struct({
|
|
364902
|
-
vaultId: String$,
|
|
364903
|
-
auth: OnePasswordStoreAuthSchema
|
|
364904
|
-
});
|
|
364905
|
-
var OnePasswordDiscoverVaultsInputSchema = Struct({
|
|
364906
|
-
auth: OnePasswordStoreAuthSchema
|
|
364907
|
-
});
|
|
364908
|
-
var OnePasswordVaultSchema = Struct({
|
|
364909
|
-
id: String$,
|
|
364910
|
-
name: String$
|
|
364911
|
-
});
|
|
364912
|
-
var OnePasswordDiscoverVaultsResultSchema = Struct({
|
|
364913
|
-
vaults: Array$(OnePasswordVaultSchema)
|
|
364914
|
-
});
|
|
364915
|
-
var OnePasswordDiscoverStoreItemsInputSchema = Struct({
|
|
364916
|
-
storeId: String$
|
|
364917
|
-
});
|
|
364918
|
-
var OnePasswordItemFieldSchema = Struct({
|
|
364919
|
-
id: String$,
|
|
364920
|
-
title: String$,
|
|
364921
|
-
fieldType: String$,
|
|
364922
|
-
sectionId: optional(String$)
|
|
364923
|
-
});
|
|
364924
|
-
var OnePasswordItemSchema = Struct({
|
|
364925
|
-
id: String$,
|
|
364926
|
-
title: String$,
|
|
364927
|
-
category: String$,
|
|
364928
|
-
fields: optional(Array$(OnePasswordItemFieldSchema))
|
|
364929
|
-
});
|
|
364930
|
-
var OnePasswordDiscoverStoreItemsResultSchema = Struct({
|
|
364931
|
-
items: Array$(OnePasswordItemSchema)
|
|
364932
|
-
});
|
|
364933
|
-
var OnePasswordDiscoverItemFieldsInputSchema = Struct({
|
|
364934
|
-
storeId: String$,
|
|
364935
|
-
itemId: String$
|
|
364936
|
-
});
|
|
364937
|
-
var OnePasswordDiscoverItemFieldsResultSchema = Struct({
|
|
364938
|
-
itemId: String$,
|
|
364939
|
-
fields: Array$(OnePasswordItemFieldSchema)
|
|
364940
|
-
});
|
|
364941
|
-
var OnePasswordImportSecretInputSchema = Struct({
|
|
364942
|
-
storeId: String$,
|
|
364943
|
-
itemId: String$,
|
|
364944
|
-
fieldId: String$,
|
|
364945
|
-
name: optional(String$)
|
|
364946
|
-
});
|
|
364947
|
-
var OnePasswordImportSecretResultSchema = Struct({
|
|
364948
|
-
id: String$,
|
|
364949
|
-
name: NullOr(String$),
|
|
364950
|
-
storeId: String$,
|
|
364951
|
-
purpose: String$,
|
|
364952
|
-
createdAt: Number$,
|
|
364953
|
-
updatedAt: Number$
|
|
364954
|
-
});
|
|
364955
|
-
var workspaceIdParam8 = exports_HttpApiSchema.param("workspaceId", ScopeIdSchema2);
|
|
364956
|
-
var onePasswordHttpGroup = exports_HttpApiGroup.make("onepassword").add(exports_HttpApiEndpoint.post("discoverVaults")`/workspaces/${workspaceIdParam8}/plugins/onepassword/vaults/discover`.setPayload(OnePasswordDiscoverVaultsInputSchema).addSuccess(OnePasswordDiscoverVaultsResultSchema)).add(exports_HttpApiEndpoint.post("discoverStoreItems")`/workspaces/${workspaceIdParam8}/plugins/onepassword/stores/discover-items`.setPayload(OnePasswordDiscoverStoreItemsInputSchema).addSuccess(OnePasswordDiscoverStoreItemsResultSchema)).add(exports_HttpApiEndpoint.post("discoverItemFields")`/workspaces/${workspaceIdParam8}/plugins/onepassword/items/discover-fields`.setPayload(OnePasswordDiscoverItemFieldsInputSchema).addSuccess(OnePasswordDiscoverItemFieldsResultSchema)).add(exports_HttpApiEndpoint.post("importSecret")`/workspaces/${workspaceIdParam8}/plugins/onepassword/secrets/import`.setPayload(OnePasswordImportSecretInputSchema).addSuccess(OnePasswordImportSecretResultSchema)).prefix("/v1");
|
|
364957
|
-
|
|
364958
|
-
// plugins/onepassword/http/index.ts
|
|
364959
|
-
var workspaceIdParam9 = exports_HttpApiSchema.param("workspaceId", ScopeIdSchema2);
|
|
364960
|
-
var OnePasswordHttpGroup = exports_HttpApiGroup.make("onepassword").add(exports_HttpApiEndpoint.post("discoverVaults")`/workspaces/${workspaceIdParam9}/plugins/onepassword/vaults/discover`.setPayload(OnePasswordDiscoverVaultsInputSchema).addSuccess(OnePasswordDiscoverVaultsResultSchema).addError(ControlPlaneBadRequestError).addError(ControlPlaneForbiddenError).addError(ControlPlaneStorageError)).add(exports_HttpApiEndpoint.post("discoverStoreItems")`/workspaces/${workspaceIdParam9}/plugins/onepassword/stores/discover-items`.setPayload(OnePasswordDiscoverStoreItemsInputSchema).addSuccess(OnePasswordDiscoverStoreItemsResultSchema).addError(ControlPlaneBadRequestError).addError(ControlPlaneForbiddenError).addError(ControlPlaneStorageError)).add(exports_HttpApiEndpoint.post("discoverItemFields")`/workspaces/${workspaceIdParam9}/plugins/onepassword/items/discover-fields`.setPayload(OnePasswordDiscoverItemFieldsInputSchema).addSuccess(OnePasswordDiscoverItemFieldsResultSchema).addError(ControlPlaneBadRequestError).addError(ControlPlaneForbiddenError).addError(ControlPlaneStorageError)).add(exports_HttpApiEndpoint.post("importSecret")`/workspaces/${workspaceIdParam9}/plugins/onepassword/secrets/import`.setPayload(OnePasswordImportSecretInputSchema).addSuccess(OnePasswordImportSecretResultSchema).addError(ControlPlaneBadRequestError).addError(ControlPlaneForbiddenError).addError(ControlPlaneStorageError)).prefix("/v1");
|
|
364961
|
-
var OnePasswordHttpApi = exports_HttpApi.make("executor").add(OnePasswordHttpGroup);
|
|
364962
|
-
var toStorageError5 = (operation, cause2) => new ControlPlaneStorageError({
|
|
364963
|
-
operation,
|
|
364964
|
-
message: cause2 instanceof Error ? cause2.message : String(cause2),
|
|
364965
|
-
details: cause2 instanceof Error ? cause2.stack ?? cause2.message : String(cause2)
|
|
364966
|
-
});
|
|
364967
|
-
var onePasswordHttpPlugin = () => ({
|
|
364968
|
-
key: "onepassword",
|
|
364969
|
-
group: OnePasswordHttpGroup,
|
|
364970
|
-
build: ({ executor: executor2 }) => exports_HttpApiBuilder.group(OnePasswordHttpApi, "onepassword", (handlers) => handlers.handle("discoverVaults", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("onepassword.discoverVaults", path4.workspaceId).pipe(flatMap10(() => executor2.onepassword.discoverVaults(payload)), mapError2((cause2) => toStorageError5("onepassword.discoverVaults", cause2)))).handle("discoverStoreItems", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("onepassword.discoverStoreItems", path4.workspaceId).pipe(flatMap10(() => executor2.onepassword.discoverStoreItems(payload)), mapError2((cause2) => toStorageError5("onepassword.discoverStoreItems", cause2)))).handle("discoverItemFields", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("onepassword.discoverItemFields", path4.workspaceId).pipe(flatMap10(() => executor2.onepassword.discoverItemFields(payload)), mapError2((cause2) => toStorageError5("onepassword.discoverItemFields", cause2)))).handle("importSecret", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("onepassword.importSecret", path4.workspaceId).pipe(flatMap10(() => executor2.onepassword.importSecret(payload)), mapError2((cause2) => toStorageError5("onepassword.importSecret", cause2)))))
|
|
364971
|
-
});
|
|
364972
|
-
|
|
364973
|
-
// plugins/onepassword/sdk/index.ts
|
|
364974
|
-
import {
|
|
364975
|
-
createClient,
|
|
364976
|
-
DesktopAuth,
|
|
364977
|
-
ItemCategory,
|
|
364978
|
-
ItemFieldType
|
|
364979
|
-
} from "@1password/sdk";
|
|
364980
|
-
var ONEPASSWORD_REQUEST_TIMEOUT_MS = 15000;
|
|
364981
|
-
var timedOutOnePasswordRequestError = (operation) => new Error(`1Password ${operation} timed out after ${Math.floor(ONEPASSWORD_REQUEST_TIMEOUT_MS / 1000)} seconds. Approve the request in the 1Password desktop app and try again.`);
|
|
364982
|
-
var runOnePasswordRequest = (operation, effect3) => new Promise((resolve5, reject) => {
|
|
364983
|
-
const timeoutId = setTimeout(() => {
|
|
364984
|
-
reject(timedOutOnePasswordRequestError(operation));
|
|
364985
|
-
}, ONEPASSWORD_REQUEST_TIMEOUT_MS);
|
|
364986
|
-
effect3().then((value7) => {
|
|
364987
|
-
clearTimeout(timeoutId);
|
|
364988
|
-
resolve5(value7);
|
|
364989
|
-
}, (cause2) => {
|
|
364990
|
-
clearTimeout(timeoutId);
|
|
364991
|
-
reject(cause2);
|
|
364992
|
-
});
|
|
364993
|
-
});
|
|
364994
|
-
var resolveServiceAccountToken = (auth2) => gen2(function* () {
|
|
364995
|
-
const resolveSecretMaterial = yield* SecretMaterialResolverService;
|
|
364996
|
-
return yield* resolveSecretMaterial({
|
|
364997
|
-
ref: auth2.tokenSecretRef
|
|
364998
|
-
});
|
|
364999
|
-
});
|
|
365000
|
-
var makeClientFromAuth = (auth2) => gen2(function* () {
|
|
365001
|
-
const resolvedAuth = auth2.kind === "desktop-app" ? new DesktopAuth(auth2.accountName) : yield* resolveServiceAccountToken(auth2);
|
|
365002
|
-
return yield* tryPromise2({
|
|
365003
|
-
try: () => runOnePasswordRequest("client setup", () => createClient({
|
|
365004
|
-
auth: resolvedAuth,
|
|
365005
|
-
integrationName: "Executor",
|
|
365006
|
-
integrationVersion: "0.0.0"
|
|
365007
|
-
})),
|
|
365008
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365009
|
-
});
|
|
365010
|
-
});
|
|
365011
|
-
var makeClient2 = (stored) => gen2(function* () {
|
|
365012
|
-
if (!stored) {
|
|
365013
|
-
throw new Error("1Password store configuration is missing.");
|
|
365014
|
-
}
|
|
365015
|
-
return yield* makeClientFromAuth(stored.auth);
|
|
365016
|
-
});
|
|
365017
|
-
var importableFieldTypes = new Set([
|
|
365018
|
-
ItemFieldType.Concealed,
|
|
365019
|
-
ItemFieldType.Text
|
|
365020
|
-
]);
|
|
365021
|
-
var ONEPASSWORD_BROWSE_ITEM_LIMIT = 12;
|
|
365022
|
-
var toImportableFields = (fields) => fields.filter((field) => importableFieldTypes.has(field.fieldType) && field.id.trim().length > 0 && field.value.trim().length > 0).map((field) => ({
|
|
365023
|
-
id: field.id,
|
|
365024
|
-
title: field.title || field.id,
|
|
365025
|
-
fieldType: field.fieldType,
|
|
365026
|
-
...field.sectionId ? { sectionId: field.sectionId } : {}
|
|
365027
|
-
}));
|
|
365028
|
-
var secretSelectionKey = (itemId, fieldId) => `secret:${itemId}:${fieldId}`;
|
|
365029
|
-
var parseSelectionKey = (value7) => {
|
|
365030
|
-
const itemMatch = /^item:([^:]+)$/.exec(value7);
|
|
365031
|
-
if (itemMatch) {
|
|
365032
|
-
return {
|
|
365033
|
-
kind: "item",
|
|
365034
|
-
itemId: itemMatch[1]
|
|
365035
|
-
};
|
|
365036
|
-
}
|
|
365037
|
-
const secretMatch = /^secret:([^:]+):([^:]+)$/.exec(value7);
|
|
365038
|
-
if (secretMatch) {
|
|
365039
|
-
return {
|
|
365040
|
-
kind: "secret",
|
|
365041
|
-
itemId: secretMatch[1],
|
|
365042
|
-
fieldId: secretMatch[2]
|
|
365043
|
-
};
|
|
365044
|
-
}
|
|
365045
|
-
throw new Error(`Invalid 1Password selection key: ${value7}`);
|
|
365046
|
-
};
|
|
365047
|
-
var discoverVaults = (input) => flatMap10(makeClientFromAuth(input.auth), (client) => tryPromise2({
|
|
365048
|
-
try: async () => {
|
|
365049
|
-
const vaults = await runOnePasswordRequest("vault discovery", () => client.vaults.list({ decryptDetails: true }));
|
|
365050
|
-
return {
|
|
365051
|
-
vaults: vaults.map((vault) => ({
|
|
365052
|
-
id: vault.id,
|
|
365053
|
-
name: vault.title
|
|
365054
|
-
})).sort((left3, right3) => left3.name.localeCompare(right3.name))
|
|
365055
|
-
};
|
|
365056
|
-
},
|
|
365057
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365058
|
-
}));
|
|
365059
|
-
var discoverStoreItems = (input) => flatMap10(makeClient2(input.stored), (client) => tryPromise2({
|
|
365060
|
-
try: async () => {
|
|
365061
|
-
const overviews = await runOnePasswordRequest("item discovery", () => client.items.list(input.stored.vaultId));
|
|
365062
|
-
return {
|
|
365063
|
-
items: overviews.map((item) => ({
|
|
365064
|
-
id: item.id,
|
|
365065
|
-
title: item.title,
|
|
365066
|
-
category: item.category
|
|
365067
|
-
})).sort((left3, right3) => left3.title.localeCompare(right3.title))
|
|
365068
|
-
};
|
|
365069
|
-
},
|
|
365070
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365071
|
-
}));
|
|
365072
|
-
var discoverItemFields = (input) => flatMap10(makeClient2(input.stored), (client) => tryPromise2({
|
|
365073
|
-
try: async () => {
|
|
365074
|
-
const item = await runOnePasswordRequest("field discovery", () => client.items.get(input.stored.vaultId, input.itemId));
|
|
365075
|
-
return {
|
|
365076
|
-
itemId: item.id,
|
|
365077
|
-
fields: toImportableFields(item.fields)
|
|
365078
|
-
};
|
|
365079
|
-
},
|
|
365080
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365081
|
-
}));
|
|
365082
|
-
var discoverImportableSecrets = (input) => flatMap10(makeClient2(input.stored), (client) => tryPromise2({
|
|
365083
|
-
try: async () => {
|
|
365084
|
-
const normalizedQuery = input.query?.trim().toLowerCase() ?? "";
|
|
365085
|
-
const overviews = await runOnePasswordRequest("item discovery", () => client.items.list(input.stored.vaultId));
|
|
365086
|
-
const filteredItems = overviews.filter((item) => normalizedQuery.length === 0 || item.title.toLowerCase().includes(normalizedQuery)).slice(0, ONEPASSWORD_BROWSE_ITEM_LIMIT);
|
|
365087
|
-
const detailedItems = await Promise.all(filteredItems.map((item) => runOnePasswordRequest("field discovery", () => client.items.get(input.stored.vaultId, item.id))));
|
|
365088
|
-
return {
|
|
365089
|
-
entries: detailedItems.flatMap((item) => toImportableFields(item.fields).filter((field) => normalizedQuery.length === 0 || item.title.toLowerCase().includes(normalizedQuery) || field.title.toLowerCase().includes(normalizedQuery) || field.id.toLowerCase().includes(normalizedQuery)).map((field) => ({
|
|
365090
|
-
key: secretSelectionKey(item.id, field.id),
|
|
365091
|
-
label: `${item.title} · ${field.title}`,
|
|
365092
|
-
description: item.category ?? field.fieldType ?? null,
|
|
365093
|
-
kind: "secret"
|
|
365094
|
-
}))).sort((left3, right3) => left3.label.localeCompare(right3.label))
|
|
365095
|
-
};
|
|
365096
|
-
},
|
|
365097
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365098
|
-
}));
|
|
365099
|
-
var browseSecrets = (input) => gen2(function* () {
|
|
365100
|
-
const normalizedQuery = input.query?.trim().toLowerCase() ?? "";
|
|
365101
|
-
if (!input.parentKey) {
|
|
365102
|
-
return yield* discoverImportableSecrets({
|
|
365103
|
-
...input,
|
|
365104
|
-
query: normalizedQuery
|
|
365105
|
-
});
|
|
365106
|
-
}
|
|
365107
|
-
const selection = parseSelectionKey(input.parentKey);
|
|
365108
|
-
if (selection.kind !== "item") {
|
|
365109
|
-
throw new Error(`Cannot browse children for selection: ${input.parentKey}`);
|
|
365110
|
-
}
|
|
365111
|
-
const fields = yield* discoverItemFields({
|
|
365112
|
-
...input,
|
|
365113
|
-
itemId: selection.itemId
|
|
365114
|
-
});
|
|
365115
|
-
return {
|
|
365116
|
-
entries: fields.fields.filter((field) => normalizedQuery.length === 0 || field.title.toLowerCase().includes(normalizedQuery) || field.id.toLowerCase().includes(normalizedQuery)).map((field) => ({
|
|
365117
|
-
key: secretSelectionKey(selection.itemId, field.id),
|
|
365118
|
-
label: field.title,
|
|
365119
|
-
description: field.fieldType ?? null,
|
|
365120
|
-
kind: "secret"
|
|
365121
|
-
}))
|
|
365122
|
-
};
|
|
365123
|
-
});
|
|
365124
|
-
var importSecretFromSelection = (input) => gen2(function* () {
|
|
365125
|
-
const selection = parseSelectionKey(input.selectionKey);
|
|
365126
|
-
if (selection.kind !== "secret") {
|
|
365127
|
-
throw new Error(`1Password selection is not a secret field: ${input.selectionKey}`);
|
|
365128
|
-
}
|
|
365129
|
-
const items = yield* discoverStoreItems(input);
|
|
365130
|
-
const item = items.items.find((candidate) => candidate.id === selection.itemId);
|
|
365131
|
-
if (!item) {
|
|
365132
|
-
throw new Error(`1Password item not found: ${selection.itemId}`);
|
|
365133
|
-
}
|
|
365134
|
-
const fields = yield* discoverItemFields({
|
|
365135
|
-
...input,
|
|
365136
|
-
itemId: selection.itemId
|
|
365137
|
-
});
|
|
365138
|
-
const field = fields.fields.find((candidate) => candidate.id === selection.fieldId);
|
|
365139
|
-
if (!field) {
|
|
365140
|
-
throw new Error(`1Password field not found: ${selection.itemId}/${selection.fieldId}`);
|
|
365141
|
-
}
|
|
365142
|
-
return {
|
|
365143
|
-
secretStored: {
|
|
365144
|
-
uri: `op://${input.stored.vaultId}/${item.id}/${field.id}`
|
|
365145
|
-
},
|
|
365146
|
-
name: input.name?.trim() || `${item.title} · ${field.title}`
|
|
365147
|
-
};
|
|
365148
|
-
});
|
|
365149
|
-
var createImportedSecretRecord2 = (input) => gen2(function* () {
|
|
365150
|
-
const now2 = Date.now();
|
|
365151
|
-
const secret7 = {
|
|
365152
|
-
id: SecretMaterialIdSchema.make(`sec_${crypto.randomUUID()}`),
|
|
365153
|
-
storeId: input.store.id,
|
|
365154
|
-
name: input.name,
|
|
365155
|
-
purpose: input.purpose ?? "auth_material",
|
|
365156
|
-
createdAt: now2,
|
|
365157
|
-
updatedAt: now2
|
|
365158
|
-
};
|
|
365159
|
-
yield* input.executor.runtime.storage.secrets.upsert(secret7);
|
|
365160
|
-
yield* input.executor.runtime.storage.secrets.secretMaterialStoredData.upsert({
|
|
365161
|
-
secretId: secret7.id,
|
|
365162
|
-
data: input.secretStored
|
|
365163
|
-
});
|
|
365164
|
-
return {
|
|
365165
|
-
id: secret7.id,
|
|
365166
|
-
name: secret7.name,
|
|
365167
|
-
storeId: secret7.storeId,
|
|
365168
|
-
purpose: secret7.purpose,
|
|
365169
|
-
createdAt: secret7.createdAt,
|
|
365170
|
-
updatedAt: secret7.updatedAt
|
|
365171
|
-
};
|
|
365172
|
-
});
|
|
365173
|
-
var parseSecretReference = (uri) => {
|
|
365174
|
-
const match18 = /^op:\/\/([^/]+)\/([^/]+)\/([^/]+)$/.exec(uri);
|
|
365175
|
-
if (!match18) {
|
|
365176
|
-
throw new Error(`Invalid 1Password secret reference: ${uri}`);
|
|
365177
|
-
}
|
|
365178
|
-
return {
|
|
365179
|
-
vaultId: match18[1],
|
|
365180
|
-
itemId: match18[2],
|
|
365181
|
-
fieldId: match18[3]
|
|
365182
|
-
};
|
|
365183
|
-
};
|
|
365184
|
-
var upsertCredentialField = (item, value7) => {
|
|
365185
|
-
const existing = item.fields.find((field) => field.id === ONEPASSWORD_SECRET_FIELD_ID);
|
|
365186
|
-
if (existing) {
|
|
365187
|
-
existing.value = value7;
|
|
365188
|
-
return item;
|
|
365189
|
-
}
|
|
365190
|
-
item.fields.push({
|
|
365191
|
-
id: ONEPASSWORD_SECRET_FIELD_ID,
|
|
365192
|
-
title: "Credential",
|
|
365193
|
-
fieldType: ItemFieldType.Concealed,
|
|
365194
|
-
value: value7
|
|
365195
|
-
});
|
|
365196
|
-
return item;
|
|
365197
|
-
};
|
|
365198
|
-
var onePasswordSdkPlugin = (input) => defineExecutorSecretStorePlugin({
|
|
365199
|
-
key: ONEPASSWORD_SECRET_STORE_KIND,
|
|
365200
|
-
secretStore: {
|
|
365201
|
-
kind: ONEPASSWORD_SECRET_STORE_KIND,
|
|
365202
|
-
displayName: "1Password",
|
|
365203
|
-
add: {
|
|
365204
|
-
inputSchema: OnePasswordConnectInputSchema,
|
|
365205
|
-
toConnectInput: (value7) => value7
|
|
365206
|
-
},
|
|
365207
|
-
storage: input.storage,
|
|
365208
|
-
store: {
|
|
365209
|
-
create: (value7) => ({
|
|
365210
|
-
store: {
|
|
365211
|
-
kind: ONEPASSWORD_SECRET_STORE_KIND,
|
|
365212
|
-
name: value7.name,
|
|
365213
|
-
status: "connected",
|
|
365214
|
-
enabled: true
|
|
365215
|
-
},
|
|
365216
|
-
stored: {
|
|
365217
|
-
vaultId: value7.vaultId,
|
|
365218
|
-
auth: value7.auth
|
|
365219
|
-
}
|
|
365220
|
-
}),
|
|
365221
|
-
update: ({ store, config: config4 }) => ({
|
|
365222
|
-
store: {
|
|
365223
|
-
...store,
|
|
365224
|
-
name: config4.name,
|
|
365225
|
-
status: "connected"
|
|
365226
|
-
},
|
|
365227
|
-
stored: {
|
|
365228
|
-
vaultId: config4.vaultId,
|
|
365229
|
-
auth: config4.auth
|
|
365230
|
-
}
|
|
365231
|
-
}),
|
|
365232
|
-
toConfig: ({ store, stored }) => ({
|
|
365233
|
-
kind: ONEPASSWORD_SECRET_STORE_KIND,
|
|
365234
|
-
name: store.name,
|
|
365235
|
-
vaultId: stored.vaultId,
|
|
365236
|
-
auth: stored.auth
|
|
365237
|
-
}),
|
|
365238
|
-
resolveSecret: ({ secretStored, stored }) => flatMap10(makeClient2(stored), (client) => tryPromise2({
|
|
365239
|
-
try: () => runOnePasswordRequest("secret resolution", () => client.secrets.resolve(secretStored.uri)),
|
|
365240
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365241
|
-
})),
|
|
365242
|
-
createSecret: ({ stored, value: value7, name }) => flatMap10(makeClient2(stored), (client) => tryPromise2({
|
|
365243
|
-
try: async () => {
|
|
365244
|
-
const item = await runOnePasswordRequest("secret creation", () => client.items.create({
|
|
365245
|
-
category: ItemCategory.Password,
|
|
365246
|
-
vaultId: stored.vaultId,
|
|
365247
|
-
title: name?.trim() || "Executor Secret",
|
|
365248
|
-
fields: [
|
|
365249
|
-
{
|
|
365250
|
-
id: ONEPASSWORD_SECRET_FIELD_ID,
|
|
365251
|
-
title: "Credential",
|
|
365252
|
-
fieldType: ItemFieldType.Concealed,
|
|
365253
|
-
value: value7
|
|
365254
|
-
}
|
|
365255
|
-
]
|
|
365256
|
-
}));
|
|
365257
|
-
return {
|
|
365258
|
-
secretStored: {
|
|
365259
|
-
uri: `op://${stored.vaultId}/${item.id}/${ONEPASSWORD_SECRET_FIELD_ID}`
|
|
365260
|
-
},
|
|
365261
|
-
name: item.title
|
|
365262
|
-
};
|
|
365263
|
-
},
|
|
365264
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365265
|
-
})),
|
|
365266
|
-
updateSecret: ({ secret: _secret, secretStored, stored, name, value: value7 }) => flatMap10(makeClient2(stored), (client) => tryPromise2({
|
|
365267
|
-
try: async () => {
|
|
365268
|
-
const parsed = parseSecretReference(secretStored.uri);
|
|
365269
|
-
const item = await runOnePasswordRequest("secret update", () => client.items.get(parsed.vaultId, parsed.itemId));
|
|
365270
|
-
if (name !== undefined) {
|
|
365271
|
-
item.title = name?.trim() || item.title;
|
|
365272
|
-
}
|
|
365273
|
-
if (value7 !== undefined) {
|
|
365274
|
-
upsertCredentialField(item, value7);
|
|
365275
|
-
}
|
|
365276
|
-
const updated = await runOnePasswordRequest("secret update", () => client.items.put(item));
|
|
365277
|
-
return {
|
|
365278
|
-
name: updated.title,
|
|
365279
|
-
secretStored
|
|
365280
|
-
};
|
|
365281
|
-
},
|
|
365282
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365283
|
-
})),
|
|
365284
|
-
deleteSecret: ({ secretStored, stored }) => flatMap10(makeClient2(stored), (client) => tryPromise2({
|
|
365285
|
-
try: async () => {
|
|
365286
|
-
const parsed = parseSecretReference(secretStored.uri);
|
|
365287
|
-
await runOnePasswordRequest("secret deletion", () => client.items.delete(parsed.vaultId, parsed.itemId));
|
|
365288
|
-
return true;
|
|
365289
|
-
},
|
|
365290
|
-
catch: (cause2) => cause2 instanceof Error ? cause2 : new Error(String(cause2))
|
|
365291
|
-
})),
|
|
365292
|
-
browseSecrets: ({ store, stored, parentKey, query }) => browseSecrets({
|
|
365293
|
-
store,
|
|
365294
|
-
stored,
|
|
365295
|
-
parentKey,
|
|
365296
|
-
query
|
|
365297
|
-
}),
|
|
365298
|
-
importSecret: ({ store, stored, selectionKey, name }) => importSecretFromSelection({
|
|
365299
|
-
store,
|
|
365300
|
-
stored,
|
|
365301
|
-
selectionKey,
|
|
365302
|
-
name
|
|
365303
|
-
}),
|
|
365304
|
-
capabilities: () => ({
|
|
365305
|
-
canCreateSecrets: true,
|
|
365306
|
-
canUpdateSecrets: true,
|
|
365307
|
-
canDeleteSecrets: true,
|
|
365308
|
-
canBrowseSecrets: true,
|
|
365309
|
-
canImportSecrets: true
|
|
365310
|
-
})
|
|
365311
|
-
}
|
|
365312
|
-
},
|
|
365313
|
-
extendExecutor: ({ executor: executor2, secretStore }) => ({
|
|
365314
|
-
getStoreConfig: (storeId) => secretStore.getStoreConfig(storeId),
|
|
365315
|
-
createStore: (value7) => secretStore.createStore(value7),
|
|
365316
|
-
updateStore: (value7) => secretStore.updateStore(value7),
|
|
365317
|
-
removeStore: (storeId) => secretStore.removeStore(storeId),
|
|
365318
|
-
discoverVaults: (value7) => discoverVaults(value7),
|
|
365319
|
-
discoverStoreItems: (value7) => gen2(function* () {
|
|
365320
|
-
const store = yield* secretStore.getStore(value7.storeId);
|
|
365321
|
-
const stored = yield* input.storage.get({
|
|
365322
|
-
scopeId: store.scopeId,
|
|
365323
|
-
storeId: store.id
|
|
365324
|
-
});
|
|
365325
|
-
return yield* discoverStoreItems({
|
|
365326
|
-
store,
|
|
365327
|
-
stored
|
|
365328
|
-
});
|
|
365329
|
-
}),
|
|
365330
|
-
discoverItemFields: (value7) => gen2(function* () {
|
|
365331
|
-
const store = yield* secretStore.getStore(value7.storeId);
|
|
365332
|
-
const stored = yield* input.storage.get({
|
|
365333
|
-
scopeId: store.scopeId,
|
|
365334
|
-
storeId: store.id
|
|
365335
|
-
});
|
|
365336
|
-
return yield* discoverItemFields({
|
|
365337
|
-
store,
|
|
365338
|
-
stored,
|
|
365339
|
-
itemId: value7.itemId
|
|
365340
|
-
});
|
|
365341
|
-
}),
|
|
365342
|
-
importSecret: (value7) => gen2(function* () {
|
|
365343
|
-
const store = yield* secretStore.getStore(value7.storeId);
|
|
365344
|
-
const stored = yield* input.storage.get({
|
|
365345
|
-
scopeId: store.scopeId,
|
|
365346
|
-
storeId: store.id
|
|
365347
|
-
});
|
|
365348
|
-
const imported = yield* importSecretFromSelection({
|
|
365349
|
-
store,
|
|
365350
|
-
stored,
|
|
365351
|
-
selectionKey: secretSelectionKey(value7.itemId, value7.fieldId),
|
|
365352
|
-
name: value7.name?.trim() || null
|
|
365353
|
-
});
|
|
365354
|
-
return yield* createImportedSecretRecord2({
|
|
365355
|
-
executor: executor2,
|
|
365356
|
-
store,
|
|
365357
|
-
secretStored: imported.secretStored,
|
|
365358
|
-
name: imported.name
|
|
365359
|
-
});
|
|
365360
|
-
})
|
|
365361
|
-
})
|
|
365362
|
-
});
|
|
365363
|
-
|
|
365364
364929
|
// packages/platform/api/src/executions/http.ts
|
|
365365
364930
|
var ExecutorExecutionsLive = exports_HttpApiBuilder.group(ExecutorApi, "executions", (handlers) => handlers.handle("list", ({ path: path4 }) => resolveRequestedLocalWorkspace("executions.list", path4.workspaceId).pipe(flatMap10((executor2) => executor2.executions.list()))).handle("create", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("executions.create", path4.workspaceId).pipe(flatMap10((executor2) => executor2.executions.create(payload)))).handle("get", ({ path: path4 }) => resolveRequestedLocalWorkspace("executions.get", path4.workspaceId).pipe(flatMap10((executor2) => executor2.executions.get(path4.executionId)))).handle("resume", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("executions.resume", path4.workspaceId).pipe(flatMap10((executor2) => executor2.executions.resume(path4.executionId, payload)))));
|
|
365366
364931
|
|
|
365367
364932
|
// packages/platform/api/src/local/http.ts
|
|
365368
|
-
var
|
|
364933
|
+
var toStorageError5 = (operation) => (cause2) => new ControlPlaneStorageError({
|
|
365369
364934
|
operation,
|
|
365370
364935
|
message: cause2 instanceof Error ? cause2.message : String(cause2),
|
|
365371
364936
|
details: cause2 instanceof Error ? cause2.stack ?? cause2.message : String(cause2)
|
|
365372
364937
|
});
|
|
365373
|
-
var ExecutorLocalLive = exports_HttpApiBuilder.group(ExecutorApi, "local", (handlers) => handlers.handle("installation", () => flatMap10(getControlPlaneExecutor(), (executor2) => succeed8(executor2.installation))).handle("config", () => flatMap10(getControlPlaneExecutor(), (executor2) => provideExecutorRuntime(flatMap10(LocalInstanceConfigService, (resolveInstanceConfig) => resolveInstanceConfig()), executor2.runtime).pipe(mapError2(
|
|
364938
|
+
var ExecutorLocalLive = exports_HttpApiBuilder.group(ExecutorApi, "local", (handlers) => handlers.handle("installation", () => flatMap10(getControlPlaneExecutor(), (executor2) => succeed8(executor2.installation))).handle("config", () => flatMap10(getControlPlaneExecutor(), (executor2) => provideExecutorRuntime(flatMap10(LocalInstanceConfigService, (resolveInstanceConfig) => resolveInstanceConfig()), executor2.runtime).pipe(mapError2(toStorageError5("local.config"))))).handle("listSecretStores", () => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.list().pipe(mapError2(toStorageError5("local.listSecretStores"))))).handle("createSecretStore", ({ payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.create(payload).pipe(mapError2(toStorageError5("local.createSecretStore"))))).handle("updateSecretStore", ({ path: path4, payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.update({
|
|
365374
364939
|
storeId: path4.storeId,
|
|
365375
364940
|
payload
|
|
365376
|
-
}).pipe(mapError2(
|
|
364941
|
+
}).pipe(mapError2(toStorageError5("local.updateSecretStore"))))).handle("deleteSecretStore", ({ path: path4 }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.remove(path4.storeId).pipe(mapError2(toStorageError5("local.deleteSecretStore"))))).handle("browseSecretStore", ({ path: path4, payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.browse({
|
|
365377
364942
|
storeId: path4.storeId,
|
|
365378
364943
|
payload
|
|
365379
|
-
}).pipe(mapError2(
|
|
364944
|
+
}).pipe(mapError2(toStorageError5("local.browseSecretStore"))))).handle("importSecretFromStore", ({ path: path4, payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secretStores.import({
|
|
365380
364945
|
storeId: path4.storeId,
|
|
365381
364946
|
payload
|
|
365382
|
-
}).pipe(mapError2(
|
|
364947
|
+
}).pipe(mapError2(toStorageError5("local.importSecretFromStore"))))).handle("listSecrets", () => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secrets.list().pipe(mapError2(toStorageError5("local.listSecrets"))))).handle("createSecret", ({ payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secrets.create(payload).pipe(mapError2(toStorageError5("local.createSecret"))))).handle("updateSecret", ({ path: path4, payload }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secrets.update({
|
|
365383
364948
|
secretId: path4.secretId,
|
|
365384
364949
|
payload
|
|
365385
|
-
}).pipe(mapError2(
|
|
364950
|
+
}).pipe(mapError2(toStorageError5("local.updateSecret"))))).handle("deleteSecret", ({ path: path4 }) => flatMap10(getControlPlaneExecutor(), (executor2) => executor2.secrets.remove(path4.secretId).pipe(mapError2(toStorageError5("local.deleteSecret"))))));
|
|
365386
364951
|
|
|
365387
364952
|
// packages/platform/api/src/policies/http.ts
|
|
365388
364953
|
var ExecutorPoliciesLive = exports_HttpApiBuilder.group(ExecutorApi, "policies", (handlers) => handlers.handle("list", ({ path: path4 }) => resolveRequestedLocalWorkspace("policies.list", path4.workspaceId).pipe(flatMap10((executor2) => executor2.policies.list()))).handle("create", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("policies.create", path4.workspaceId).pipe(flatMap10((executor2) => executor2.policies.create(payload)))).handle("get", ({ path: path4 }) => resolveRequestedLocalWorkspace("policies.get", path4.workspaceId).pipe(flatMap10((executor2) => executor2.policies.get(path4.policyId)))).handle("update", ({ path: path4, payload }) => resolveRequestedLocalWorkspace("policies.update", path4.workspaceId).pipe(flatMap10((executor2) => executor2.policies.update(path4.policyId, payload)))).handle("remove", ({ path: path4 }) => resolveRequestedLocalWorkspace("policies.remove", path4.workspaceId).pipe(flatMap10((executor2) => executor2.policies.remove(path4.policyId)), map16((removed) => ({ removed })))));
|
|
@@ -366337,32 +365902,6 @@ var createFileOpenApiSourceStorage = (input) => ({
|
|
|
366337
365902
|
}))
|
|
366338
365903
|
});
|
|
366339
365904
|
|
|
366340
|
-
// packages/platform/server/src/onepassword-store-storage.ts
|
|
366341
|
-
var createFileOnePasswordStoreStorage = (input) => ({
|
|
366342
|
-
get: ({ scopeId, storeId }) => readJsonFile({
|
|
366343
|
-
path: pluginSourceStoragePath({
|
|
366344
|
-
rootDir: input.rootDir,
|
|
366345
|
-
scopeId,
|
|
366346
|
-
sourceId: storeId
|
|
366347
|
-
}),
|
|
366348
|
-
schema: OnePasswordStoredStoreDataSchema
|
|
366349
|
-
}),
|
|
366350
|
-
put: ({ scopeId, storeId, value: value7 }) => writeJsonFile({
|
|
366351
|
-
path: pluginSourceStoragePath({
|
|
366352
|
-
rootDir: input.rootDir,
|
|
366353
|
-
scopeId,
|
|
366354
|
-
sourceId: storeId
|
|
366355
|
-
}),
|
|
366356
|
-
schema: OnePasswordStoredStoreDataSchema,
|
|
366357
|
-
value: value7
|
|
366358
|
-
}),
|
|
366359
|
-
remove: ({ scopeId, storeId }) => removeJsonFile(pluginSourceStoragePath({
|
|
366360
|
-
rootDir: input.rootDir,
|
|
366361
|
-
scopeId,
|
|
366362
|
-
sourceId: storeId
|
|
366363
|
-
}))
|
|
366364
|
-
});
|
|
366365
|
-
|
|
366366
365905
|
// packages/platform/server/src/index.ts
|
|
366367
365906
|
var EXECUTOR_NPM_DIST_TAGS_PATHNAME = "/v1/app/npm/dist-tags";
|
|
366368
365907
|
var EXECUTOR_NPM_DIST_TAGS_URL = "https://registry.npmjs.org/-/package/executor/dist-tags";
|
|
@@ -366370,7 +365909,6 @@ var executorHttpPlugins = [
|
|
|
366370
365909
|
graphqlHttpPlugin(),
|
|
366371
365910
|
googleDiscoveryHttpPlugin(),
|
|
366372
365911
|
mcpHttpPlugin(),
|
|
366373
|
-
onePasswordHttpPlugin(),
|
|
366374
365912
|
openApiHttpPlugin()
|
|
366375
365913
|
];
|
|
366376
365914
|
var disposeExecutor = (executor2) => tryPromise2({
|
|
@@ -366412,11 +365950,6 @@ var createExecutorRuntime = (localDataDir, getLocalServerBaseUrl, options7) => c
|
|
|
366412
365950
|
storage: createFileOpenApiSourceStorage({
|
|
366413
365951
|
rootDir: resolve6(localDataDir, "plugins", "openapi", "sources")
|
|
366414
365952
|
})
|
|
366415
|
-
}),
|
|
366416
|
-
onePasswordSdkPlugin({
|
|
366417
|
-
storage: createFileOnePasswordStoreStorage({
|
|
366418
|
-
rootDir: resolve6(localDataDir, "plugins", "onepassword", "stores")
|
|
366419
|
-
})
|
|
366420
365953
|
})
|
|
366421
365954
|
],
|
|
366422
365955
|
executionResolver: options7.executionResolver,
|