Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
// SPDX-License-Identifier: LicenseRef-Carbon-Commercial
// Carbon Enterprise file, licensed only under the Carbon Commercial License
// (packages/ee/LICENSE). Not AGPL. Running, modifying, or copying it beyond those terms requires a commercial license.
import type { ComponentProps } from "react";
import { z } from "zod";
import { defineIntegration } from "../fns";
import { DEFAULT_MINIMUM_STATE_SECONDS } from "../oee/types";
const SenseSettingsSchema = z.object({
// Empty means "keep the existing vaulted secret"; presence enforced at install.
apiKey: z.string(),
environment: z.enum(["production", "staging"]).default("production"),
minimumStateSeconds: z.coerce
.number()
.int()
.min(0)
.default(DEFAULT_MINIMUM_STATE_SECONDS)
});
export const Sense = defineIntegration({
name: "Sense",
id: "sense",
active: true,
category: "Machine Monitoring",
providerRole: "oee" as const,
logo: Logo,
setupInstructions: SetupInstructions,
description:
"Sense clips a current sensor onto each machine and reports when it runs. Map each Sense station to a work center, and Carbon records machine time on the operation loaded on that work center. Run time with no loaded operation waits under Production → Unattributed Time for a supervisor.",
shortDescription: "Record machine time from Sense machine sensors.",
images: [],
settingGroups: [
{
name: "Connection",
description: "API access to your Sense company"
}
],
settings: [
{
name: "apiKey",
label: "API key",
description:
"A company API key from Sense. It gives Carbon read access to your sites and stations.",
group: "Connection",
type: "secret" as const,
required: true,
value: ""
},
{
name: "environment",
label: "Environment",
group: "Connection",
type: "options" as const,
listOptions: [
{
value: "production",
label: "Production",
description: "bifrost.sensemfg.com"
},
{
value: "staging",
label: "Staging",
description:
"bifrost-staging.sensemfg.com — testing only, plain HTTP, refused in production"
}
],
required: true,
value: "production"
},
{
name: "minimumStateSeconds",
label: "Minimum state (seconds)",
description:
"A run or a stop shorter than this is ignored, so a brief blip does not split machine time.",
group: "Connection",
type: "number" as const,
required: true,
value: DEFAULT_MINIMUM_STATE_SECONDS
}
],
schema: SenseSettingsSchema
});
function SetupInstructions() {
return (
<p className="text-sm text-muted-foreground">
Create a company API key in Sense and paste it below. Then open the
Devices tab and map each Sense station to the work center it measures.
</p>
);
}
// The Sense Manufacturing wordmark, monochrome so it follows the theme like
// the other integration logos. Wide (2737x1118): the shared render sites size
// logos by height, so clamp the height and let the width follow.
function Logo(props: ComponentProps<"svg">) {
return (
<svg
{...props}
viewBox="0 0 2737 1118"
fill="currentColor"
xmlns="http://www.w3.org/2000/svg"
style={{
// Two-line wordmark: taller than the one-line marks to stay legible.
height: "2rem",
width: "auto",
maxWidth: "100%",
// Caller's style last, so a render site that sizes the mark wins.
...props.style
}}
>
<path d="M2324.94 827.909V339.751H2718.95V453.422H2457.44V714.238H2729.41V827.909H2324.94ZM2393.28 634.04V526.646H2691.06V634.04H2393.28Z" />
<path d="M1133.83 339.751V827.909H1267.03V682.856C1267.03 664.725 1266.8 648.453 1266.33 634.04C1265.87 619.628 1267.26 559.789 1266.33 548.631L1502.04 827.909H1629.66V339.751H1496.46V442.264V491.08C1496.46 505.027 1496 605.395 1496.46 617.948L1260.06 339.751H1133.83Z" />
<path d="M587.652 827.909V339.751H981.664V453.422H720.152V714.238H992.125V827.909H587.652ZM655.994 634.04V526.646H953.77V634.04H655.994Z" />
<path d="M246.171 834.882C208.048 834.882 173.877 831.163 143.658 823.724C113.438 816.286 86.706 805.825 63.4604 792.343C40.2149 778.396 19.0614 762.589 0 744.922L71.8288 646.593C102.048 674.953 132.965 694.479 164.579 705.172C196.193 715.4 225.715 720.514 253.144 720.514C263.837 720.514 274.53 719.584 285.223 717.725C295.916 715.865 304.517 712.378 311.026 707.264C318 702.15 321.486 694.712 321.486 684.948C321.486 678.905 319.394 673.558 315.21 668.909C311.491 664.26 306.144 660.541 299.171 657.751C292.197 654.497 284.061 651.707 274.763 649.383C265.465 647.058 255.701 645.198 245.473 643.804C235.245 641.944 224.32 640.317 212.697 638.922C182.943 634.273 156.443 627.764 133.197 619.396C109.952 611.027 90.4253 600.335 74.6183 587.317C58.8113 574.299 46.7236 559.422 38.3552 542.685C30.4517 525.484 26.5 505.957 26.5 484.107C26.5 460.396 32.0789 438.778 43.2368 419.251C54.8596 399.725 70.6666 383.221 90.6578 369.738C111.114 355.791 134.127 345.33 159.697 338.357C185.732 330.918 213.162 327.199 241.987 327.199C277.785 327.199 308.469 330.453 334.039 336.962C360.074 343.471 382.39 352.537 400.986 364.159C419.583 375.317 435.39 388.102 448.407 402.515L375.184 487.593C363.561 477.365 350.311 468.997 335.434 462.488C320.557 455.979 305.214 451.098 289.407 447.843C274.065 444.124 258.723 442.265 243.381 442.265C228.504 442.265 215.487 443.427 204.329 445.751C193.636 448.076 185.035 451.795 178.526 456.909C172.017 461.558 168.763 468.067 168.763 476.436C168.763 483.409 172.017 489.221 178.526 493.87C185.035 498.519 193.403 502.471 203.631 505.725C213.859 508.979 224.552 511.536 235.71 513.396C246.868 514.791 257.096 516.185 266.394 517.58C292.894 521.764 318 527.111 341.71 533.62C365.421 540.128 386.342 548.962 404.473 560.12C422.605 571.277 436.784 585.922 447.013 604.054C457.241 622.185 462.355 644.734 462.355 671.698C462.355 706.567 452.824 736.321 433.763 760.961C414.701 785.137 388.899 803.501 356.355 816.053C323.811 828.606 287.083 834.882 246.171 834.882Z" />
<path d="M2644.93 1117.6C2631.17 1117.6 2618.45 1115.7 2606.75 1111.91C2595.21 1107.96 2585.25 1102.34 2576.88 1095.07C2568.5 1087.64 2561.94 1078.55 2557.2 1067.81C2552.61 1057.06 2550.32 1044.96 2550.32 1031.53C2550.32 1019.2 2552.77 1007.9 2557.67 997.622C2562.57 987.19 2569.45 978.101 2578.3 970.355C2587.15 962.61 2597.58 956.603 2609.6 952.335C2621.77 948.067 2634.97 945.933 2649.19 945.933C2660.42 945.933 2670.69 947.198 2680.02 949.727C2689.5 952.256 2697.88 955.576 2705.15 959.686C2712.58 963.795 2718.66 968.379 2723.41 973.438L2698.99 999.993C2694.56 996.358 2689.82 993.196 2684.76 990.509C2679.7 987.822 2674.17 985.688 2668.16 984.107C2662.31 982.369 2655.91 981.499 2648.96 981.499C2640.89 981.499 2633.39 982.764 2626.43 985.293C2619.63 987.822 2613.63 991.379 2608.41 995.963C2603.35 1000.39 2599.4 1005.68 2596.56 1011.85C2593.87 1017.86 2592.52 1024.42 2592.52 1031.53C2592.52 1039.91 2594.03 1047.26 2597.03 1053.58C2600.03 1059.9 2604.14 1065.2 2609.36 1069.47C2614.58 1073.57 2620.58 1076.74 2627.38 1078.95C2634.18 1081 2641.45 1082.03 2649.19 1082.03C2655.99 1082.03 2662.31 1081.24 2668.16 1079.66C2674.17 1078.08 2679.31 1075.95 2683.57 1073.26C2687.84 1070.41 2691.16 1067.09 2693.53 1063.3C2696.06 1059.51 2697.33 1055.32 2697.33 1050.73V1045.52L2702.78 1054.53H2645.64V1023.47H2735.5C2735.82 1025.52 2736.05 1027.97 2736.21 1030.82C2736.37 1033.66 2736.45 1036.35 2736.45 1038.88C2736.61 1041.25 2736.68 1042.91 2736.68 1043.86C2736.68 1055.4 2734.47 1065.75 2730.05 1074.92C2725.62 1084.09 2719.3 1091.83 2711.08 1098.15C2703.02 1104.32 2693.37 1109.14 2682.15 1112.62C2670.93 1115.94 2658.52 1117.6 2644.93 1117.6Z" />
<path d="M2326.44 1115.23V949.253H2363.91L2469.42 1067.81L2463.02 1066.62C2462.07 1060.93 2461.36 1055.55 2460.88 1050.5C2460.41 1045.28 2459.93 1040.22 2459.46 1035.32C2459.14 1030.42 2458.83 1025.6 2458.51 1020.86C2458.35 1016.12 2458.27 1011.22 2458.27 1006.16C2458.27 1001.1 2458.27 995.805 2458.27 990.272V949.253H2497.4V1115.23H2459.46L2350.15 992.88L2360.82 994.54C2361.46 999.124 2362.01 1003.47 2362.48 1007.58C2362.96 1011.53 2363.35 1015.48 2363.67 1019.44C2364.14 1023.39 2364.54 1027.42 2364.85 1031.53C2365.17 1035.48 2365.33 1039.83 2365.33 1044.57C2365.49 1049.15 2365.57 1054.21 2365.57 1059.74V1115.23H2326.44Z" />
<path d="M2146.1 1115.23V1080.37H2183.32V984.107H2146.1V949.253H2261.09V984.107H2223.63V1080.37H2261.09V1115.23H2146.1Z" />
<path d="M1936.52 1115.23V949.253H2023.06C2035.23 949.253 2045.82 951.466 2054.83 955.892C2063.84 960.318 2070.8 966.562 2075.7 974.623C2080.76 982.527 2083.28 991.774 2083.28 1002.36C2083.28 1012.8 2080.6 1022.28 2075.22 1030.82C2070.01 1039.19 2062.81 1045.75 2053.65 1050.5C2044.64 1055.24 2034.52 1057.61 2023.3 1057.61H1974.93V1115.23H1936.52ZM2045.35 1115.23L1995.08 1040.3L2036.81 1034.37L2091.82 1115.23H2045.35ZM1974.93 1026.79H2019.03C2023.61 1026.79 2027.64 1025.84 2031.12 1023.94C2034.76 1022.04 2037.6 1019.44 2039.66 1016.12C2041.87 1012.64 2042.98 1008.69 2042.98 1004.26C2042.98 999.835 2041.79 996.042 2039.42 992.88C2037.21 989.719 2034.2 987.269 2030.41 985.53C2026.62 983.791 2022.19 982.922 2017.13 982.922H1974.93V1026.79Z" />
<path d="M1793.88 1116.65C1777.92 1116.65 1763.85 1113.49 1751.68 1107.16C1739.66 1100.84 1730.26 1092.07 1723.46 1080.85C1716.82 1069.62 1713.5 1056.9 1713.5 1042.67V949.253H1754.29V1041.25C1754.29 1049 1755.94 1055.87 1759.26 1061.88C1762.74 1067.88 1767.48 1072.55 1773.49 1075.87C1779.5 1079.19 1786.29 1080.85 1793.88 1080.85C1801.63 1080.85 1808.58 1079.19 1814.75 1075.87C1820.91 1072.55 1825.73 1067.88 1829.21 1061.88C1832.85 1055.87 1834.66 1049 1834.66 1041.25V949.253H1874.02V1042.67C1874.02 1056.9 1870.62 1069.62 1863.83 1080.85C1857.19 1092.07 1847.78 1100.84 1835.61 1107.16C1823.6 1113.49 1809.69 1116.65 1793.88 1116.65Z" />
<path d="M1566.81 1115.23V984.819H1508.01V949.253H1666.87V984.819H1607.12V1115.23H1566.81Z" />
<path d="M1403.38 1117.6C1389.79 1117.6 1377.22 1115.54 1365.68 1111.43C1354.14 1107.32 1344.03 1101.47 1335.33 1093.89C1326.64 1086.14 1319.92 1077.05 1315.18 1066.62C1310.44 1056.03 1308.07 1044.33 1308.07 1031.53C1308.07 1019.04 1310.52 1007.58 1315.42 997.148C1320.47 986.715 1327.27 977.626 1335.81 969.881C1344.5 962.136 1354.62 956.208 1366.16 952.098C1377.85 947.988 1390.42 945.933 1403.86 945.933C1413.18 945.933 1422.27 947.04 1431.12 949.253C1439.98 951.466 1448.12 954.548 1455.55 958.5C1463.13 962.452 1469.53 966.957 1474.75 972.015L1451.04 1002.36C1447.09 998.729 1442.66 995.488 1437.76 992.643C1433.02 989.64 1427.73 987.348 1421.88 985.767C1416.03 984.028 1409.47 983.159 1402.2 983.159C1395.4 983.159 1388.84 984.265 1382.52 986.478C1376.35 988.691 1370.74 991.853 1365.68 995.963C1360.78 1000.07 1356.83 1005.21 1353.83 1011.37C1350.98 1017.38 1349.56 1024.26 1349.56 1032C1349.56 1039.59 1351.06 1046.47 1354.06 1052.63C1357.07 1058.64 1361.18 1063.77 1366.39 1068.04C1371.77 1072.15 1377.85 1075.31 1384.65 1077.53C1391.61 1079.58 1398.96 1080.61 1406.7 1080.61C1414.13 1080.61 1420.77 1079.66 1426.62 1077.76C1432.47 1075.71 1437.76 1073.18 1442.5 1070.18C1447.25 1067.02 1451.44 1064.01 1455.07 1061.17L1474.28 1092.23C1469.85 1096.34 1463.92 1100.37 1456.49 1104.32C1449.22 1108.11 1441 1111.27 1431.84 1113.8C1422.83 1116.33 1413.34 1117.6 1403.38 1117.6Z" />
<path d="M1097.07 1115.23L1172 949.253H1208.28L1282.96 1115.23H1241.71L1200.45 1022.99C1198.87 1019.67 1197.37 1016.35 1195.95 1013.03C1194.68 1009.56 1193.42 1006.16 1192.15 1002.84C1190.89 999.361 1189.7 995.963 1188.6 992.643C1187.49 989.166 1186.46 985.846 1185.51 982.685L1193.81 982.448C1192.71 986.083 1191.6 989.561 1190.49 992.88C1189.39 996.2 1188.12 999.598 1186.7 1003.08C1185.44 1006.4 1184.09 1009.71 1182.67 1013.03C1181.25 1016.35 1179.82 1019.75 1178.4 1023.23L1137.38 1115.23H1097.07ZM1132.17 1084.88L1144.97 1054.53H1234.36L1242.89 1084.88H1132.17Z" />
<path d="M948.734 1115.23V949.253H989.042V1115.23H948.734ZM965.806 1053.1V1019.44H1069.18V1053.1H965.806ZM967.702 984.819V949.253H1078.9V984.819H967.702Z" />
<path d="M806.099 1116.65C790.134 1116.65 776.065 1113.49 763.894 1107.16C751.881 1100.84 742.476 1092.07 735.679 1080.85C729.04 1069.62 725.72 1056.9 725.72 1042.67V949.253H766.502V1041.25C766.502 1049 768.162 1055.87 771.481 1061.88C774.959 1067.88 779.701 1072.55 785.708 1075.87C791.714 1079.19 798.511 1080.85 806.099 1080.85C813.844 1080.85 820.799 1079.19 826.964 1075.87C833.129 1072.55 837.95 1067.88 841.427 1061.88C845.063 1055.87 846.881 1049 846.881 1041.25V949.253H886.24V1042.67C886.24 1056.9 882.842 1069.62 876.045 1080.85C869.406 1092.07 860.001 1100.84 847.829 1107.16C835.816 1113.49 821.906 1116.65 806.099 1116.65Z" />
<path d="M492.122 1115.23V949.253H529.584L635.096 1067.81L628.694 1066.62C627.746 1060.93 627.407 1077.75 626.933 1072.69C626.459 1067.47 625.612 1076.19 625.138 1071.29C624.822 1066.39 624.505 1025.6 624.189 1020.86C624.031 1016.12 623.952 1011.22 623.952 1006.16C623.952 1001.1 623.952 995.805 623.952 990.272V949.253H663.074V1115.23H625.138L515.832 992.88L526.502 994.54C527.134 999.124 527.688 1000.24 528.162 1004.34C528.636 1008.3 529.031 996.46 529.347 1000.41C529.822 1004.36 530.217 981.908 530.533 986.018C530.849 989.97 531.007 949.211 531.007 953.953C531.165 958.537 531.244 1054.21 531.244 1059.74V1115.23H492.122Z" />
<path d="M265.355 1115.23L340.28 949.253H376.557L451.245 1115.23H409.989L368.733 1022.99C367.152 1019.67 365.65 1016.35 364.228 1013.03C362.963 1009.56 361.699 1006.16 360.434 1002.84C359.17 999.361 357.984 995.963 356.878 992.643C355.771 989.166 354.744 985.846 353.795 982.685L362.094 982.448C360.987 986.083 359.881 989.561 358.774 992.88C357.668 996.2 356.403 999.598 354.981 1003.08C353.716 1006.4 352.373 1009.71 350.95 1013.03C349.527 1016.35 348.105 1019.75 346.682 1023.23L305.663 1115.23H265.355ZM300.447 1084.88L313.25 1054.53H402.639L411.175 1084.88H300.447Z" />
<path d="M38.9828 1115.23V949.253H75.0227L144.02 1045.04L119.836 1044.81L189.07 949.253H224.636V1115.23H185.514V1062.11C185.514 1048.52 185.83 1036.03 186.462 1024.65C187.094 1013.11 188.359 1001.5 190.256 989.798L194.287 1002.84L139.278 1074.92H123.629L68.858 1002.6L73.363 989.798C75.2598 1001.18 76.5244 1012.56 77.1567 1023.94C77.789 1035.32 78.1051 1048.05 78.1051 1062.11V1115.23H38.9828Z" />
<path d="M1880.95 823.725C1911.17 831.163 1945.34 834.882 1983.46 834.882C2024.37 834.882 2061.1 828.606 2093.64 816.054C2126.19 803.501 2151.99 785.137 2171.05 760.962C2190.11 736.321 2199.64 706.567 2199.64 671.698C2199.64 644.734 2194.53 622.185 2184.3 604.054C2174.07 585.922 2159.89 571.278 2141.76 560.12C2123.63 548.962 2102.71 540.129 2079 533.62C2055.29 527.111 2030.18 521.765 2003.68 517.58C1994.39 516.186 1984.16 514.791 1973 513.396C1961.84 511.536 1951.15 508.979 1940.92 505.725C1919.42 498.885 1901.56 486.32 1887.49 468.684L1815.25 378.109C1797.81 392.754 1792.15 399.725 1780.53 419.251C1769.37 438.778 1763.79 460.396 1763.79 484.107C1763.79 505.958 1767.74 525.484 1775.65 542.686C1784.01 559.422 1796.1 574.3 1811.91 587.317C1827.72 600.335 1847.24 611.028 1870.49 619.396C1893.73 627.764 1920.23 634.273 1949.99 638.922C1961.61 640.317 1972.54 641.944 1982.76 643.804C1992.99 645.199 2002.75 647.058 2012.05 649.383C2021.35 651.707 2029.49 654.497 2036.46 657.751C2043.43 660.541 2048.78 664.26 2052.5 668.909C2056.68 673.558 2058.78 678.905 2058.78 684.948C2058.78 694.712 2055.29 702.15 2048.32 707.264C2041.81 712.378 2033.21 715.865 2022.51 717.725C2011.82 719.584 2001.13 720.514 1990.43 720.514C1963 720.514 1933.48 715.4 1901.87 705.172C1870.25 694.479 1839.34 674.953 1809.12 646.593L1737.29 744.922C1756.35 762.589 1777.5 778.396 1800.75 792.343C1824 805.826 1850.73 816.286 1880.95 823.725Z" />
<path d="M1749.04 232.616C1893.84 130.009 2087.94 129.104 2233.79 230.855L2162.03 325.392C2059.49 256.229 1925.13 256.511 1822.99 325.608L1784.56 276.99C1784.54 276.962 1784.52 276.932 1784.5 276.904L1749.04 232.616Z" />
<path d="M1843.83 351.974C1933.86 292.081 2051.12 290.235 2143.26 348.23L2144.23 348.839L2072.11 443.848C2023.8 417.274 1965.19 418.081 1917.77 445.533L1843.83 351.974Z" />
<path d="M1652.04 111.455C1849.92 -38.5421 2125.02 -36.8863 2321.81 114.895L2250.13 209.326C2096.28 90.1677 1881.32 88.2353 1726.17 204.047L1652.04 111.455Z" />
</svg>
);
}