MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / normalizeConnectionInputs

Function normalizeConnectionInputs

packages/core/sdk/src/executor.ts:608–624  ·  view source on GitHub ↗
(
  input: ConnectionValueInput,
)

Source from the content-addressed store, hash-verified

606 * `values` map, or the canonical per-variable `inputs` map) into a uniform list
607 * of named origins. */
608const normalizeConnectionInputs = (
609 input: ConnectionValueInput,
610): readonly NormalizedConnectionInput[] => {
611 if ("inputs" in input) {
612 return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin }));
613 }
614 if ("values" in input) {
615 return Object.entries(input.values).map(([variable, value]) => ({
616 variable,
617 origin: { value },
618 }));
619 }
620 if ("from" in input) {
621 return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }];
622 }
623 return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }];
624};
625
626/** Decode a connection row's `item_ids` JSON map (`variable → provider item id`).
627 * Tolerates the historically-single shape by returning `{}` for anything that

Callers 2

connectionsCreateFunction · 0.85
resolveInFlightValuesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected