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

Function normalizeConnectionInputs

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

Source from the content-addressed store, hash-verified

882 * `values` map, or the canonical per-variable `inputs` map) into a uniform list
883 * of named origins. */
884const normalizeConnectionInputs = (
885 input: ConnectionValueInput,
886): readonly NormalizedConnectionInput[] => {
887 if ("inputs" in input) {
888 return Object.entries(input.inputs).map(([variable, origin]) => ({ variable, origin }));
889 }
890 if ("values" in input) {
891 return Object.entries(input.values).map(([variable, value]) => ({
892 variable,
893 origin: { value },
894 }));
895 }
896 if ("from" in input) {
897 return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { from: input.from } }];
898 }
899 return [{ variable: PRIMARY_INPUT_VARIABLE, origin: { value: input.value } }];
900};
901
902/** Decode a connection row's `item_ids` JSON map (`variable → provider item id`).
903 * 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